-
Notifications
You must be signed in to change notification settings - Fork 439
Expand file tree
/
Copy pathindex.spec.js
More file actions
30 lines (28 loc) · 907 Bytes
/
index.spec.js
File metadata and controls
30 lines (28 loc) · 907 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: {
foo: 'server',
},
clientProps: {
foo: 'client',
},
snapshot(target) {
const div = target.shadowRoot.querySelector('div');
return {
div,
};
},
test(target, snapshots, consoleCalls) {
const div = target.shadowRoot.querySelector('div');
expect(div).not.toBe(snapshots.div);
expect(div.getAttribute('data-foo')).toBe('client');
expect(div.getAttribute('data-static')).toBe('same-value');
expectConsoleCallsDev(consoleCalls, {
error: [],
warn: [
'Hydration attribute mismatch on: <div> - rendered on server: data-foo="server" - expected on client: data-foo="client"',
'Hydration completed with errors.',
],
});
},
};