Skip to content

Commit 12c667f

Browse files
committed
Add failing test for null hydration
1 parent 2ef004e commit 12c667f

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<p></p>
2+
<p>undefined</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<p>null</p>
2+
<p>undefined</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default {
2+
props: {},
3+
4+
snapshot(target) {
5+
const nullText = target.querySelectorAll('p')[0].textContent;
6+
const undefinedText = target.querySelectorAll('p')[1].textContent;
7+
8+
return {
9+
nullText,
10+
undefinedText,
11+
};
12+
},
13+
14+
test(assert, target, snapshot) {
15+
const nullText = target.querySelectorAll('p')[0].textContent;
16+
const undefinedText = target.querySelectorAll('p')[1].textContent;
17+
18+
assert.equal(nullText, snapshot.nullText);
19+
assert.equal(undefinedText, snapshot.undefinedText);
20+
},
21+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script>
2+
let maybeNull = null;
3+
let maybeUndefined = undefined;
4+
</script>
5+
6+
<p>{maybeNull}</p>
7+
<p>{maybeUndefined}</p>

0 commit comments

Comments
 (0)