-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: test usage of default slot with scoped data (#5024)
* chore: test usage of default slot with scoped data * chore: add comment to explain why content not rendered
- Loading branch information
1 parent
27c6867
commit 3d28140
Showing
8 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
15 changes: 15 additions & 0 deletions
15
packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/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,15 @@ | ||
<x-parent> | ||
<template shadowrootmode="open"> | ||
<x-child> | ||
<div> | ||
<!----> | ||
<!----> | ||
<span> | ||
Slotted content within template 99 | ||
</span> | ||
<!----> | ||
<!----> | ||
</div> | ||
</x-child> | ||
</template> | ||
</x-parent> |
3 changes: 3 additions & 0 deletions
3
packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/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'; |
5 changes: 5 additions & 0 deletions
5
...engine-server/src/__tests__/fixtures/scoped-slots/default-slot/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,5 @@ | ||
<template lwc:render-mode="light"> | ||
<div> | ||
<slot lwc:slot-bind={item}>Fallback slot content</slot> | ||
</div> | ||
</template> |
6 changes: 6 additions & 0 deletions
6
...c/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/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
...gine-server/src/__tests__/fixtures/scoped-slots/default-slot/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> | ||
<!-- TODO [#5020]: Fix rendering of scoped slot content, so that content outside of the template renders correctly with engine-server --> | ||
<span>Slotted content outside of template</span> | ||
<template lwc:slot-data="data"> | ||
<span>Slotted content within template {data.id}</span> | ||
</template> | ||
</x-child> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...engine-server/src/__tests__/fixtures/scoped-slots/default-slot/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'; | ||
} |
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