Skip to content

Commit 40aa4c9

Browse files
committed
test(bind): add document binding test
1 parent 6511f35 commit 40aa4c9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/bind.spec.js

+10
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@ test('manually binds a collection', async t => {
3939
await collection.add({ text: 'foo' })
4040
t.deepEqual(vm.items, [{ text: 'foo' }])
4141
})
42+
43+
test('manually binds a document', async t => {
44+
const vm = t.context.vm
45+
const document = t.context.document
46+
t.deepEqual(vm.item, null)
47+
await vm.$bind('item', document)
48+
t.deepEqual(vm.item, null)
49+
await document.update({ text: 'foo' })
50+
t.deepEqual(vm.item, { text: 'foo' })
51+
})

0 commit comments

Comments
 (0)