orderby_spec_test.json 10 KB

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