aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests/Local/FSTMutationQueueTests.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Example/Tests/Local/FSTMutationQueueTests.mm')
-rw-r--r--Firestore/Example/Tests/Local/FSTMutationQueueTests.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/Firestore/Example/Tests/Local/FSTMutationQueueTests.mm b/Firestore/Example/Tests/Local/FSTMutationQueueTests.mm
index 7d305d0..f5294d5 100644
--- a/Firestore/Example/Tests/Local/FSTMutationQueueTests.mm
+++ b/Firestore/Example/Tests/Local/FSTMutationQueueTests.mm
@@ -217,6 +217,22 @@ NS_ASSUME_NONNULL_BEGIN
XCTAssertNil(notFound);
}
+- (void)testNextMutationBatchAfterBatchIDSkipsAcknowledgedBatches {
+ if ([self isTestBaseClass]) return;
+
+ NSMutableArray<FSTMutationBatch *> *batches = [self createBatches:3];
+ XCTAssertEqualObjects([self.mutationQueue nextMutationBatchAfterBatchID:kFSTBatchIDUnknown],
+ batches[0]);
+
+ [self acknowledgeBatch:batches[0]];
+ XCTAssertEqualObjects([self.mutationQueue nextMutationBatchAfterBatchID:kFSTBatchIDUnknown],
+ batches[1]);
+ XCTAssertEqualObjects([self.mutationQueue nextMutationBatchAfterBatchID:batches[0].batchID],
+ batches[1]);
+ XCTAssertEqualObjects([self.mutationQueue nextMutationBatchAfterBatchID:batches[1].batchID],
+ batches[2]);
+}
+
- (void)testAllMutationBatchesThroughBatchID {
if ([self isTestBaseClass]) return;