Skip to content

Commit

Permalink
test(refs): new ref in the while not yet resolved
Browse files Browse the repository at this point in the history
I was trying to go throught the non-visited else but it may be unnecessary
  • Loading branch information
posva committed Dec 29, 2017
1 parent 12f19e8 commit a011e40
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/bind.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,26 @@ test('waits for all refs in document', async () => {
})
})

test('waits for all refs in document with interrupting by new ref', async () => {
const a = db.collection().doc()
const b = db.collection().doc()
const c = db.collection().doc()
delayUpdate(b)
await document.update({ a, b })

const promise = vm.$bind('item', document)

document.update({ c })

await promise

expect(vm.item).toEqual({
a: null,
b: null,
c: null
})
})

test('waits for all refs in collection', async () => {
const a = db.collection().doc()
const b = db.collection().doc()
Expand Down

0 comments on commit a011e40

Please sign in to comment.