From 5391bc32ad093110be9bb91545b086b70994c5e6 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 21 Oct 2024 08:46:43 -0700 Subject: [PATCH] test(engine-server): test scoped slot forwarding (#4669) --- .../slot-forwarding/scoped-slots/error.txt | 0 .../slot-forwarding/scoped-slots/expected.html | 17 +++++++++++++++++ .../slot-forwarding/scoped-slots/index.js | 4 ++++ .../scoped-slots/modules/x/leaf/leaf.html | 4 ++++ .../scoped-slots/modules/x/leaf/leaf.js | 3 +++ .../x/lightContainer/lightContainer.html | 3 +++ .../modules/x/lightContainer/lightContainer.js | 5 +++++ .../x/scopedSlotChild/scopedSlotChild.html | 6 ++++++ .../x/scopedSlotChild/scopedSlotChild.js | 7 +++++++ .../x/scopedSlotParent/scopedSlotParent.html | 7 +++++++ .../x/scopedSlotParent/scopedSlotParent.js | 5 +++++ 11 files changed, 61 insertions(+) create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/index.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/leaf/leaf.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/leaf/leaf.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/lightContainer/lightContainer.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/lightContainer/lightContainer.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotChild/scopedSlotChild.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotChild/scopedSlotChild.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotParent/scopedSlotParent.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotParent/scopedSlotParent.js diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/expected.html new file mode 100644 index 0000000000..1ce037982f --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/expected.html @@ -0,0 +1,17 @@ + + + + + +

+ Hello world! +

+
+
+
+
\ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/index.js new file mode 100644 index 0000000000..ee7369077e --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/index.js @@ -0,0 +1,4 @@ +export const tagName = 'x-light-container'; +export { default } from 'x/lightContainer'; +export * from 'x/lightContainer'; +export const features = []; diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/leaf/leaf.html b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/leaf/leaf.html new file mode 100644 index 0000000000..68f2c67ef3 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/leaf/leaf.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/leaf/leaf.js b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/leaf/leaf.js new file mode 100644 index 0000000000..ca8dce94e0 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/leaf/leaf.js @@ -0,0 +1,3 @@ +import { LightningElement } from 'lwc'; + +export default class extends LightningElement {} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/lightContainer/lightContainer.html b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/lightContainer/lightContainer.html new file mode 100644 index 0000000000..4511f208bb --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/lightContainer/lightContainer.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/lightContainer/lightContainer.js b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/lightContainer/lightContainer.js new file mode 100644 index 0000000000..0679d2bc10 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/lightContainer/lightContainer.js @@ -0,0 +1,5 @@ +import { LightningElement } from 'lwc'; + +export default class extends LightningElement { + static renderMode = 'light'; +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotChild/scopedSlotChild.html b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotChild/scopedSlotChild.html new file mode 100644 index 0000000000..4a385ec61a --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotChild/scopedSlotChild.html @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotChild/scopedSlotChild.js b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotChild/scopedSlotChild.js new file mode 100644 index 0000000000..ba52afd521 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotChild/scopedSlotChild.js @@ -0,0 +1,7 @@ +import { LightningElement } from 'lwc'; + +export default class extends LightningElement { + static renderMode = 'light'; + + title = 'Hello world!'; +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotParent/scopedSlotParent.html b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotParent/scopedSlotParent.html new file mode 100644 index 0000000000..ab8f526ad6 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotParent/scopedSlotParent.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotParent/scopedSlotParent.js b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotParent/scopedSlotParent.js new file mode 100644 index 0000000000..0679d2bc10 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/scoped-slots/modules/x/scopedSlotParent/scopedSlotParent.js @@ -0,0 +1,5 @@ +import { LightningElement } from 'lwc'; + +export default class extends LightningElement { + static renderMode = 'light'; +}