-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ssr): align csr and ssr reflective behavior (#5050)
- Loading branch information
Showing
18 changed files
with
102 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/@lwc/engine-server/src/__tests__/fixtures/attribute-component-global-html/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...r/src/__tests__/fixtures/attribute-global-html/as-component-prop/undeclared/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
packages/@lwc/integration-karma/test-hydration/attributes/non-reflective/x/child/child.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<div>contenteditable: {contentEditable}</div> | ||
</template> |
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
packages/@lwc/integration-karma/test-hydration/attributes/non-reflective/x/main/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
value = { | ||
contenteditable: 'true', | ||
}; | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/@lwc/integration-karma/test-hydration/attributes/reflective/index.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function getAllDivs(target) { | ||
const childs = [...target.shadowRoot.querySelectorAll('x-child')]; | ||
return childs.flatMap((child) => [...child.shadowRoot.querySelectorAll('div')]); | ||
} | ||
export default { | ||
snapshot(target) { | ||
const divs = getAllDivs(target); | ||
return { divs }; | ||
}, | ||
test(target, snapshots, consoleCalls) { | ||
const divs = getAllDivs(target); | ||
expect(divs.length).toBe(snapshots.divs.length); | ||
for (let i = 0; i < divs.length; i += 1) { | ||
expect(divs[i]).toBe(snapshots.divs[i]); | ||
} | ||
expect(consoleCalls.warn).toHaveSize(0); | ||
expect(consoleCalls.error).toHaveSize(0); | ||
}, | ||
}; |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
packages/@lwc/integration-karma/test-hydration/attributes/reflective/x/child/child.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement {} |
28 changes: 28 additions & 0 deletions
28
packages/@lwc/integration-karma/test-hydration/attributes/reflective/x/main/main.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<x-child | ||
accesskey={value.accesskey} | ||
aria-label={value.arialabel} | ||
dir={value.dir} | ||
draggable={value.draggable} | ||
hidden={value.hidden} | ||
id={value.id} | ||
lang={value.lang} | ||
role={value.role} | ||
spellcheck={value.spellcheck} | ||
tabindex={value.tabindex} | ||
title={value.title} | ||
></x-child> | ||
<x-child | ||
accesskey="tata" | ||
aria-label="titi" | ||
dir="auto" | ||
draggable="true" | ||
hidden | ||
id="tutu" | ||
lang="jp" | ||
role="scrollbar" | ||
spellcheck="false" | ||
tabindex="0" | ||
title="tete" | ||
></x-child> | ||
</template> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters