Skip to content

Commit

Permalink
test(ssr): more tests for non-top-level slots
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed Nov 7, 2024
1 parent e9db491 commit 3522996
Show file tree
Hide file tree
Showing 36 changed files with 722 additions and 0 deletions.
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>
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';
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>
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'
}
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>
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'
}
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>
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
}
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>
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';
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>
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'
}
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>
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'
}
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>
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
}
Loading

0 comments on commit 3522996

Please sign in to comment.