Add failing test for null hydration

pull/3379/head
Sebastian Silbermann 6 years ago
parent 2ef004e324
commit 12c667f898

@ -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