From ed5327fde8f3f638346c4ee23f69b2b4aeba9312 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 21 Oct 2024 08:42:56 -0700 Subject: [PATCH] test: add render mode mismatch test (#4664) --- .../default-template-light-component/error.txt | 0 .../default-template-light-component/expected.html | 2 ++ .../default-template-light-component/index.js | 3 +++ .../modules/x/test/test.html | 2 ++ .../default-template-light-component/modules/x/test/test.js | 5 +++++ .../default-template-shadow-component/error.txt | 0 .../default-template-shadow-component/expected.html | 4 ++++ .../default-template-shadow-component/index.js | 3 +++ .../modules/x/test/test.html | 2 ++ .../default-template-shadow-component/modules/x/test/test.js | 5 +++++ .../light-template-default-component/error.txt | 0 .../light-template-default-component/expected.html | 4 ++++ .../light-template-default-component/index.js | 3 +++ .../modules/x/test/test.html | 2 ++ .../light-template-default-component/modules/x/test/test.js | 4 ++++ .../light-template-shadow-component/error.txt | 0 .../light-template-shadow-component/expected.html | 4 ++++ .../light-template-shadow-component/index.js | 3 +++ .../light-template-shadow-component/modules/x/test/test.html | 2 ++ .../light-template-shadow-component/modules/x/test/test.js | 5 +++++ .../shadow-template-default-component/error.txt | 0 .../shadow-template-default-component/expected.html | 4 ++++ .../shadow-template-default-component/index.js | 3 +++ .../modules/x/test/test.html | 2 ++ .../shadow-template-default-component/modules/x/test/test.js | 4 ++++ .../shadow-template-light-component/error.txt | 0 .../shadow-template-light-component/expected.html | 2 ++ .../shadow-template-light-component/index.js | 3 +++ .../shadow-template-light-component/modules/x/test/test.html | 2 ++ .../shadow-template-light-component/modules/x/test/test.js | 5 +++++ 30 files changed, 78 insertions(+) create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/index.js create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/modules/x/test/test.html create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/modules/x/test/test.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/index.js create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/modules/x/test/test.html create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/modules/x/test/test.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/index.js create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/modules/x/test/test.html create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/modules/x/test/test.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/index.js create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/modules/x/test/test.html create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/modules/x/test/test.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/index.js create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/modules/x/test/test.html create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/modules/x/test/test.js create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/error.txt create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/expected.html create mode 100644 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/index.js create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/modules/x/test/test.html create mode 100755 packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/modules/x/test/test.js diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/expected.html new file mode 100644 index 0000000000..10501286b5 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/expected.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/index.js new file mode 100644 index 0000000000..bf9eb21437 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/index.js @@ -0,0 +1,3 @@ +export const tagName = 'x-test'; +export { default } from 'x/test'; +export * from 'x/test'; diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/modules/x/test/test.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/modules/x/test/test.html new file mode 100755 index 0000000000..6beff5199f --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/modules/x/test/test.html @@ -0,0 +1,2 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/modules/x/test/test.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/modules/x/test/test.js new file mode 100755 index 0000000000..52bf5639a0 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-light-component/modules/x/test/test.js @@ -0,0 +1,5 @@ +import { LightningElement, track } from 'lwc'; + +export default class extends LightningElement { + static renderMode = 'light' +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/expected.html new file mode 100644 index 0000000000..5cdcad4479 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/expected.html @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/index.js new file mode 100644 index 0000000000..bf9eb21437 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/index.js @@ -0,0 +1,3 @@ +export const tagName = 'x-test'; +export { default } from 'x/test'; +export * from 'x/test'; diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/modules/x/test/test.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/modules/x/test/test.html new file mode 100755 index 0000000000..6beff5199f --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/modules/x/test/test.html @@ -0,0 +1,2 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/modules/x/test/test.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/modules/x/test/test.js new file mode 100755 index 0000000000..b9a42d0dba --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/default-template-shadow-component/modules/x/test/test.js @@ -0,0 +1,5 @@ +import { LightningElement, track } from 'lwc'; + +export default class extends LightningElement { + static renderMode = 'shadow' +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/expected.html new file mode 100644 index 0000000000..5cdcad4479 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/expected.html @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/index.js new file mode 100644 index 0000000000..bf9eb21437 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/index.js @@ -0,0 +1,3 @@ +export const tagName = 'x-test'; +export { default } from 'x/test'; +export * from 'x/test'; diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/modules/x/test/test.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/modules/x/test/test.html new file mode 100755 index 0000000000..d6e0337dfa --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/modules/x/test/test.html @@ -0,0 +1,2 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/modules/x/test/test.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/modules/x/test/test.js new file mode 100755 index 0000000000..e39b70a03a --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-default-component/modules/x/test/test.js @@ -0,0 +1,4 @@ +import { LightningElement, track } from 'lwc'; + +export default class extends LightningElement { +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/expected.html new file mode 100644 index 0000000000..5cdcad4479 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/expected.html @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/index.js new file mode 100644 index 0000000000..bf9eb21437 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/index.js @@ -0,0 +1,3 @@ +export const tagName = 'x-test'; +export { default } from 'x/test'; +export * from 'x/test'; diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/modules/x/test/test.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/modules/x/test/test.html new file mode 100755 index 0000000000..d6e0337dfa --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/modules/x/test/test.html @@ -0,0 +1,2 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/modules/x/test/test.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/modules/x/test/test.js new file mode 100755 index 0000000000..b9a42d0dba --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/light-template-shadow-component/modules/x/test/test.js @@ -0,0 +1,5 @@ +import { LightningElement, track } from 'lwc'; + +export default class extends LightningElement { + static renderMode = 'shadow' +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/expected.html new file mode 100644 index 0000000000..5cdcad4479 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/expected.html @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/index.js new file mode 100644 index 0000000000..bf9eb21437 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/index.js @@ -0,0 +1,3 @@ +export const tagName = 'x-test'; +export { default } from 'x/test'; +export * from 'x/test'; diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/modules/x/test/test.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/modules/x/test/test.html new file mode 100755 index 0000000000..3a6d054285 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/modules/x/test/test.html @@ -0,0 +1,2 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/modules/x/test/test.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/modules/x/test/test.js new file mode 100755 index 0000000000..e39b70a03a --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-default-component/modules/x/test/test.js @@ -0,0 +1,4 @@ +import { LightningElement, track } from 'lwc'; + +export default class extends LightningElement { +} diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/error.txt b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/error.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/expected.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/expected.html new file mode 100644 index 0000000000..10501286b5 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/expected.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/index.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/index.js new file mode 100644 index 0000000000..bf9eb21437 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/index.js @@ -0,0 +1,3 @@ +export const tagName = 'x-test'; +export { default } from 'x/test'; +export * from 'x/test'; diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/modules/x/test/test.html b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/modules/x/test/test.html new file mode 100755 index 0000000000..3a6d054285 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/modules/x/test/test.html @@ -0,0 +1,2 @@ + diff --git a/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/modules/x/test/test.js b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/modules/x/test/test.js new file mode 100755 index 0000000000..52bf5639a0 --- /dev/null +++ b/packages/@lwc/engine-server/src/__tests__/fixtures/render-mode-mismatch/shadow-template-light-component/modules/x/test/test.js @@ -0,0 +1,5 @@ +import { LightningElement, track } from 'lwc'; + +export default class extends LightningElement { + static renderMode = 'light' +}