Add failing test for null hydration

pull/7738/head
Sebastian Silbermann 6 years ago
parent 964207c9ce
commit e7f86bf4b8

@ -0,0 +1,21 @@
export default {
props: {},
snapshot(target) {
const nullText = target.querySelectorAll('p')[0].textContent;
const undefinedText = target.querySelectorAll('p')[1].textContent;
return {
nullText,
undefinedText,
};
},
test(assert, target, snapshot) {
const nullText = target.querySelectorAll('p')[0].textContent;
const undefinedText = target.querySelectorAll('p')[1].textContent;
assert.equal(nullText, snapshot.nullText);
assert.equal(undefinedText, snapshot.undefinedText);
},
};

@ -0,0 +1,7 @@
<script>
let maybeNull = null;
let maybeUndefined = undefined;
</script>
<p>{maybeNull}</p>
<p>{maybeUndefined}</p>
Loading…
Cancel
Save