Skip to content

Commit

Permalink
test(#955): add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Feb 3, 2024
1 parent d7f0835 commit e1a3ea9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/printer/printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,13 @@ import * as ns from '../components';
code: `${` + RENDER_COMPONENT + `($$result,'Component',Component,{},({"\"name\"": () => $$render` + BACKTICK + `${$$maybeRenderHead($$result)}<div></div>` + BACKTICK + `,}))}`,
},
},
{
name: "#955 ternary slot",
source: `<Component>Hello{isLeaf ? <p>Leaf</p> : <p>Branch</p>}world</Component>`,
want: want{
code: `${` + RENDER_COMPONENT + `($$result,'Component',Component,{},$$mergeSlots(({"default": () => $$render` + BACKTICK + `Hello` + BACKTICK + `,isLeaf ? ({"default": () => $$render` + BACKTICK + `${$$maybeRenderHead($$result)}<p>Leaf</p>` + BACKTICK + `}) : undefined, ,isLeaf ? ({"default": () => $$render` + BACKTICK + `${$$maybeRenderHead($$result)}<p>Branch</p>` + BACKTICK + `}) : undefined}), ({"default": () => $$render` + BACKTICK + `world` + BACKTICK + `}),))}`,
},
},
{
name: "noscript component",
source: `
Expand Down

0 comments on commit e1a3ea9

Please sign in to comment.