Skip to content

Commit 34a0356

Browse files
committed
Use a more realistic scenario for watch sending a version back in time
1 parent 30ef661 commit 34a0356

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/firestore/test/unit/specs/listen_spec.test.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,19 @@ describeSpec('Listens:', [], () => {
271271
// (the document falls out) and send us a snapshot that's ahead of
272272
// docAv3 (which is already in our cache).
273273
.userListens(visibleQuery, 'resume-token-1000')
274-
.watchAcksFull(visibleQuery, 5000, docAv2)
274+
.watchAcks(visibleQuery)
275+
.watchSends({ affects: [visibleQuery] }, docAv2)
276+
.watchSnapshots(5000)
277+
.watchSends({ affects: [visibleQuery] }, docAv3)
278+
.watchCurrents(visibleQuery, 'resume-token-5000')
279+
.watchSnapshots(6000)
275280
.expectEvents(visibleQuery, { fromCache: false })
276281
.userUnlistens(visibleQuery)
277282
.watchRemoves(visibleQuery)
278283
// Listen to allQuery again and make sure we still get docAv3.
279284
.userListens(allQuery, 'resume-token-4000')
280285
.expectEvents(allQuery, { added: [docAv3], fromCache: true })
281-
.watchAcksFull(allQuery, 6000)
286+
.watchAcksFull(allQuery, 7000)
282287
.expectEvents(allQuery, { fromCache: false })
283288
);
284289
});

0 commit comments

Comments
 (0)