Skip to content

Commit

Permalink
test(ssr): add test for scoped slots with lwc:is (#4920)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Nov 25, 2024
1 parent 3aaf2f2 commit 468d1c7
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ssrFiles": {
"error": "error-ssr.txt",
"expected": "expected-ssr.html"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Template compilation failure; see warnings in the console.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LWC1178: <template> tag with lwc:slot-data directive must be the direct child of a custom element.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const tagName = 'x-dynamic-component';
export { default } from 'x/dynamic';
export * from 'x/dynamic';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<lwc:component lwc:is={customCtor}>
<template lwc:slot-data="data">
<span>{data.id} - {data.name}</span>
</template>
</lwc:component>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { LightningElement, track } from 'lwc';
import Test from 'x/test';

export default class DynamicCtor extends LightningElement {
@track customCtor = Test;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template lwc:render-mode="light">
a
<slot lwc:slot-bind={item}>Default slot content</slot>
b
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement } from 'lwc';

export default class Test extends LightningElement {
static renderMode = 'light'
}

0 comments on commit 468d1c7

Please sign in to comment.