Skip to content

Commit e05f1e9

Browse files
author
jin
committed
$mol_jsx: fragment test
1 parent fecc46c commit e05f1e9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

jsx/jsx.test.tsx

+27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/** @jsx $mol_jsx */
2+
/** @jsxFrag $mol_jsx_frag */
23
namespace $ {
34

45
$mol_test({
@@ -61,6 +62,32 @@ namespace $ {
6162

6263
} ,
6364

65+
'Make fragment'() {
66+
67+
const dom =
68+
<>
69+
<br />
70+
<hr />
71+
</>
72+
73+
$mol_assert_equal( $mol_dom_serialize( dom ), '<br xmlns="http://www.w3.org/1999/xhtml" /><hr xmlns="http://www.w3.org/1999/xhtml" />' )
74+
75+
} ,
76+
77+
'Spread fragment'() {
78+
79+
const dom =
80+
<div>
81+
<>
82+
<br />
83+
<hr />
84+
</>
85+
</div>
86+
87+
$mol_assert_equal( dom.outerHTML, '<div><br><hr></div>' )
88+
89+
} ,
90+
6491
'Function as component'() {
6592

6693
const Button = (

0 commit comments

Comments
 (0)