From ae8c6b75b204c600bed49f26de606b61a14172dd Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 13 Jan 2025 11:29:38 -0800 Subject: [PATCH] test(ssr): more tests for mixed light/scoped slots --- .../error.txt | 0 .../expected.html | 18 +++++++++++++ .../index.js | 3 +++ .../modules/x/child/child.html | 6 +++++ .../modules/x/child/child.js | 6 +++++ .../modules/x/parent/parent.html | 9 +++++++ .../modules/x/parent/parent.js | 5 ++++ .../error.txt | 0 .../expected.html | 6 +++++ .../index.js | 3 +++ .../modules/x/child/child.html | 2 ++ .../modules/x/child/child.js | 6 +++++ .../modules/x/parent/parent.html | 9 +++++++ .../modules/x/parent/parent.js | 5 ++++ .../error.txt | 0 .../expected.html | 27 +++++++++++++++++++ .../index.js | 3 +++ .../modules/x/child/child.html | 8 ++++++ .../modules/x/child/child.js | 6 +++++ .../modules/x/parent/parent.html | 13 +++++++++ .../modules/x/parent/parent.js | 5 ++++ 21 files changed, 140 insertions(+) create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/index.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/child/child.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/child/child.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/parent/parent.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/parent/parent.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/index.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/child/child.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/child/child.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/parent/parent.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/parent/parent.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/index.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/child/child.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/child/child.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/parent/parent.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/parent/parent.js diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/expected.html new file mode 100644 index 0000000000..bc5b3c817e --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/expected.html @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/index.js new file mode 100644 index 0000000000..d5a55ceefa --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/index.js @@ -0,0 +1,3 @@ +export const tagName = 'x-parent'; +export { default } from 'x/parent'; +export * from 'x/parent'; diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/child/child.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/child/child.html new file mode 100644 index 0000000000..e73ff13018 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/child/child.html @@ -0,0 +1,6 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/child/child.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/child/child.js new file mode 100644 index 0000000000..4cdde3624c --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/child/child.js @@ -0,0 +1,6 @@ +import { LightningElement } from 'lwc'; + +export default class Child extends LightningElement { + static renderMode = 'light'; + item = { id: 99, name: 'ssr' }; +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/parent/parent.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/parent/parent.html new file mode 100644 index 0000000000..2a471e81d4 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/parent/parent.html @@ -0,0 +1,9 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/parent/parent.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/parent/parent.js new file mode 100644 index 0000000000..04ba775321 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-2/modules/x/parent/parent.js @@ -0,0 +1,5 @@ +import { LightningElement } from 'lwc'; + +export default class Parent extends LightningElement { + foo = 'bar'; +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/expected.html new file mode 100644 index 0000000000..0ef40cedf9 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/expected.html @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/index.js new file mode 100644 index 0000000000..d5a55ceefa --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/index.js @@ -0,0 +1,3 @@ +export const tagName = 'x-parent'; +export { default } from 'x/parent'; +export * from 'x/parent'; diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/child/child.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/child/child.html new file mode 100644 index 0000000000..d6e0337dfa --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/child/child.html @@ -0,0 +1,2 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/child/child.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/child/child.js new file mode 100644 index 0000000000..4cdde3624c --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/child/child.js @@ -0,0 +1,6 @@ +import { LightningElement } from 'lwc'; + +export default class Child extends LightningElement { + static renderMode = 'light'; + item = { id: 99, name: 'ssr' }; +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/parent/parent.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/parent/parent.html new file mode 100644 index 0000000000..2a471e81d4 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/parent/parent.html @@ -0,0 +1,9 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/parent/parent.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/parent/parent.js new file mode 100644 index 0000000000..04ba775321 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-inside-3/modules/x/parent/parent.js @@ -0,0 +1,5 @@ +import { LightningElement } from 'lwc'; + +export default class Parent extends LightningElement { + foo = 'bar'; +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/expected.html new file mode 100644 index 0000000000..27b1cb5b2f --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/expected.html @@ -0,0 +1,27 @@ + + + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/index.js new file mode 100644 index 0000000000..d5a55ceefa --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/index.js @@ -0,0 +1,3 @@ +export const tagName = 'x-parent'; +export { default } from 'x/parent'; +export * from 'x/parent'; diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/child/child.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/child/child.html new file mode 100644 index 0000000000..e9940b3442 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/child/child.html @@ -0,0 +1,8 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/child/child.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/child/child.js new file mode 100644 index 0000000000..4cdde3624c --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/child/child.js @@ -0,0 +1,6 @@ +import { LightningElement } from 'lwc'; + +export default class Child extends LightningElement { + static renderMode = 'light'; + item = { id: 99, name: 'ssr' }; +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/parent/parent.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/parent/parent.html new file mode 100644 index 0000000000..db127137f4 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/parent/parent.html @@ -0,0 +1,13 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/parent/parent.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/parent/parent.js new file mode 100644 index 0000000000..04ba775321 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/mixed-with-light-dom-slots-outside-2/modules/x/parent/parent.js @@ -0,0 +1,5 @@ +import { LightningElement } from 'lwc'; + +export default class Parent extends LightningElement { + foo = 'bar'; +}