orderby_spec_test.json 10 KB

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