Skip to content

Commit 583ba44

Browse files
Update test comments
1 parent d7a7f0a commit 583ba44

File tree

1 file changed

+46
-50
lines changed

1 file changed

+46
-50
lines changed

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

Lines changed: 46 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ describeSpec('Writes:', [], () => {
497497
);
498498
});
499499

500-
specTest('Held writes are not re-sent.', [], () => {
500+
specTest('Writes are not re-sent.', [], () => {
501501
const query = Query.atPath(path('collection'));
502502
const docALocal = doc(
503503
'collection/a',
@@ -544,64 +544,60 @@ describeSpec('Writes:', [], () => {
544544
);
545545
});
546546

547-
specTest(
548-
'Held writes are not re-sent after disable/enable network.',
549-
[],
550-
() => {
551-
const query = Query.atPath(path('collection'));
552-
const docALocal = doc(
553-
'collection/a',
554-
0,
555-
{ v: 1 },
556-
{ hasLocalMutations: true }
557-
);
558-
const docA = doc('collection/a', 1000, { v: 1 });
547+
specTest('Writes are not re-sent after disable/enable network.', [], () => {
548+
const query = Query.atPath(path('collection'));
549+
const docALocal = doc(
550+
'collection/a',
551+
0,
552+
{ v: 1 },
553+
{ hasLocalMutations: true }
554+
);
555+
const docA = doc('collection/a', 1000, { v: 1 });
559556

560-
return (
561-
spec()
562-
.userListens(query)
563-
.watchAcksFull(query, 500)
564-
.expectEvents(query, {})
565-
.userSets('collection/a', { v: 1 })
566-
.expectEvents(query, {
567-
hasPendingWrites: true,
568-
added: [docALocal]
569-
})
570-
// ack write but without a watch event.
571-
.writeAcks('collection/a', 1000)
557+
return (
558+
spec()
559+
.userListens(query)
560+
.watchAcksFull(query, 500)
561+
.expectEvents(query, {})
562+
.userSets('collection/a', { v: 1 })
563+
.expectEvents(query, {
564+
hasPendingWrites: true,
565+
added: [docALocal]
566+
})
567+
// ack write but without a watch event.
568+
.writeAcks('collection/a', 1000)
572569

573-
// handshake + write = 2 requests
574-
.expectWriteStreamRequestCount(2)
570+
// handshake + write = 2 requests
571+
.expectWriteStreamRequestCount(2)
575572

576-
.disableNetwork()
577-
.expectEvents(query, {
578-
hasPendingWrites: true,
579-
fromCache: true
580-
})
573+
.disableNetwork()
574+
.expectEvents(query, {
575+
hasPendingWrites: true,
576+
fromCache: true
577+
})
581578

582-
// handshake + write + close = 3 requests
583-
.expectWriteStreamRequestCount(3)
579+
// handshake + write + close = 3 requests
580+
.expectWriteStreamRequestCount(3)
584581

585-
.enableNetwork()
586-
.expectActiveTargets({ query, resumeToken: 'resume-token-500' })
582+
.enableNetwork()
583+
.expectActiveTargets({ query, resumeToken: 'resume-token-500' })
587584

588-
// acked write should /not/ have been resent, so count should still be 3
589-
.expectWriteStreamRequestCount(3)
585+
// acked write should /not/ have been resent, so count should still be 3
586+
.expectWriteStreamRequestCount(3)
590587

591-
// Finally watch catches up.
592-
.watchAcksFull(query, 2000, docA)
593-
.expectEvents(query, {
594-
metadata: [docA]
595-
})
596-
);
597-
}
598-
);
588+
// Finally watch catches up.
589+
.watchAcksFull(query, 2000, docA)
590+
.expectEvents(query, {
591+
metadata: [docA]
592+
})
593+
);
594+
});
599595

600596
specTest(
601-
'Held writes are released when there are no queries left.',
597+
'Writes are released when there are no queries left',
602598
['eager-gc'],
603-
'This test expects a new target id for a new listen, but without eager gc, the same target ' +
604-
'id is reused',
599+
'This test verifies that committed mutations are eligible for ' +
600+
'garbage collection on target removal',
605601
() => {
606602
const query = Query.atPath(path('collection'));
607603
const docALocal = doc(
@@ -995,7 +991,7 @@ describeSpec('Writes:', [], () => {
995991
}
996992
);
997993

998-
specTest('Held write is released by primary client', ['multi-client'], () => {
994+
specTest('Writes are released by primary client', ['multi-client'], () => {
999995
const query = Query.atPath(path('collection'));
1000996
const docALocal = doc(
1001997
'collection/a',

0 commit comments

Comments
 (0)