From d177dde0966525d469d1272bc09c467614f8d0c2 Mon Sep 17 00:00:00 2001 From: jurajk Date: Tue, 3 Mar 2020 16:54:03 +0100 Subject: [PATCH] add test --- .../src/components/Preview/CodeExample.js | 1 + .../src/components/Preview/Preview.test.js | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/styleguide/src/components/Preview/CodeExample.js b/packages/styleguide/src/components/Preview/CodeExample.js index 49aca0ccdd3..28f48aa1bfa 100644 --- a/packages/styleguide/src/components/Preview/CodeExample.js +++ b/packages/styleguide/src/components/Preview/CodeExample.js @@ -211,6 +211,7 @@ export default class CodeExample extends React.Component { { const { getByText } = render(Preview); expect(getByText('Preview')).toBeInTheDocument(); }); + + it('HTML preview renders more than 1 child', () => { + const { getByText, getByTestId } = render( + +

Paragraph 1

+

Paragraph 2

+
+ ); + + fireEvent.click(getByText('SHOW CODE')); + + fireEvent.click(getByText('HTML')); + + expect(getByTestId('html')).toBeInTheDocument(); + }); });