const test = require('tape') const onReady = require('document-ready') const append = require('append-child') const mount = require('../../mount') const choo = require('../../') const html = require('../../html') test('rehydration', function (t) { t.plan(2) const app = choo() const node = html`
Hello squirrel!
` app.router(['/', function (state, prev, send) { return html`
send('test')}>Hello world!
` }]) append(node) const tree = app.start() mount('#app-root', tree) onReady(function () { const newNode = document.querySelector('#app-root') const el = newNode.children[0] t.equal(el.innerHTML, 'Hello world!', 'same as it ever was') t.equal(typeof el.onclick, 'function', 'attaches dom listeners') }) })