diff --git a/test/hydration/samples/element-nested-sibling/_after.html b/test/hydration/samples/element-nested-sibling/_after.html new file mode 100644 index 0000000000..d011cf6e38 --- /dev/null +++ b/test/hydration/samples/element-nested-sibling/_after.html @@ -0,0 +1,4 @@ +

+ 1 + 2 +

diff --git a/test/hydration/samples/element-nested-sibling/_before.html b/test/hydration/samples/element-nested-sibling/_before.html new file mode 100644 index 0000000000..d011cf6e38 --- /dev/null +++ b/test/hydration/samples/element-nested-sibling/_before.html @@ -0,0 +1,4 @@ +

+ 1 + 2 +

diff --git a/test/hydration/samples/element-nested-sibling/_config.js b/test/hydration/samples/element-nested-sibling/_config.js new file mode 100644 index 0000000000..8410fc189d --- /dev/null +++ b/test/hydration/samples/element-nested-sibling/_config.js @@ -0,0 +1,19 @@ +export default { + snapshot(target) { + const p = target.querySelector('p'); + + return { + p, + span: p.querySelector('span'), + code: p.querySelector('code') + }; + }, + + test(assert, target, snapshot) { + const p = target.querySelector('p'); + + assert.equal(p, snapshot.p); + assert.equal(p.querySelector('span'), snapshot.span); + assert.equal(p.querySelector('code'), snapshot.code); + } +}; diff --git a/test/hydration/samples/element-nested-sibling/main.svelte b/test/hydration/samples/element-nested-sibling/main.svelte new file mode 100644 index 0000000000..d6e02107e2 --- /dev/null +++ b/test/hydration/samples/element-nested-sibling/main.svelte @@ -0,0 +1,6 @@ +

+ 1 + {#if true} + 2 + {/if} +

diff --git a/test/hydration/samples/expression-sibling/_config.js b/test/hydration/samples/expression-sibling/_config.js index 9cc0554776..c6d3ef3f2f 100644 --- a/test/hydration/samples/expression-sibling/_config.js +++ b/test/hydration/samples/expression-sibling/_config.js @@ -1,19 +1,19 @@ export default { snapshot(target) { - const p = target.querySelector("p"); + const p = target.querySelector('p'); return { p, text: p.childNodes[0], - span: p.querySelector("span"), + span: p.querySelector('span') }; }, test(assert, target, snapshot) { - const p = target.querySelector("p"); + const p = target.querySelector('p'); assert.equal(p, snapshot.p); assert.equal(p.childNodes[0], snapshot.text); - assert.equal(p.querySelector("span"), snapshot.span); - }, + assert.equal(p.querySelector('span'), snapshot.span); + } };