-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ssr): add more tests for dynamic components (#4872)
Co-authored-by: James Tu <[email protected]>
- Loading branch information
1 parent
d2be62a
commit d30539f
Showing
44 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...c/engine-server/src/__tests__/fixtures/dynamic-components/invalid-ctor-function/error.txt
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 @@ | ||
Invalid constructor: "function fake() {}" is not a LightningElement constructor. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...c-components/invalid-ctor-function/modules/x/dynamic-invalid-ctor/dynamic-invalid-ctor.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 { | ||
customCtor = function fake () {}; | ||
} |
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
packages/@lwc/engine-server/src/__tests__/fixtures/dynamic-components/invalid-ctor/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-dynamic-component-invalid-ctor'; | ||
export { default } from 'x/dynamic-invalid-ctor'; | ||
export * from 'x/dynamic-invalid-ctor'; |
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...ests__/fixtures/dynamic-components/no-ctor/modules/x/dynamic-no-ctor/dynamic-no-ctor.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:component lwc:is={customCtor}></lwc:component> | ||
</template> |
File renamed without changes.
Empty file.
11 changes: 11 additions & 0 deletions
11
...ngine-server/src/__tests__/fixtures/dynamic-components/slots/light-fallback/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,11 @@ | ||
<x-dynamic-component> | ||
<template shadowrootmode="open"> | ||
<x-test> | ||
a | ||
<!----> | ||
fallback | ||
<!----> | ||
b | ||
</x-test> | ||
</template> | ||
</x-dynamic-component> |
3 changes: 3 additions & 0 deletions
3
...lwc/engine-server/src/__tests__/fixtures/dynamic-components/slots/light-fallback/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-dynamic-component'; | ||
export { default } from 'x/dynamic'; | ||
export * from 'x/dynamic'; |
3 changes: 3 additions & 0 deletions
3
...__tests__/fixtures/dynamic-components/slots/light-fallback/modules/x/dynamic/dynamic.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:component lwc:is={customCtor}></lwc:component> | ||
</template> |
6 changes: 6 additions & 0 deletions
6
...c/__tests__/fixtures/dynamic-components/slots/light-fallback/modules/x/dynamic/dynamic.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,6 @@ | ||
import { LightningElement, track } from 'lwc'; | ||
import Test from 'x/test'; | ||
|
||
export default class DynamicCtor extends LightningElement { | ||
@track customCtor = Test; | ||
} |
5 changes: 5 additions & 0 deletions
5
...r/src/__tests__/fixtures/dynamic-components/slots/light-fallback/modules/x/test/test.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"> | ||
a | ||
<slot>fallback</slot> | ||
b | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ver/src/__tests__/fixtures/dynamic-components/slots/light-fallback/modules/x/test/test.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 Test extends LightningElement { | ||
static renderMode = 'light' | ||
} |
Empty file.
13 changes: 13 additions & 0 deletions
13
...es/@lwc/engine-server/src/__tests__/fixtures/dynamic-components/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,13 @@ | ||
<x-dynamic-component> | ||
<template shadowrootmode="open"> | ||
<x-test> | ||
a | ||
<!----> | ||
<div> | ||
Slot me in! | ||
</div> | ||
<!----> | ||
b | ||
</x-test> | ||
</template> | ||
</x-dynamic-component> |
3 changes: 3 additions & 0 deletions
3
packages/@lwc/engine-server/src/__tests__/fixtures/dynamic-components/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-dynamic-component'; | ||
export { default } from 'x/dynamic'; | ||
export * from 'x/dynamic'; |
5 changes: 5 additions & 0 deletions
5
...rver/src/__tests__/fixtures/dynamic-components/slots/light/modules/x/dynamic/dynamic.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:component lwc:is={customCtor}> | ||
<div>Slot me in!</div> | ||
</lwc:component> | ||
</template> |
6 changes: 6 additions & 0 deletions
6
...server/src/__tests__/fixtures/dynamic-components/slots/light/modules/x/dynamic/dynamic.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,6 @@ | ||
import { LightningElement, track } from 'lwc'; | ||
import Test from 'x/test'; | ||
|
||
export default class DynamicCtor extends LightningElement { | ||
@track customCtor = Test; | ||
} |
5 changes: 5 additions & 0 deletions
5
...ine-server/src/__tests__/fixtures/dynamic-components/slots/light/modules/x/test/test.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"> | ||
a | ||
<slot>fallback</slot> | ||
b | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...ngine-server/src/__tests__/fixtures/dynamic-components/slots/light/modules/x/test/test.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 Test extends LightningElement { | ||
static renderMode = 'light' | ||
} |
Empty file.
16 changes: 16 additions & 0 deletions
16
...s/@lwc/engine-server/src/__tests__/fixtures/dynamic-components/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,16 @@ | ||
<x-dynamic-component> | ||
<template shadowrootmode="open"> | ||
<x-test> | ||
<template shadowrootmode="open"> | ||
a | ||
<slot> | ||
fallback | ||
</slot> | ||
b | ||
</template> | ||
<div> | ||
Slot me in! | ||
</div> | ||
</x-test> | ||
</template> | ||
</x-dynamic-component> |
3 changes: 3 additions & 0 deletions
3
packages/@lwc/engine-server/src/__tests__/fixtures/dynamic-components/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-dynamic-component'; | ||
export { default } from 'x/dynamic'; | ||
export * from 'x/dynamic'; |
5 changes: 5 additions & 0 deletions
5
...ver/src/__tests__/fixtures/dynamic-components/slots/shadow/modules/x/dynamic/dynamic.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:component lwc:is={customCtor}> | ||
<div>Slot me in!</div> | ||
</lwc:component> | ||
</template> |
6 changes: 6 additions & 0 deletions
6
...erver/src/__tests__/fixtures/dynamic-components/slots/shadow/modules/x/dynamic/dynamic.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,6 @@ | ||
import { LightningElement, track } from 'lwc'; | ||
import Test from 'x/test'; | ||
|
||
export default class DynamicCtor extends LightningElement { | ||
@track customCtor = Test; | ||
} |
5 changes: 5 additions & 0 deletions
5
...ne-server/src/__tests__/fixtures/dynamic-components/slots/shadow/modules/x/test/test.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> | ||
a | ||
<slot>fallback</slot> | ||
b | ||
</template> |
5 changes: 5 additions & 0 deletions
5
...gine-server/src/__tests__/fixtures/dynamic-components/slots/shadow/modules/x/test/test.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 Test extends LightningElement { | ||
|
||
} |
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