-
Notifications
You must be signed in to change notification settings - Fork 439
Expand file tree
/
Copy pathindex.spec.js
More file actions
30 lines (27 loc) · 828 Bytes
/
index.spec.js
File metadata and controls
30 lines (27 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { expectConsoleCallsDev } from '../../../helpers/utils.js';
export default {
props: {
showAsText: true,
},
clientProps: {
showAsText: false,
},
snapshot(target) {
const text = target.shadowRoot.firstChild;
return {
text,
};
},
test(target, snapshots, consoleCalls) {
const comment = target.shadowRoot.firstChild;
expect(comment.nodeType).toBe(Node.COMMENT_NODE);
expect(comment.nodeValue).toBe(snapshots.text.nodeValue);
expectConsoleCallsDev(consoleCalls, {
error: [],
warn: [
'Hydration node mismatch on: #comment - rendered on server: #text - expected on client: #comment',
'Hydration completed with errors.',
],
});
},
};