@@ -39,42 +39,62 @@ it('babelPluginReactLive', async () => {
3939 } )
4040
4141 expect ( formattedCode ) . toMatchInlineSnapshot ( `
42- "const ComponentBox = ({ children }) => children
43- export const MockNoInlineWithComponent = () => {
44- return (
45- <ComponentBox data-test="id" noInline>{\`const DemoComponent = () => {
46- return <>content</>
47- }
48- render(<DemoComponent />)
49- \`}</ComponentBox>
50- )
51- }
52- export const MockNoInlineWithText = () => {
53- return (
54- <ComponentBox data-test="id" noInline>{\`render(<>content</>)
55- \`}</ComponentBox>
56- )
57- }
58- export const MockOneChilds = () => {
59- return (
60- <ComponentBox data-test="id">{\`<div>content</div>
61- \`}</ComponentBox>
62- )
63- }
64- export const MockManyChilds = () => {
65- return (
66- <ComponentBox data-test="id">{\`<>
67- <div>content 1</div>
68- <div>content 2</div>
69- <div>content 3</div>
70- </>
71- \`}</ComponentBox>
72- )
73- }
74- "
75- ` )
42+ "const ComponentBox = ({ children }) => children
43+ export const MockNoInlineWithComponent = () => {
44+ return (
45+ <ComponentBox data-test="id" noInline>{\`const DemoComponent = () => {
46+ return <>content</>
47+ }
48+ render(<DemoComponent />)
49+ \`}</ComponentBox>
50+ )
51+ }
52+ export const MockNoInlineWithText = () => {
53+ return (
54+ <ComponentBox data-test="id" noInline>{\`render(<>content</>)
55+ \`}</ComponentBox>
56+ )
57+ }
58+ export const MockOneChilds = () => {
59+ return (
60+ <ComponentBox data-test="id">{\`<div>content</div>
61+ \`}</ComponentBox>
62+ )
63+ }
64+ export const MockManyChilds = () => {
65+ return (
66+ <ComponentBox data-test="id">{\`<>
67+ <div>content 1</div>
68+ <div>content 2</div>
69+ <div>content 3</div>
70+ </>
71+ \`}</ComponentBox>
72+ )
73+ }
74+ export const MockFragment = () => {
75+ return (
76+ <ComponentBox data-test="id">{\`<>
77+ <span>content 1</span>
78+ <span>content 2</span>
79+ <span>content 3</span>
80+ </>
81+ \`}</ComponentBox>
82+ )
83+ }
84+ export const MockText = () => {
85+ return (
86+ <ComponentBox data-test="id">{\`<>
87+ text
88+ <span>content</span>
89+ text
90+ </>
91+ \`}</ComponentBox>
92+ )
93+ }
94+ "
95+ ` )
7696
7797 expect ( formattedCode . match ( / n o I n l i n e / g) ) . toHaveLength ( 2 )
78- expect ( formattedCode . match ( / \{ ` / g) ) . toHaveLength ( 4 )
79- expect ( formattedCode . match ( / ` \} / g) ) . toHaveLength ( 4 )
98+ expect ( formattedCode . match ( / \{ ` / g) ) . toHaveLength ( 6 )
99+ expect ( formattedCode . match ( / ` \} / g) ) . toHaveLength ( 6 )
80100} )
0 commit comments