-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(engine-server): test scoped slot forwarding (#4669)
- Loading branch information
1 parent
02e434e
commit 5391bc3
Showing
11 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
17 changes: 17 additions & 0 deletions
17
...ages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/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,17 @@ | ||
<x-light-container> | ||
<x-scoped-slot-parent> | ||
<x-scoped-slot-child> | ||
<x-leaf> | ||
<template shadowrootmode="open"> | ||
<slot> | ||
</slot> | ||
<slot name="foo"> | ||
</slot> | ||
</template> | ||
<h2> | ||
Hello world! | ||
</h2> | ||
</x-leaf> | ||
</x-scoped-slot-child> | ||
</x-scoped-slot-parent> | ||
</x-light-container> |
4 changes: 4 additions & 0 deletions
4
packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/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,4 @@ | ||
export const tagName = 'x-light-container'; | ||
export { default } from 'x/lightContainer'; | ||
export * from 'x/lightContainer'; | ||
export const features = []; |
4 changes: 4 additions & 0 deletions
4
...ngine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/leaf/leaf.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,4 @@ | ||
<template> | ||
<slot></slot> | ||
<slot name="foo"></slot> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
.../engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/leaf/leaf.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 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement {} |
3 changes: 3 additions & 0 deletions
3
...ests__/fixtures/slot-forwarding/scoped-slots/modules/x/lightContainer/lightContainer.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,3 @@ | ||
<template lwc:render-mode="light"> | ||
<x-scoped-slot-parent></x-scoped-slot-parent> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
..._tests__/fixtures/slot-forwarding/scoped-slots/modules/x/lightContainer/lightContainer.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 extends LightningElement { | ||
static renderMode = 'light'; | ||
} |
6 changes: 6 additions & 0 deletions
6
...ts__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotChild/scopedSlotChild.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"> | ||
<x-leaf> | ||
<!-- Note the slot mapping does not work for scoped slots --> | ||
<slot lwc:slot-bind={title} slot="foo"></slot> | ||
</x-leaf> | ||
</template> |
7 changes: 7 additions & 0 deletions
7
...ests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotChild/scopedSlotChild.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,7 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
static renderMode = 'light'; | ||
|
||
title = 'Hello world!'; | ||
} |
7 changes: 7 additions & 0 deletions
7
...__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotParent/scopedSlotParent.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,7 @@ | ||
<template lwc:render-mode="light"> | ||
<x-scoped-slot-child> | ||
<template lwc:slot-data="title"> | ||
<h2>{title}</h2> | ||
</template> | ||
</x-scoped-slot-child> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ts__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotParent/scopedSlotParent.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 extends LightningElement { | ||
static renderMode = 'light'; | ||
} |