Skip to content

Commit a011e40

Browse files
committed
test(refs): new ref in the while not yet resolved
I was trying to go throught the non-visited else but it may be unnecessary
1 parent 12f19e8 commit a011e40

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/bind.spec.js

+20
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,26 @@ test('waits for all refs in document', async () => {
100100
})
101101
})
102102

103+
test('waits for all refs in document with interrupting by new ref', async () => {
104+
const a = db.collection().doc()
105+
const b = db.collection().doc()
106+
const c = db.collection().doc()
107+
delayUpdate(b)
108+
await document.update({ a, b })
109+
110+
const promise = vm.$bind('item', document)
111+
112+
document.update({ c })
113+
114+
await promise
115+
116+
expect(vm.item).toEqual({
117+
a: null,
118+
b: null,
119+
c: null
120+
})
121+
})
122+
103123
test('waits for all refs in collection', async () => {
104124
const a = db.collection().doc()
105125
const b = db.collection().doc()

0 commit comments

Comments
 (0)