Skip to content

Commit

Permalink
test: enusre _firestoreUnbinds
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Nov 17, 2017
1 parent 4804381 commit e6716e1
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,23 @@ test.beforeEach(async t => {

test('does nothing with no firestore', t => {
const vm = new Vue({
render (h) {
return h('p', 'eh')
},
render: h => ('p', 'foo'),
data: () => ({ items: null }),
})
t.deepEqual(vm.items, null)
})

test('setups _firestoreUnbinds', t => {
const vm = t.context.vm
t.truthy(vm._firestoreUnbinds)
t.deepEqual(Object.keys(vm._firestoreUnbinds).sort(), ['item', 'items'])
})

test('setups _firestoreUnbinds with no firestore options', t => {
const vm = new Vue({
render: h => ('p', 'foo'),
data: () => ({ items: null }),
})
t.truthy(vm._firestoreUnbinds)
t.deepEqual(Object.keys(vm._firestoreUnbinds), [])
})

0 comments on commit e6716e1

Please sign in to comment.