work around Svelte hydration failures

This commit is contained in:
Rich Harris
2018-01-20 12:53:06 -05:00
parent d77722c042
commit faeddd8add
2 changed files with 5 additions and 3 deletions

View File

@@ -13,6 +13,8 @@
<p><strong>Try editing this file (routes/index.html) to test hot module reloading.</strong></p>
</Layout>
<div class='hydrate-test'></div>
<style>
h1, figure, p {
text-align: center;

View File

@@ -317,13 +317,13 @@ function run(env) {
it('hydrates initial route', () => {
return nightmare.goto(base)
.wait('h1')
.wait('.hydrate-test')
.evaluate(() => {
window.h1 = document.querySelector('h1');
window.el = document.querySelector('.hydrate-test');
})
.init().wait(100)
.evaluate(() => {
return document.querySelector('h1') === window.h1;
return document.querySelector('.hydrate-test') === window.el;
})
.then(matches => {
assert.ok(matches);