-
Notifications
You must be signed in to change notification settings - Fork 439
Expand file tree
/
Copy pathindex.spec.js
More file actions
31 lines (28 loc) · 867 Bytes
/
index.spec.js
File metadata and controls
31 lines (28 loc) · 867 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
31
import { expectConsoleCallsDev } from '../../../../helpers/utils.js';
export default {
props: {
classes: 'c1 c2 c3',
},
clientProps: {
classes: 'c2 c3 c4',
},
snapshot(target) {
const p = target.shadowRoot.querySelector('p');
return {
p,
classes: p.className,
};
},
test(target, snapshots, consoleCalls) {
const p = target.shadowRoot.querySelector('p');
expect(p).not.toBe(snapshots.p);
expect(p.className).not.toBe(snapshots.classes);
expectConsoleCallsDev(consoleCalls, {
error: [],
warn: [
'Hydration attribute mismatch on: <p> - rendered on server: class="c1 c2 c3" - expected on client: class="c2 c3 c4"',
'Hydration completed with errors.',
],
});
},
};