Skip to content

Commit 478f6a5

Browse files
Udpate spec tests from JS Master
1 parent 19a3e5c commit 478f6a5

File tree

4 files changed

+1288
-220
lines changed

4 files changed

+1288
-220
lines changed

firebase-firestore/src/test/resources/json/listen_spec_test.json

Lines changed: 159 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,164 @@
541541
}
542542
]
543543
},
544+
"Doesn't raise 'hasPendingWrites' for deletes": {
545+
"describeName": "Listens:",
546+
"itName": "Doesn't raise 'hasPendingWrites' for deletes",
547+
"tags": [],
548+
"config": {
549+
"useGarbageCollection": true,
550+
"numClients": 1
551+
},
552+
"steps": [
553+
{
554+
"userListen": [
555+
2,
556+
{
557+
"path": "collection",
558+
"filters": [],
559+
"orderBys": []
560+
}
561+
],
562+
"stateExpect": {
563+
"activeTargets": {
564+
"2": {
565+
"query": {
566+
"path": "collection",
567+
"filters": [],
568+
"orderBys": []
569+
},
570+
"resumeToken": ""
571+
}
572+
}
573+
}
574+
},
575+
{
576+
"watchAck": [
577+
2
578+
]
579+
},
580+
{
581+
"watchEntity": {
582+
"docs": [
583+
{
584+
"key": "collection/a",
585+
"version": 0,
586+
"value": {
587+
"key": "a"
588+
},
589+
"options": {
590+
"hasLocalMutations": false,
591+
"hasCommittedMutations": false
592+
}
593+
}
594+
],
595+
"targets": [
596+
2
597+
]
598+
}
599+
},
600+
{
601+
"watchCurrent": [
602+
[
603+
2
604+
],
605+
"resume-token-1000"
606+
]
607+
},
608+
{
609+
"watchSnapshot": {
610+
"version": 1000,
611+
"targetIds": []
612+
},
613+
"expect": [
614+
{
615+
"query": {
616+
"path": "collection",
617+
"filters": [],
618+
"orderBys": []
619+
},
620+
"added": [
621+
{
622+
"key": "collection/a",
623+
"version": 0,
624+
"value": {
625+
"key": "a"
626+
},
627+
"options": {
628+
"hasLocalMutations": false,
629+
"hasCommittedMutations": false
630+
}
631+
}
632+
],
633+
"errorCode": 0,
634+
"fromCache": false,
635+
"hasPendingWrites": false
636+
}
637+
]
638+
},
639+
{
640+
"userDelete": "collection/a",
641+
"expect": [
642+
{
643+
"query": {
644+
"path": "collection",
645+
"filters": [],
646+
"orderBys": []
647+
},
648+
"removed": [
649+
{
650+
"key": "collection/a",
651+
"version": 0,
652+
"value": {
653+
"key": "a"
654+
},
655+
"options": {
656+
"hasLocalMutations": false,
657+
"hasCommittedMutations": false
658+
}
659+
}
660+
],
661+
"errorCode": 0,
662+
"fromCache": false,
663+
"hasPendingWrites": false
664+
}
665+
]
666+
},
667+
{
668+
"writeAck": {
669+
"version": 2000
670+
},
671+
"stateExpect": {
672+
"userCallbacks": {
673+
"acknowledgedDocs": [
674+
"collection/a"
675+
],
676+
"rejectedDocs": []
677+
}
678+
}
679+
},
680+
{
681+
"watchEntity": {
682+
"docs": [
683+
{
684+
"key": "collection/a",
685+
"version": 2000,
686+
"value": null
687+
}
688+
],
689+
"targets": [
690+
2
691+
]
692+
}
693+
},
694+
{
695+
"watchSnapshot": {
696+
"version": 2000,
697+
"targetIds": []
698+
}
699+
}
700+
]
701+
},
544702
"Ensure correct query results with latency-compensated deletes": {
545703
"describeName": "Listens:",
546704
"itName": "Ensure correct query results with latency-compensated deletes",
@@ -2838,7 +2996,7 @@
28382996
"docs": [
28392997
{
28402998
"key": "collection/a",
2841-
"version": 4000,
2999+
"version": 3000,
28423000
"value": {
28433001
"v": "3"
28443002
},

firebase-firestore/src/test/resources/json/offline_spec_test.json

Lines changed: 3 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@
3030
}
3131
}
3232
},
33-
{
34-
"watchStreamClose": {
35-
"error": {
36-
"code": 14,
37-
"message": "Simulated Backend Error"
38-
},
39-
"runBackoffTimer": true
40-
}
41-
},
4233
{
4334
"watchStreamClose": {
4435
"error": {
@@ -125,15 +116,6 @@
125116
"runBackoffTimer": true
126117
}
127118
},
128-
{
129-
"watchStreamClose": {
130-
"error": {
131-
"code": 14,
132-
"message": "Simulated Backend Error"
133-
},
134-
"runBackoffTimer": true
135-
}
136-
},
137119
{
138120
"watchStreamClose": {
139121
"error": {
@@ -209,15 +191,6 @@
209191
}
210192
}
211193
},
212-
{
213-
"watchStreamClose": {
214-
"error": {
215-
"code": 14,
216-
"message": "Simulated Backend Error"
217-
},
218-
"runBackoffTimer": true
219-
}
220-
},
221194
{
222195
"watchStreamClose": {
223196
"error": {
@@ -283,15 +256,6 @@
283256
}
284257
}
285258
},
286-
{
287-
"watchStreamClose": {
288-
"error": {
289-
"code": 14,
290-
"message": "Simulated Backend Error"
291-
},
292-
"runBackoffTimer": true
293-
}
294-
},
295259
{
296260
"watchStreamClose": {
297261
"error": {
@@ -431,15 +395,6 @@
431395
}
432396
}
433397
},
434-
{
435-
"watchStreamClose": {
436-
"error": {
437-
"code": 14,
438-
"message": "Simulated Backend Error"
439-
},
440-
"runBackoffTimer": true
441-
}
442-
},
443398
{
444399
"watchStreamClose": {
445400
"error": {
@@ -689,15 +644,6 @@
689644
"runBackoffTimer": true
690645
}
691646
},
692-
{
693-
"watchStreamClose": {
694-
"error": {
695-
"code": 14,
696-
"message": "Simulated Backend Error"
697-
},
698-
"runBackoffTimer": true
699-
}
700-
},
701647
{
702648
"watchAck": [
703649
2
@@ -992,15 +938,6 @@
992938
}
993939
}
994940
},
995-
{
996-
"watchStreamClose": {
997-
"error": {
998-
"code": 14,
999-
"message": "Simulated Backend Error"
1000-
},
1001-
"runBackoffTimer": true
1002-
}
1003-
},
1004941
{
1005942
"watchStreamClose": {
1006943
"error": {
@@ -1159,7 +1096,9 @@
11591096
"Queries return from cache when network disabled": {
11601097
"describeName": "Offline:",
11611098
"itName": "Queries return from cache when network disabled",
1162-
"tags": ["eager-gc"],
1099+
"tags": [
1100+
"eager-gc"
1101+
],
11631102
"config": {
11641103
"useGarbageCollection": true,
11651104
"numClients": 1

firebase-firestore/src/test/resources/json/remote_store_spec_test.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,19 @@
555555
"message": "Simulated Backend Error"
556556
},
557557
"runBackoffTimer": true
558-
}
558+
},
559+
"expect": [
560+
{
561+
"query": {
562+
"path": "collection",
563+
"filters": [],
564+
"orderBys": []
565+
},
566+
"errorCode": 0,
567+
"fromCache": true,
568+
"hasPendingWrites": false
569+
}
570+
]
559571
},
560572
{
561573
"watchAck": [
@@ -665,6 +677,18 @@
665677
},
666678
"runBackoffTimer": false
667679
},
680+
"expect": [
681+
{
682+
"query": {
683+
"path": "collection",
684+
"filters": [],
685+
"orderBys": []
686+
},
687+
"errorCode": 0,
688+
"fromCache": true,
689+
"hasPendingWrites": false
690+
}
691+
],
668692
"stateExpect": {
669693
"activeTargets": {}
670694
}

0 commit comments

Comments
 (0)