-
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(ssr): more tests for non-top-level slots
- Loading branch information
1 parent
e9db491
commit 3522996
Showing
36 changed files
with
722 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
72 changes: 72 additions & 0 deletions
72
...e-server/src/__tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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,72 @@ | ||
<x-outer> | ||
<x-inner> | ||
! | ||
<!----> | ||
acegijmopqstu | ||
<x-another> | ||
% | ||
<!----> | ||
vy | ||
<!----> | ||
^ | ||
<!----> | ||
<div> | ||
w | ||
</div> | ||
<div> | ||
x | ||
</div> | ||
<!----> | ||
* | ||
<!----> | ||
fallback for bar | ||
<!----> | ||
~ | ||
</x-another> | ||
z | ||
<external-another> | ||
1 | ||
<div slot="foo"> | ||
2 | ||
</div> | ||
34 | ||
<div slot="foo"> | ||
5 | ||
</div> | ||
67 | ||
</external-another> | ||
8 | ||
<!----> | ||
@ | ||
<!----> | ||
<div> | ||
b | ||
</div> | ||
<div> | ||
f | ||
</div> | ||
<div> | ||
k | ||
</div> | ||
<div> | ||
n | ||
</div> | ||
<div> | ||
r | ||
</div> | ||
<!----> | ||
# | ||
<!----> | ||
<div> | ||
d | ||
</div> | ||
<div> | ||
h | ||
</div> | ||
<div> | ||
l | ||
</div> | ||
<!----> | ||
$ | ||
</x-inner> | ||
</x-outer> |
3 changes: 3 additions & 0 deletions
3
...engine-server/src/__tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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
...sts__/fixtures/slot-not-at-top-level/advanced/ifTrue/light/modules/x/another/another.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"> | ||
% | ||
<slot>fallback for default</slot> | ||
^ | ||
<slot name=foo>fallback for foo</slot> | ||
* | ||
<slot name=bar>fallback for bar</slot> | ||
~ | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/light/modules/x/another/another.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' | ||
} |
9 changes: 9 additions & 0 deletions
9
...__tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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"> | ||
! | ||
<slot>fallback for default</slot> | ||
@ | ||
<slot name=foo>fallback for foo</slot> | ||
# | ||
<slot name=bar>fallback for bar</slot> | ||
$ | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...c/__tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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' | ||
} |
59 changes: 59 additions & 0 deletions
59
...__tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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,59 @@ | ||
<template lwc:render-mode="light"> | ||
<x-inner> | ||
a | ||
<template if:true={isTrue}> | ||
<div slot="foo">b</div> | ||
</template> | ||
c | ||
<div slot="bar">d</div> | ||
e | ||
<template if:true={isTrue}> | ||
<div slot="foo">f</div> | ||
</template> | ||
g | ||
<div slot="bar">h</div> | ||
i | ||
<template if:true={isTrue}> | ||
j | ||
<div slot="foo">k</div> | ||
<div slot="bar">l</div> | ||
m | ||
<div slot="foo">n</div> | ||
</template> | ||
o | ||
<template if:true={isTrue}> | ||
p | ||
<template if:true={isTrue}> | ||
q | ||
<div slot="foo">r</div> | ||
s | ||
</template> | ||
t | ||
</template> | ||
u | ||
<x-another> | ||
v | ||
<div slot="foo">w</div> | ||
<template if:true={isTrue}> | ||
<div slot="foo">x</div> | ||
</template> | ||
y | ||
</x-another> | ||
z | ||
<external-another lwc:external> | ||
1 | ||
<div slot="foo">2</div> | ||
3 | ||
<template if:true={isTrue}> | ||
4 | ||
<div slot="foo">5</div> | ||
6 | ||
</template> | ||
7 | ||
</external-another> | ||
8 | ||
<template if:true={isFalse}> | ||
<div slot="foo">9</div> | ||
</template> | ||
</x-inner> | ||
</template> |
7 changes: 7 additions & 0 deletions
7
...c/__tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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,7 @@ | ||
import { LightningElement} from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
static renderMode = 'light' | ||
isTrue = true | ||
isFalse = false | ||
} |
Empty file.
91 changes: 91 additions & 0 deletions
91
...-server/src/__tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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,91 @@ | ||
<x-outer> | ||
<template shadowrootmode="open"> | ||
<x-inner> | ||
<template shadowrootmode="open"> | ||
! | ||
<slot> | ||
fallback for default | ||
</slot> | ||
@ | ||
<slot name="foo"> | ||
fallback for foo | ||
</slot> | ||
# | ||
<slot name="bar"> | ||
fallback for bar | ||
</slot> | ||
$ | ||
</template> | ||
a | ||
<div slot="foo"> | ||
b | ||
</div> | ||
c | ||
<div slot="bar"> | ||
d | ||
</div> | ||
e | ||
<div slot="foo"> | ||
f | ||
</div> | ||
g | ||
<div slot="bar"> | ||
h | ||
</div> | ||
ij | ||
<div slot="foo"> | ||
k | ||
</div> | ||
<div slot="bar"> | ||
l | ||
</div> | ||
m | ||
<div slot="foo"> | ||
n | ||
</div> | ||
opq | ||
<div slot="foo"> | ||
r | ||
</div> | ||
stu | ||
<x-another> | ||
<template shadowrootmode="open"> | ||
% | ||
<slot> | ||
fallback for default | ||
</slot> | ||
^ | ||
<slot name="foo"> | ||
fallback for foo | ||
</slot> | ||
* | ||
<slot name="bar"> | ||
fallback for bar | ||
</slot> | ||
~ | ||
</template> | ||
v | ||
<div slot="foo"> | ||
w | ||
</div> | ||
<div slot="foo"> | ||
x | ||
</div> | ||
y | ||
</x-another> | ||
z | ||
<external-another> | ||
1 | ||
<div slot="foo"> | ||
2 | ||
</div> | ||
34 | ||
<div slot="foo"> | ||
5 | ||
</div> | ||
67 | ||
</external-another> | ||
8 | ||
</x-inner> | ||
</template> | ||
</x-outer> |
3 changes: 3 additions & 0 deletions
3
...ngine-server/src/__tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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
...ts__/fixtures/slot-not-at-top-level/advanced/ifTrue/shadow/modules/x/another/another.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="shadow"> | ||
% | ||
<slot>fallback for default</slot> | ||
^ | ||
<slot name=foo>fallback for foo</slot> | ||
* | ||
<slot name=bar>fallback for bar</slot> | ||
~ | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ests__/fixtures/slot-not-at-top-level/advanced/ifTrue/shadow/modules/x/another/another.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 = 'shadow' | ||
} |
9 changes: 9 additions & 0 deletions
9
..._tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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 lwc:render-mode="shadow"> | ||
! | ||
<slot>fallback for default</slot> | ||
@ | ||
<slot name=foo>fallback for foo</slot> | ||
# | ||
<slot name=bar>fallback for bar</slot> | ||
$ | ||
</template> |
5 changes: 5 additions & 0 deletions
5
.../__tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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,5 @@ | ||
import { LightningElement} from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
static renderMode = 'shadow' | ||
} |
59 changes: 59 additions & 0 deletions
59
..._tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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,59 @@ | ||
<template lwc:render-mode="shadow"> | ||
<x-inner> | ||
a | ||
<template if:true={isTrue}> | ||
<div slot="foo">b</div> | ||
</template> | ||
c | ||
<div slot="bar">d</div> | ||
e | ||
<template if:true={isTrue}> | ||
<div slot="foo">f</div> | ||
</template> | ||
g | ||
<div slot="bar">h</div> | ||
i | ||
<template if:true={isTrue}> | ||
j | ||
<div slot="foo">k</div> | ||
<div slot="bar">l</div> | ||
m | ||
<div slot="foo">n</div> | ||
</template> | ||
o | ||
<template if:true={isTrue}> | ||
p | ||
<template if:true={isTrue}> | ||
q | ||
<div slot="foo">r</div> | ||
s | ||
</template> | ||
t | ||
</template> | ||
u | ||
<x-another> | ||
v | ||
<div slot="foo">w</div> | ||
<template if:true={isTrue}> | ||
<div slot="foo">x</div> | ||
</template> | ||
y | ||
</x-another> | ||
z | ||
<external-another lwc:external> | ||
1 | ||
<div slot="foo">2</div> | ||
3 | ||
<template if:true={isTrue}> | ||
4 | ||
<div slot="foo">5</div> | ||
6 | ||
</template> | ||
7 | ||
</external-another> | ||
8 | ||
<template if:true={isFalse}> | ||
<div slot="foo">9</div> | ||
</template> | ||
</x-inner> | ||
</template> |
7 changes: 7 additions & 0 deletions
7
.../__tests__/fixtures/slot-not-at-top-level/advanced/ifTrue/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,7 @@ | ||
import { LightningElement} from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
static renderMode = 'shadow' | ||
isTrue = true | ||
isFalse = false | ||
} |
Empty file.
Oops, something went wrong.