aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests/SpecTests/json/orderby_spec_test.json
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Example/Tests/SpecTests/json/orderby_spec_test.json')
-rw-r--r--Firestore/Example/Tests/SpecTests/json/orderby_spec_test.json155
1 files changed, 155 insertions, 0 deletions
diff --git a/Firestore/Example/Tests/SpecTests/json/orderby_spec_test.json b/Firestore/Example/Tests/SpecTests/json/orderby_spec_test.json
new file mode 100644
index 0000000..1009206
--- /dev/null
+++ b/Firestore/Example/Tests/SpecTests/json/orderby_spec_test.json
@@ -0,0 +1,155 @@
+{
+ "orderBy applies filtering based on local state": {
+ "describeName": "OrderBy:",
+ "itName": "orderBy applies filtering based on local state",
+ "tags": [],
+ "config": {
+ "useGarbageCollection": true
+ },
+ "steps": [
+ {
+ "userSet": [
+ "collection/a",
+ {
+ "key": "a",
+ "sort": 1
+ }
+ ]
+ },
+ {
+ "userPatch": [
+ "collection/b",
+ {
+ "sort": 2
+ }
+ ]
+ },
+ {
+ "userSet": [
+ "collection/c",
+ {
+ "key": "b"
+ }
+ ]
+ },
+ {
+ "userListen": [
+ 2,
+ {
+ "path": "collection",
+ "filters": [],
+ "orderBys": [
+ [
+ "sort",
+ "asc"
+ ]
+ ]
+ }
+ ],
+ "stateExpect": {
+ "activeTargets": {
+ "2": {
+ "query": {
+ "path": "collection",
+ "filters": [],
+ "orderBys": [
+ [
+ "sort",
+ "asc"
+ ]
+ ]
+ },
+ "resumeToken": ""
+ }
+ }
+ },
+ "expect": [
+ {
+ "query": {
+ "path": "collection",
+ "filters": [],
+ "orderBys": [
+ [
+ "sort",
+ "asc"
+ ]
+ ]
+ },
+ "added": [
+ [
+ "collection/a",
+ 0,
+ {
+ "key": "a",
+ "sort": 1
+ },
+ "local"
+ ]
+ ],
+ "errorCode": 0,
+ "fromCache": true,
+ "hasPendingWrites": true
+ }
+ ]
+ },
+ {
+ "watchAck": [
+ 2
+ ]
+ },
+ {
+ "watchEntity": {
+ "docs": [
+ [
+ "collection/b",
+ 1001,
+ {
+ "key": "b"
+ }
+ ]
+ ],
+ "targets": [
+ 2
+ ]
+ }
+ },
+ {
+ "watchCurrent": [
+ [
+ 2
+ ],
+ "resume-token-2000"
+ ],
+ "watchSnapshot": 2000,
+ "expect": [
+ {
+ "query": {
+ "path": "collection",
+ "filters": [],
+ "orderBys": [
+ [
+ "sort",
+ "asc"
+ ]
+ ]
+ },
+ "added": [
+ [
+ "collection/b",
+ 1001,
+ {
+ "key": "b",
+ "sort": 2
+ },
+ "local"
+ ]
+ ],
+ "errorCode": 0,
+ "fromCache": false,
+ "hasPendingWrites": true
+ }
+ ]
+ }
+ ]
+ }
+}