Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions test/enhance.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,3 +1102,28 @@ test('multiple slots with unnamed slot first', t => {
)
t.end()
})

test('multiple items in the same slot', t => {
const html = enhance({
bodyContent: true,
elements: {
'multiple-slots': MultipleSlots,
}
})
const actual = html`
<multiple-slots>unnamed slot<div slot="slot1">slot One</div><div slot="slot1">more One</div><div slot="slot1">even more One</div></multiple-slots>
`
const expected = `
<multiple-slots enhanced="✨">
unnamed slot<div slot="slot1">slot One</div>
<div slot="slot1">more One</div>
<div slot="slot1">even more One</div>
</multiple-slots>
`
t.equal(
strip(actual),
strip(expected),
'multiple items in the same slot'
)
t.end()
})