Add test coverage for disabling sheet-router history/href listeners

This commit is contained in:
Ben Drucker
2016-07-04 16:19:17 -07:00
parent e6a2a8c01d
commit 04b9e0efd2
+36
View File
@@ -109,4 +109,40 @@ test('routing', function (t) {
return view`<div>${state.user}</div>` return view`<div>${state.user}</div>`
} }
}) })
t.test('disabling history', function (t) {
t.plan(1)
const choo = proxyquire('../..', {
'sheet-router/history': () => t.fail('history listener attached')
})
const app = choo()
app.router('/', (route) => [
route('/', function () {
t.pass('rendered')
})
])
app.start({history: false})
})
t.test('disabling href', function (t) {
t.plan(1)
const choo = proxyquire('../..', {
'sheet-router/href': () => t.fail('href listener attached')
})
const app = choo()
app.router('/', (route) => [
route('/', function () {
t.pass('rendered')
})
])
app.start({href: false})
})
}) })