orderby_spec_test.json 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. {
  2. "orderBy applies filtering based on local state": {
  3. "describeName": "OrderBy:",
  4. "itName": "orderBy applies filtering based on local state",
  5. "tags": [],
  6. "config": {
  7. "useGarbageCollection": true,
  8. "numClients": 1
  9. },
  10. "steps": [
  11. {
  12. "userSet": [
  13. "collection/a",
  14. {
  15. "key": "a",
  16. "sort": 1
  17. }
  18. ]
  19. },
  20. {
  21. "userPatch": [
  22. "collection/b",
  23. {
  24. "sort": 2
  25. }
  26. ]
  27. },
  28. {
  29. "userSet": [
  30. "collection/c",
  31. {
  32. "key": "b"
  33. }
  34. ]
  35. },
  36. {
  37. "userListen": [
  38. 2,
  39. {
  40. "path": "collection",
  41. "filters": [],
  42. "orderBys": [
  43. [
  44. "sort",
  45. "asc"
  46. ]
  47. ]
  48. }
  49. ],
  50. "expectedState": {
  51. "activeTargets": {
  52. "2": {
  53. "queries": [
  54. {
  55. "path": "collection",
  56. "filters": [],
  57. "orderBys": [
  58. [
  59. "sort",
  60. "asc"
  61. ]
  62. ]
  63. }
  64. ],
  65. "resumeToken": ""
  66. }
  67. }
  68. },
  69. "expectedSnapshotEvents": [
  70. {
  71. "query": {
  72. "path": "collection",
  73. "filters": [],
  74. "orderBys": [
  75. [
  76. "sort",
  77. "asc"
  78. ]
  79. ]
  80. },
  81. "added": [
  82. {
  83. "key": "collection/a",
  84. "version": 0,
  85. "value": {
  86. "key": "a",
  87. "sort": 1
  88. },
  89. "options": {
  90. "hasLocalMutations": true,
  91. "hasCommittedMutations": false
  92. }
  93. }
  94. ],
  95. "errorCode": 0,
  96. "fromCache": true,
  97. "hasPendingWrites": true
  98. }
  99. ]
  100. },
  101. {
  102. "watchAck": [
  103. 2
  104. ]
  105. },
  106. {
  107. "watchEntity": {
  108. "docs": [
  109. {
  110. "key": "collection/b",
  111. "version": 1001,
  112. "value": {
  113. "key": "b"
  114. },
  115. "options": {
  116. "hasLocalMutations": false,
  117. "hasCommittedMutations": false
  118. }
  119. }
  120. ],
  121. "targets": [
  122. 2
  123. ]
  124. }
  125. },
  126. {
  127. "watchCurrent": [
  128. [
  129. 2
  130. ],
  131. "resume-token-2000"
  132. ]
  133. },
  134. {
  135. "watchSnapshot": {
  136. "version": 2000,
  137. "targetIds": []
  138. },
  139. "expectedSnapshotEvents": [
  140. {
  141. "query": {
  142. "path": "collection",
  143. "filters": [],
  144. "orderBys": [
  145. [
  146. "sort",
  147. "asc"
  148. ]
  149. ]
  150. },
  151. "added": [
  152. {
  153. "key": "collection/b",
  154. "version": 1001,
  155. "value": {
  156. "key": "b",
  157. "sort": 2
  158. },
  159. "options": {
  160. "hasLocalMutations": true,
  161. "hasCommittedMutations": false
  162. }
  163. }
  164. ],
  165. "errorCode": 0,
  166. "fromCache": false,
  167. "hasPendingWrites": true
  168. }
  169. ]
  170. }
  171. ]
  172. },
  173. "orderBy applies to existing documents": {
  174. "describeName": "OrderBy:",
  175. "itName": "orderBy applies to existing documents",
  176. "tags": [],
  177. "config": {
  178. "useGarbageCollection": false,
  179. "numClients": 1
  180. },
  181. "steps": [
  182. {
  183. "userListen": [
  184. 2,
  185. {
  186. "path": "collection",
  187. "filters": [],
  188. "orderBys": [
  189. [
  190. "sort",
  191. "asc"
  192. ]
  193. ]
  194. }
  195. ],
  196. "expectedState": {
  197. "activeTargets": {
  198. "2": {
  199. "queries": [
  200. {
  201. "path": "collection",
  202. "filters": [],
  203. "orderBys": [
  204. [
  205. "sort",
  206. "asc"
  207. ]
  208. ]
  209. }
  210. ],
  211. "resumeToken": ""
  212. }
  213. }
  214. }
  215. },
  216. {
  217. "watchAck": [
  218. 2
  219. ]
  220. },
  221. {
  222. "watchEntity": {
  223. "docs": [
  224. {
  225. "key": "collection/a",
  226. "version": 1000,
  227. "value": {
  228. "key": "a",
  229. "sort": 2
  230. },
  231. "options": {
  232. "hasLocalMutations": false,
  233. "hasCommittedMutations": false
  234. }
  235. },
  236. {
  237. "key": "collection/b",
  238. "version": 1001,
  239. "value": {
  240. "key": "b",
  241. "sort": 1
  242. },
  243. "options": {
  244. "hasLocalMutations": false,
  245. "hasCommittedMutations": false
  246. }
  247. }
  248. ],
  249. "targets": [
  250. 2
  251. ]
  252. }
  253. },
  254. {
  255. "watchCurrent": [
  256. [
  257. 2
  258. ],
  259. "resume-token-1002"
  260. ]
  261. },
  262. {
  263. "watchSnapshot": {
  264. "version": 1002,
  265. "targetIds": []
  266. },
  267. "expectedSnapshotEvents": [
  268. {
  269. "query": {
  270. "path": "collection",
  271. "filters": [],
  272. "orderBys": [
  273. [
  274. "sort",
  275. "asc"
  276. ]
  277. ]
  278. },
  279. "added": [
  280. {
  281. "key": "collection/b",
  282. "version": 1001,
  283. "value": {
  284. "key": "b",
  285. "sort": 1
  286. },
  287. "options": {
  288. "hasLocalMutations": false,
  289. "hasCommittedMutations": false
  290. }
  291. },
  292. {
  293. "key": "collection/a",
  294. "version": 1000,
  295. "value": {
  296. "key": "a",
  297. "sort": 2
  298. },
  299. "options": {
  300. "hasLocalMutations": false,
  301. "hasCommittedMutations": false
  302. }
  303. }
  304. ],
  305. "errorCode": 0,
  306. "fromCache": false,
  307. "hasPendingWrites": false
  308. }
  309. ]
  310. },
  311. {
  312. "userUnlisten": [
  313. 2,
  314. {
  315. "path": "collection",
  316. "filters": [],
  317. "orderBys": [
  318. [
  319. "sort",
  320. "asc"
  321. ]
  322. ]
  323. }
  324. ],
  325. "expectedState": {
  326. "activeTargets": {}
  327. }
  328. },
  329. {
  330. "watchRemove": {
  331. "targetIds": [
  332. 2
  333. ]
  334. }
  335. },
  336. {
  337. "userListen": [
  338. 2,
  339. {
  340. "path": "collection",
  341. "filters": [],
  342. "orderBys": [
  343. [
  344. "sort",
  345. "asc"
  346. ]
  347. ]
  348. }
  349. ],
  350. "expectedState": {
  351. "activeTargets": {
  352. "2": {
  353. "queries": [
  354. {
  355. "path": "collection",
  356. "filters": [],
  357. "orderBys": [
  358. [
  359. "sort",
  360. "asc"
  361. ]
  362. ]
  363. }
  364. ],
  365. "resumeToken": "resume-token-1002"
  366. }
  367. }
  368. },
  369. "expectedSnapshotEvents": [
  370. {
  371. "query": {
  372. "path": "collection",
  373. "filters": [],
  374. "orderBys": [
  375. [
  376. "sort",
  377. "asc"
  378. ]
  379. ]
  380. },
  381. "added": [
  382. {
  383. "key": "collection/b",
  384. "version": 1001,
  385. "value": {
  386. "key": "b",
  387. "sort": 1
  388. },
  389. "options": {
  390. "hasLocalMutations": false,
  391. "hasCommittedMutations": false
  392. }
  393. },
  394. {
  395. "key": "collection/a",
  396. "version": 1000,
  397. "value": {
  398. "key": "a",
  399. "sort": 2
  400. },
  401. "options": {
  402. "hasLocalMutations": false,
  403. "hasCommittedMutations": false
  404. }
  405. }
  406. ],
  407. "errorCode": 0,
  408. "fromCache": true,
  409. "hasPendingWrites": false
  410. }
  411. ]
  412. },
  413. {
  414. "watchAck": [
  415. 2
  416. ]
  417. },
  418. {
  419. "watchEntity": {
  420. "docs": [],
  421. "targets": [
  422. 2
  423. ]
  424. }
  425. },
  426. {
  427. "watchCurrent": [
  428. [
  429. 2
  430. ],
  431. "resume-token-1002"
  432. ]
  433. },
  434. {
  435. "watchSnapshot": {
  436. "version": 1002,
  437. "targetIds": []
  438. },
  439. "expectedSnapshotEvents": [
  440. {
  441. "query": {
  442. "path": "collection",
  443. "filters": [],
  444. "orderBys": [
  445. [
  446. "sort",
  447. "asc"
  448. ]
  449. ]
  450. },
  451. "errorCode": 0,
  452. "fromCache": false,
  453. "hasPendingWrites": false
  454. }
  455. ]
  456. }
  457. ]
  458. }
  459. }