-
Notifications
You must be signed in to change notification settings - Fork 439
Expand file tree
/
Copy pathindex.spec.js
More file actions
32 lines (30 loc) · 1.09 KB
/
index.spec.js
File metadata and controls
32 lines (30 loc) · 1.09 KB
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
32
import { expectConsoleCallsDev } from '../../../helpers/utils.js';
export default {
props: {
ssr: true,
},
clientProps: {
ssr: false,
},
snapshot(target) {
const p = target.shadowRoot.querySelector('p');
return {
p,
};
},
test(target, snapshots, consoleCalls) {
const p = target.shadowRoot.querySelector('p');
expect(p).not.toBe(snapshots.p);
expect(p.getAttribute('title')).toBe('client-title');
expect(p.getAttribute('data-same')).toBe('same-value');
expect(p.getAttribute('data-another-diff')).toBe('client-val');
expectConsoleCallsDev(consoleCalls, {
error: [],
warn: [
'Hydration attribute mismatch on: <p> - rendered on server: title="ssr-title" - expected on client: title="client-title"',
'Hydration attribute mismatch on: <p> - rendered on server: data-another-diff="ssr-val" - expected on client: data-another-diff="client-val"',
'Hydration completed with errors.',
],
});
},
};