Skip to content

Commit 7a761c4

Browse files
fix: v2 hydration test failures (#5227)
* fix: fixed class mutation, added test coverage, removed failure supression * fix: unnecessary fixture pathing
1 parent 34c7522 commit 7a761c4

File tree

65 files changed

+287
-152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+287
-152
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"entry": "x/parent"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<fixture-test>
2+
<template shadowrootmode="open">
3+
<x-child class="connected-callback-class connected-callback-class-2 initial" data-lwc-host-mutated="class">
4+
<template shadowrootmode="open">
5+
</template>
6+
</x-child>
7+
</template>
8+
</fixture-test>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { LightningElement } from 'lwc';
2+
3+
export default class extends LightningElement {
4+
connectedCallback() {
5+
// Modify a class that has already been set by the parent
6+
this.classList.add('connected-callback-class');
7+
this.classList.add('connected-callback-class-2');
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template>
2+
<x-child class="initial"></x-child>
3+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<template>
2+
</template>

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/expected.html

Lines changed: 0 additions & 88 deletions
This file was deleted.

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/inner-div/expected-ssr.html

Whitespace-only changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<fixture-test>
2+
<template shadowrootmode="open">
3+
<div data-expect-no-warning data-id="div-inner-static" inner-h-t-m-l="replaced">
4+
original
5+
</div>
6+
<div data-expect-no-warning data-id="div-inner-computed" inner-h-t-m-l="injected">
7+
original
8+
</div>
9+
<div data-id="div-inner-spread">
10+
original
11+
</div>
12+
<span>
13+
lwc:inner-html
14+
</span>
15+
<p>
16+
injected
17+
</p>
18+
</template>
19+
</fixture-test>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<template>
2+
<div data-id="div-inner-static" data-expect-no-warning inner-h-t-m-l="replaced">original</div>
3+
<div data-id="div-inner-computed" data-expect-no-warning inner-h-t-m-l={computed}>original</div>
4+
<div data-id="div-inner-spread" lwc:spread={spread}>original</div>
5+
6+
<span lwc:inner-html="lwc:inner-html"></span>
7+
<p lwc:inner-html={computed}></p>
8+
</template>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"entry": "x/inner",
3+
"ssrFiles": {
4+
"error": "error-ssr.txt",
5+
"expected": "expected-ssr.html"
6+
}
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cannot set attribute "inner-h-t-m-l" on <omg-whatever>.

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/inner-external/error.txt

Whitespace-only changes.

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/inner-external/expected-ssr.html

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<fixture-test>
2+
<template shadowrootmode="open">
3+
<omg-whatever data-id="external-inner-static" inner-h-t-m-l="replaced">
4+
original
5+
</omg-whatever>
6+
<omg-whatever data-id="external-inner-computed" inner-h-t-m-l="injected">
7+
original
8+
</omg-whatever>
9+
<omg-whatever data-id="external-inner-spread">
10+
original
11+
</omg-whatever>
12+
</template>
13+
</fixture-test>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<omg-whatever lwc:external data-id="external-inner-static" inner-h-t-m-l="replaced">original</omg-whatever>
3+
<omg-whatever lwc:external data-id="external-inner-computed" inner-h-t-m-l={computed}>original</omg-whatever>
4+
<omg-whatever lwc:external data-id="external-inner-spread" lwc:spread={spread}>original</omg-whatever>
5+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { LightningElement } from 'lwc';
2+
3+
export default class extends LightningElement {
4+
computed = 'injected';
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"entry": "x/inner",
3+
"ssrFiles": {
4+
"error": "error-ssr.txt",
5+
"expected": "expected-ssr.html"
6+
}
7+
}

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/inner-lwc/error-ssr.txt

Whitespace-only changes.

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/inner-lwc/error.txt

Whitespace-only changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<fixture-test>
2+
<template shadowrootmode="open">
3+
<x-component data-id="cmp-inner-static">
4+
<template shadowrootmode="open">
5+
<slot>
6+
</slot>
7+
</template>
8+
original
9+
</x-component>
10+
<x-component data-id="cmp-inner-computed">
11+
<template shadowrootmode="open">
12+
<slot>
13+
</slot>
14+
</template>
15+
original
16+
</x-component>
17+
<x-component data-id="cmp-inner-spread">
18+
<template shadowrootmode="open">
19+
<slot>
20+
</slot>
21+
</template>
22+
original
23+
</x-component>
24+
</template>
25+
</fixture-test>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<fixture-test>
2+
<template shadowrootmode="open">
3+
<x-component data-id="cmp-inner-static">
4+
<template shadowrootmode="open">
5+
<slot>
6+
</slot>
7+
</template>
8+
original
9+
</x-component>
10+
<x-component data-id="cmp-inner-computed">
11+
<template shadowrootmode="open">
12+
<slot>
13+
</slot>
14+
</template>
15+
original
16+
</x-component>
17+
<x-component data-id="cmp-inner-spread">
18+
<template shadowrootmode="open">
19+
<slot>
20+
</slot>
21+
</template>
22+
original
23+
</x-component>
24+
</template>
25+
</fixture-test>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { LightningElement } from 'lwc';
2+
3+
export default class extends LightningElement {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<x-component data-id="cmp-inner-static" inner-h-t-m-l="replaced">original</x-component>
3+
<x-component data-id="cmp-inner-computed" inner-h-t-m-l={computed}>original</x-component>
4+
<x-component data-id="cmp-inner-spread" lwc:spread={spread}>original</x-component>
5+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { LightningElement } from 'lwc';
2+
3+
export default class extends LightningElement {
4+
computed = 'injected';
5+
spread = { innerHTML: 'wheeeeeeeeeeeeeeeeeeeeeeeeeee' };
6+
}

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/modules/x/inner/inner.html

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"entry": "x/outer",
3+
"ssrFiles": {
4+
"error": "error-ssr.txt",
5+
"expected": "expected-ssr.html"
6+
}
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cannot set attribute "outer-h-t-m-l" on <div>.

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/outer-div/error.txt

Whitespace-only changes.

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/outer-div/expected-ssr.html

Whitespace-only changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<fixture-test>
2+
<template shadowrootmode="open">
3+
<div data-expect-no-warning data-id="div-outer-static" outer-h-t-m-l="replaced">
4+
original
5+
</div>
6+
<div data-expect-no-warning data-id="div-outer-computed" outer-h-t-m-l="injected">
7+
original
8+
</div>
9+
<div data-id="div-outer-spread">
10+
original
11+
</div>
12+
<span>
13+
lwc:inner-html
14+
</span>
15+
<p>
16+
injected
17+
</p>
18+
</template>
19+
</fixture-test>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<template>
2+
<div data-id="div-outer-static" data-expect-no-warning outer-h-t-m-l="replaced">original</div>
3+
<div data-id="div-outer-computed" data-expect-no-warning outer-h-t-m-l={computed}>original</div>
4+
<div data-id="div-outer-spread" lwc:spread={spread}>original</div>
5+
6+
<span lwc:inner-html="lwc:inner-html"></span>
7+
<p lwc:inner-html={computed}></p>
8+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { LightningElement } from 'lwc';
2+
3+
export default class extends LightningElement {
4+
computed = 'injected';
5+
spread = { innerHTML: 'wheeeeeeeeeeeeeeeeeeeeeeeeeee' };
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"entry": "x/outer",
3+
"ssrFiles": {
4+
"error": "error-ssr.txt",
5+
"expected": "expected-ssr.html"
6+
}
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cannot set attribute "outer-h-t-m-l" on <omg-whatever>.

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/outer-external/error.txt

Whitespace-only changes.

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/outer-external/expected-ssr.html

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<fixture-test>
2+
<template shadowrootmode="open">
3+
<omg-whatever data-id="external-outer-static">
4+
original
5+
</omg-whatever>
6+
<omg-whatever data-id="external-outer-computed">
7+
original
8+
</omg-whatever>
9+
<omg-whatever data-id="external-outer-spread">
10+
original
11+
</omg-whatever>
12+
</template>
13+
</fixture-test>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<omg-whatever lwc:external data-id="external-outer-static" outer-h-t-m-l="replaced">original</omg-whatever>
3+
<omg-whatever lwc:external data-id="external-outer-computed" outer-h-t-m-l={computed}>original</omg-whatever>
4+
<omg-whatever lwc:external data-id="external-outer-spread" lwc:spread={spread}>original</omg-whatever>
5+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { LightningElement } from 'lwc';
2+
3+
export default class extends LightningElement {
4+
computed = 'injected';
5+
spread = { innerHTML: 'wheeeeeeeeeeeeeeeeeeeeeeeeeee' };
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"entry": "x/outer"
3+
}

packages/@lwc/engine-server/src/__tests__/fixtures/inner-outer-html/outer-lwc/error.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)