From 3d2814086d85595d7f8af4a50729e2f415f9ed84 Mon Sep 17 00:00:00 2001 From: jhefferman-sfdc <83669775+jhefferman-sfdc@users.noreply.github.com> Date: Tue, 10 Dec 2024 08:05:28 -0700 Subject: [PATCH] chore: test usage of default slot with scoped data (#5024) * chore: test usage of default slot with scoped data * chore: add comment to explain why content not rendered --- .../fixtures/scoped-slots/default-slot/error.txt | 0 .../scoped-slots/default-slot/expected.html | 15 +++++++++++++++ .../fixtures/scoped-slots/default-slot/index.js | 3 +++ .../default-slot/modules/x/child/child.html | 5 +++++ .../default-slot/modules/x/child/child.js | 6 ++++++ .../default-slot/modules/x/parent/parent.html | 9 +++++++++ .../default-slot/modules/x/parent/parent.js | 5 +++++ .../src/__tests__/utils/expected-failures.ts | 1 + 8 files changed, 44 insertions(+) create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/index.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/child/child.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/child/child.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/parent/parent.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/parent/parent.js diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/expected.html new file mode 100644 index 0000000000..4377beae87 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/expected.html @@ -0,0 +1,15 @@ + + + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/index.js new file mode 100644 index 0000000000..d5a55ceefa --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/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/default-slot/modules/x/child/child.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/child/child.html new file mode 100644 index 0000000000..7b889f73bb --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/child/child.html @@ -0,0 +1,5 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/child/child.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/child/child.js new file mode 100644 index 0000000000..4cdde3624c --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/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/default-slot/modules/x/parent/parent.html b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/parent/parent.html new file mode 100644 index 0000000000..c74cb2caf0 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/parent/parent.html @@ -0,0 +1,9 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/parent/parent.js b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/modules/x/parent/parent.js new file mode 100644 index 0000000000..04ba775321 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/scoped-slots/default-slot/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/ssr-compiler/src/__tests__/utils/expected-failures.ts b/packages/@lwc/ssr-compiler/src/__tests__/utils/expected-failures.ts index ac9356a663..bcafe9dc93 100644 --- a/packages/@lwc/ssr-compiler/src/__tests__/utils/expected-failures.ts +++ b/packages/@lwc/ssr-compiler/src/__tests__/utils/expected-failures.ts @@ -21,6 +21,7 @@ export const expectedFailures = new Set([ 'known-boolean-attributes/default-def-html-attributes/static-on-component/index.js', 'render-dynamic-value/index.js', 'scoped-slots/advanced/index.js', + 'scoped-slots/default-slot/index.js', 'scoped-slots/expression/index.js', 'scoped-slots/mixed-with-light-dom-slots-inside/index.js', 'scoped-slots/mixed-with-light-dom-slots-outside/index.js',