-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ssr): more tests for mixed light/scoped slots (#5133)
Co-authored-by: John Hefferman <[email protected]>
- Loading branch information
1 parent
2b678bb
commit 095a777
Showing
21 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
18 changes: 18 additions & 0 deletions
18
...ver/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<x-parent> | ||
<template shadowrootmode="open"> | ||
<x-child> | ||
<div> | ||
<!----> | ||
<!----> | ||
<!----> | ||
<span> | ||
a | ||
</span> | ||
<span> | ||
b | ||
</span> | ||
<!----> | ||
</div> | ||
</x-child> | ||
</template> | ||
</x-parent> |
3 changes: 3 additions & 0 deletions
3
...e-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const tagName = 'x-parent'; | ||
export { default } from 'x/parent'; | ||
export * from 'x/parent'; |
6 changes: 6 additions & 0 deletions
6
...ts__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/child/child.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template lwc:render-mode="light"> | ||
<div> | ||
<slot>Default fallback slot content</slot> | ||
<slot name="foo">Named fallback slot content</slot> | ||
</div> | ||
</template> |
6 changes: 6 additions & 0 deletions
6
...ests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/child/child.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class Child extends LightningElement { | ||
static renderMode = 'light'; | ||
item = { id: 99, name: 'ssr' }; | ||
} |
9 changes: 9 additions & 0 deletions
9
...__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/parent/parent.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<x-child> | ||
<span slot="foo">a</span> | ||
<template lwc:slot-data="data1"> | ||
<span>default {data1.id} - {foo}</span> | ||
</template> | ||
<span slot="foo">b</span> | ||
</x-child> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ts__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/parent/parent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class Parent extends LightningElement { | ||
foo = 'bar'; | ||
} |
Empty file.
6 changes: 6 additions & 0 deletions
6
...ver/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<x-parent> | ||
<template shadowrootmode="open"> | ||
<x-child> | ||
</x-child> | ||
</template> | ||
</x-parent> |
3 changes: 3 additions & 0 deletions
3
...e-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const tagName = 'x-parent'; | ||
export { default } from 'x/parent'; | ||
export * from 'x/parent'; |
2 changes: 2 additions & 0 deletions
2
...ts__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/child/child.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<template lwc:render-mode="light"> | ||
</template> |
6 changes: 6 additions & 0 deletions
6
...ests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/child/child.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class Child extends LightningElement { | ||
static renderMode = 'light'; | ||
item = { id: 99, name: 'ssr' }; | ||
} |
9 changes: 9 additions & 0 deletions
9
...__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/parent/parent.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<x-child> | ||
<span slot="foo">a</span> | ||
<template lwc:slot-data="data1"> | ||
<span>default {data1.id} - {foo}</span> | ||
</template> | ||
<span slot="foo">b</span> | ||
</x-child> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ts__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/parent/parent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class Parent extends LightningElement { | ||
foo = 'bar'; | ||
} |
Empty file.
27 changes: 27 additions & 0 deletions
27
...er/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<x-parent> | ||
<template shadowrootmode="open"> | ||
<x-child> | ||
<div> | ||
<!----> | ||
<!----> | ||
<span> | ||
1 default 99 - bar | ||
</span> | ||
<!----> | ||
<!----> | ||
<span> | ||
5 default 99 - bar | ||
</span> | ||
<!----> | ||
<!----> | ||
<!----> | ||
<!----> | ||
<!----> | ||
<!----> | ||
<!----> | ||
Fallback slot content 3 | ||
<!----> | ||
</div> | ||
</x-child> | ||
</template> | ||
</x-parent> |
3 changes: 3 additions & 0 deletions
3
...-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const tagName = 'x-parent'; | ||
export { default } from 'x/parent'; | ||
export * from 'x/parent'; |
8 changes: 8 additions & 0 deletions
8
...s__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/child/child.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template lwc:render-mode="light"> | ||
<div> | ||
<slot lwc:slot-bind={item}>Fallback slot content</slot> | ||
<slot lwc:slot-bind={item} name="slot1">Fallback slot content 1</slot> | ||
<slot lwc:slot-bind={item} name="slot2">Fallback slot content 2</slot> | ||
<slot lwc:slot-bind={item} name="slot3">Fallback slot content 3</slot> | ||
</div> | ||
</template> |
6 changes: 6 additions & 0 deletions
6
...sts__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/child/child.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class Child extends LightningElement { | ||
static renderMode = 'light'; | ||
item = { id: 99, name: 'ssr' }; | ||
} |
13 changes: 13 additions & 0 deletions
13
..._/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/parent/parent.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<template> | ||
<x-child> | ||
<template lwc:slot-data="data1"> | ||
<span>1 default {data1.id} - {foo}</span> | ||
</template> | ||
<span>2 default {data1} - {foo}</span> | ||
<span slot="slot1">3 slot1 {data1} - {foo}</span> | ||
<span slot="slot2">4 slot2 {data1} - {foo}</span> | ||
<template lwc:slot-data="data1"> | ||
<span>5 default {data1.id} - {foo}</span> | ||
</template> | ||
</x-child> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...s__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/parent/parent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class Parent extends LightningElement { | ||
foo = 'bar'; | ||
} |