Skip to content

Commit

Permalink
Updates slot attribute set.
Browse files Browse the repository at this point in the history
  • Loading branch information
kj committed May 31, 2024
1 parent be8f30c commit a553225
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function fillSlots(node, template) {
nodeName: 'span',
tagName: 'span',
attrs: [
{ name: 'slot', value: ' '}
{ name: 'slot', value: ''}
],
childNodes: [child]
}
Expand Down
16 changes: 8 additions & 8 deletions test/enhance.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test('default content in unnamed slot', t => {
`
const expected = `
<my-button>
<button><span slot=" ">Submit</span></button>
<button><span slot="">Submit</span></button>
</my-button>
`
t.equal(
Expand Down Expand Up @@ -115,7 +115,7 @@ test('should replace default content in unnamed slot', t => {
`
const expected = `
<my-button>
<button><span slot=" ">Let's Go!</span></button>
<button><span slot="">Let's Go!</span></button>
</my-button>
`
t.equal(
Expand Down Expand Up @@ -311,7 +311,7 @@ test('add authored children to unnamed slot', t => {
<my-content id="0">
<h2>My Content</h2>
<h4 slot="title">Custom title</h4>
<span slot=" ">Just text</span>
<span slot="">Just text</span>
</my-content>
`
Expand Down Expand Up @@ -885,7 +885,7 @@ test('should support nested custom elements with nested slots', t => {
</span>
<my-heading>
<h1>
<span slot=" ">My Heading</span>
<span slot="">My Heading</span>
</h1>
</my-heading>
</my-super-heading>
Expand Down Expand Up @@ -999,9 +999,9 @@ ${Head()}
<link rel="stylesheet" href="my-link-node-second.css">
</head>
<body>
<my-link-node-first><span slot=" ">first</span></my-link-node-first>
<my-link-node-second><span slot=" ">second</span></my-link-node-second>
<my-link-node-first><span slot=" ">first again</span></my-link-node-first>
<my-link-node-first><span slot="">first</span></my-link-node-first>
<my-link-node-second><span slot="">second</span></my-link-node-second>
<my-link-node-first><span slot="">first again</span></my-link-node-first>
</body>
</html>
`
Expand Down Expand Up @@ -1094,7 +1094,7 @@ test('multiple slots with unnamed slot first', t => {
`
const expected = `
<multiple-slots enhanced="✨">
<span slot=" ">unnamed slot</span><div slot="slot1">slot One</div>
<span slot="">unnamed slot</span><div slot="slot1">slot One</div>
</multiple-slots>
`
t.equal(
Expand Down

0 comments on commit a553225

Please sign in to comment.