-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ssr): update wire adapter validation @ W-17274788 (#4910)
* test(ssr): add test for wire config object * feat: add wire adapter param validation * test: add some test fixtures for wire * test: add test fixtures for wire * test: refactor tests * feat: validate that the adapter is an imported module * feat: add config validation * feat(ssr): fix wire adapter assumptions * chore(fixtures): standardize output order * chore(ssr): unexpect failures * chore: linter fixes --------- Co-authored-by: James Tu <j.tu@salesforce.com> Co-authored-by: Nolan Lawson <nlawson@salesforce.com> Co-authored-by: Eugene Kashida <ekashida@gmail.com>
- Loading branch information
1 parent
fc811b7
commit e60891b
Showing
11 changed files
with
194 additions
and
143 deletions.
There are no files selected for viewing
23 changes: 10 additions & 13 deletions
23
packages/@lwc/engine-server/src/__tests__/fixtures/wire/config/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
<x-wire> | ||
<template shadowrootmode="open"> | ||
Wire adapter value: { | ||
: , | ||
0: 0, | ||
variable: 4404, | ||
prop: not magic, | ||
array: [ | ||
value | ||
], | ||
fakeMagic: [ | ||
$cmpProp, | ||
$ string in arrays aren't magic | ||
], | ||
true: true, | ||
array: [value], | ||
fakeMagic: [$cmpProp,$ string in arrays aren't magic], | ||
false: false, | ||
null: null, | ||
Infinity: null, | ||
magic: 123, | ||
NaN: null, | ||
: , | ||
magic: 123 | ||
null: null, | ||
prop: not magic, | ||
true: true, | ||
undefined: undefined, | ||
variable: 4404, | ||
why: undefined, | ||
} | ||
</template> | ||
</x-wire> |
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
7 changes: 2 additions & 5 deletions
7
packages/@lwc/engine-server/src/__tests__/fixtures/wire/field/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
<x-wire> | ||
<template shadowrootmode="open"> | ||
wired field value: { | ||
key2: [ | ||
fixed, | ||
array | ||
], | ||
key1: foo | ||
key1: foo, | ||
key2: [fixed,array], | ||
} | ||
</template> | ||
</x-wire> |
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
7 changes: 2 additions & 5 deletions
7
packages/@lwc/engine-server/src/__tests__/fixtures/wire/method/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
<x-wire> | ||
<template shadowrootmode="open"> | ||
wired field value: { | ||
key2: [ | ||
fixed, | ||
array | ||
], | ||
key1: foo | ||
key1: foo, | ||
key2: [fixed,array], | ||
} | ||
</template> | ||
</x-wire> |
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
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
Oops, something went wrong.