Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: failing test for content in same slot #67

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
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()
})
Loading