Skip to content

Commit

Permalink
$mol_jsx: fragment test
Browse files Browse the repository at this point in the history
  • Loading branch information
jin committed Dec 15, 2024
1 parent fecc46c commit e05f1e9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions jsx/jsx.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/** @jsx $mol_jsx */
/** @jsxFrag $mol_jsx_frag */
namespace $ {

$mol_test({
Expand Down Expand Up @@ -61,6 +62,32 @@ namespace $ {

} ,

'Make fragment'() {

const dom =
<>
<br />
<hr />
</>

$mol_assert_equal( $mol_dom_serialize( dom ), '<br xmlns="http://www.w3.org/1999/xhtml" /><hr xmlns="http://www.w3.org/1999/xhtml" />' )

} ,

'Spread fragment'() {

const dom =
<div>
<>
<br />
<hr />
</>
</div>

$mol_assert_equal( dom.outerHTML, '<div><br><hr></div>' )

} ,

'Function as component'() {

const Button = (
Expand Down

0 comments on commit e05f1e9

Please sign in to comment.