-
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): more slot tests (#4666)
- Loading branch information
1 parent
ed5327f
commit 02e434e
Showing
29 changed files
with
233 additions
and
0 deletions.
There are no files selected for viewing
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
Empty file.
23 changes: 23 additions & 0 deletions
23
...@lwc/engine-server/src/__tests__/fixtures/duplicate-slots-in-template/light/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,23 @@ | ||
<x-outer> | ||
<x-inner> | ||
a | ||
<!----> | ||
<div> | ||
yolo | ||
</div> | ||
<!----> | ||
b | ||
<!----> | ||
<div> | ||
yolo | ||
</div> | ||
<!----> | ||
c | ||
<!----> | ||
<div> | ||
yolo | ||
</div> | ||
<!----> | ||
d | ||
</x-inner> | ||
</x-outer> |
3 changes: 3 additions & 0 deletions
3
...ages/@lwc/engine-server/src/__tests__/fixtures/duplicate-slots-in-template/light/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-outer'; | ||
export { default } from 'x/outer'; | ||
export * from 'x/outer'; |
9 changes: 9 additions & 0 deletions
9
...erver/src/__tests__/fixtures/duplicate-slots-in-template/light/modules/x/inner/inner.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 lwc:render-mode="light"> | ||
a | ||
<slot name=foo></slot> | ||
b | ||
<slot name=foo></slot> | ||
c | ||
<slot name=foo></slot> | ||
d | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...-server/src/__tests__/fixtures/duplicate-slots-in-template/light/modules/x/inner/inner.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' | ||
} |
5 changes: 5 additions & 0 deletions
5
...erver/src/__tests__/fixtures/duplicate-slots-in-template/light/modules/x/outer/outer.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"> | ||
<x-inner> | ||
<div slot="foo">yolo</div> | ||
</x-inner> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...-server/src/__tests__/fixtures/duplicate-slots-in-template/light/modules/x/outer/outer.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' | ||
} |
Empty file.
21 changes: 21 additions & 0 deletions
21
...lwc/engine-server/src/__tests__/fixtures/duplicate-slots-in-template/shadow/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,21 @@ | ||
<x-outer> | ||
<template shadowrootmode="open"> | ||
<x-inner> | ||
<template shadowrootmode="open"> | ||
a | ||
<slot name="foo"> | ||
</slot> | ||
b | ||
<slot name="foo"> | ||
</slot> | ||
c | ||
<slot name="foo"> | ||
</slot> | ||
d | ||
</template> | ||
<div slot="foo"> | ||
yolo | ||
</div> | ||
</x-inner> | ||
</template> | ||
</x-outer> |
3 changes: 3 additions & 0 deletions
3
...ges/@lwc/engine-server/src/__tests__/fixtures/duplicate-slots-in-template/shadow/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-outer'; | ||
export { default } from 'x/outer'; | ||
export * from 'x/outer'; |
9 changes: 9 additions & 0 deletions
9
...rver/src/__tests__/fixtures/duplicate-slots-in-template/shadow/modules/x/inner/inner.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> | ||
a | ||
<slot name=foo></slot> | ||
b | ||
<slot name=foo></slot> | ||
c | ||
<slot name=foo></slot> | ||
d | ||
</template> |
4 changes: 4 additions & 0 deletions
4
...server/src/__tests__/fixtures/duplicate-slots-in-template/shadow/modules/x/inner/inner.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 @@ | ||
import { LightningElement} from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
} |
5 changes: 5 additions & 0 deletions
5
...rver/src/__tests__/fixtures/duplicate-slots-in-template/shadow/modules/x/outer/outer.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> | ||
<x-inner> | ||
<div slot="foo">yolo</div> | ||
</x-inner> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
...server/src/__tests__/fixtures/duplicate-slots-in-template/shadow/modules/x/outer/outer.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 {} |
Empty file.
27 changes: 27 additions & 0 deletions
27
...e-server/src/__tests__/fixtures/reordered-duplicate-nonexistent-slots/light/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-outer> | ||
<x-inner> | ||
a | ||
<!----> | ||
<div> | ||
x | ||
</div> | ||
<!----> | ||
b | ||
<!----> | ||
<div> | ||
y | ||
</div> | ||
<div> | ||
y2 | ||
</div> | ||
<div> | ||
y3 | ||
</div> | ||
<!----> | ||
c | ||
<!----> | ||
default1default2default3default4default5default6 | ||
<!----> | ||
d | ||
</x-inner> | ||
</x-outer> |
3 changes: 3 additions & 0 deletions
3
...engine-server/src/__tests__/fixtures/reordered-duplicate-nonexistent-slots/light/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-outer'; | ||
export { default } from 'x/outer'; | ||
export * from 'x/outer'; |
9 changes: 9 additions & 0 deletions
9
...__tests__/fixtures/reordered-duplicate-nonexistent-slots/light/modules/x/inner/inner.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 lwc:render-mode="light"> | ||
a | ||
<slot name="x"></slot> | ||
b | ||
<slot name="y"></slot> | ||
c | ||
<slot></slot> | ||
d | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...c/__tests__/fixtures/reordered-duplicate-nonexistent-slots/light/modules/x/inner/inner.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' | ||
} |
15 changes: 15 additions & 0 deletions
15
...__tests__/fixtures/reordered-duplicate-nonexistent-slots/light/modules/x/outer/outer.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 @@ | ||
<template lwc:render-mode="light"> | ||
<x-inner> | ||
default1 | ||
<div slot="y">y</div> | ||
default2 | ||
<div slot="x">x</div> | ||
default3 | ||
<div slot="y">y2</div> | ||
default4 | ||
<div slot="y">y3</div> | ||
default5 | ||
<div slot="does-not-exist">does-not-exist</div> | ||
default6 | ||
</x-inner> | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...c/__tests__/fixtures/reordered-duplicate-nonexistent-slots/light/modules/x/outer/outer.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' | ||
} |
Empty file.
39 changes: 39 additions & 0 deletions
39
...-server/src/__tests__/fixtures/reordered-duplicate-nonexistent-slots/shadow/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,39 @@ | ||
<x-outer> | ||
<template shadowrootmode="open"> | ||
<x-inner> | ||
<template shadowrootmode="open"> | ||
a | ||
<slot name="x"> | ||
</slot> | ||
b | ||
<slot name="y"> | ||
</slot> | ||
c | ||
<slot> | ||
</slot> | ||
d | ||
</template> | ||
default1 | ||
<div slot="y"> | ||
y | ||
</div> | ||
default2 | ||
<div slot="x"> | ||
x | ||
</div> | ||
default3 | ||
<div slot="y"> | ||
y2 | ||
</div> | ||
default4 | ||
<div slot="y"> | ||
y3 | ||
</div> | ||
default5 | ||
<div slot="does-not-exist"> | ||
does-not-exist | ||
</div> | ||
default6 | ||
</x-inner> | ||
</template> | ||
</x-outer> |
3 changes: 3 additions & 0 deletions
3
...ngine-server/src/__tests__/fixtures/reordered-duplicate-nonexistent-slots/shadow/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-outer'; | ||
export { default } from 'x/outer'; | ||
export * from 'x/outer'; |
9 changes: 9 additions & 0 deletions
9
..._tests__/fixtures/reordered-duplicate-nonexistent-slots/shadow/modules/x/inner/inner.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> | ||
a | ||
<slot name="x"></slot> | ||
b | ||
<slot name="y"></slot> | ||
c | ||
<slot></slot> | ||
d | ||
</template> |
3 changes: 3 additions & 0 deletions
3
.../__tests__/fixtures/reordered-duplicate-nonexistent-slots/shadow/modules/x/inner/inner.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 {} |
15 changes: 15 additions & 0 deletions
15
..._tests__/fixtures/reordered-duplicate-nonexistent-slots/shadow/modules/x/outer/outer.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 @@ | ||
<template> | ||
<x-inner> | ||
default1 | ||
<div slot="y">y</div> | ||
default2 | ||
<div slot="x">x</div> | ||
default3 | ||
<div slot="y">y2</div> | ||
default4 | ||
<div slot="y">y3</div> | ||
default5 | ||
<div slot="does-not-exist">does-not-exist</div> | ||
default6 | ||
</x-inner> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
.../__tests__/fixtures/reordered-duplicate-nonexistent-slots/shadow/modules/x/outer/outer.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 {} |