collection_spec_test.json 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. {
  2. "Events are raised after watch ack": {
  3. "describeName": "Collections:",
  4. "itName": "Events are raised after watch ack",
  5. "tags": [
  6. ],
  7. "config": {
  8. "numClients": 1,
  9. "useEagerGCForMemory": true
  10. },
  11. "steps": [
  12. {
  13. "userListen": {
  14. "query": {
  15. "filters": [
  16. ],
  17. "orderBys": [
  18. ],
  19. "path": "collection"
  20. },
  21. "targetId": 2
  22. },
  23. "expectedState": {
  24. "activeTargets": {
  25. "2": {
  26. "queries": [
  27. {
  28. "filters": [
  29. ],
  30. "orderBys": [
  31. ],
  32. "path": "collection"
  33. }
  34. ],
  35. "resumeToken": ""
  36. }
  37. }
  38. }
  39. },
  40. {
  41. "watchAck": [
  42. 2
  43. ]
  44. },
  45. {
  46. "watchEntity": {
  47. "docs": [
  48. {
  49. "createTime": 0,
  50. "key": "collection/key",
  51. "options": {
  52. "hasCommittedMutations": false,
  53. "hasLocalMutations": false
  54. },
  55. "value": {
  56. "foo": "bar"
  57. },
  58. "version": 1000
  59. }
  60. ],
  61. "targets": [
  62. 2
  63. ]
  64. }
  65. },
  66. {
  67. "watchCurrent": [
  68. [
  69. 2
  70. ],
  71. "resume-token-1001"
  72. ]
  73. },
  74. {
  75. "watchSnapshot": {
  76. "targetIds": [
  77. ],
  78. "version": 1001
  79. },
  80. "expectedSnapshotEvents": [
  81. {
  82. "added": [
  83. {
  84. "createTime": 0,
  85. "key": "collection/key",
  86. "options": {
  87. "hasCommittedMutations": false,
  88. "hasLocalMutations": false
  89. },
  90. "value": {
  91. "foo": "bar"
  92. },
  93. "version": 1000
  94. }
  95. ],
  96. "errorCode": 0,
  97. "fromCache": false,
  98. "hasPendingWrites": false,
  99. "query": {
  100. "filters": [
  101. ],
  102. "orderBys": [
  103. ],
  104. "path": "collection"
  105. }
  106. }
  107. ]
  108. }
  109. ]
  110. },
  111. "Events are raised for local sets before watch ack": {
  112. "describeName": "Collections:",
  113. "itName": "Events are raised for local sets before watch ack",
  114. "tags": [
  115. ],
  116. "config": {
  117. "numClients": 1,
  118. "useEagerGCForMemory": true
  119. },
  120. "steps": [
  121. {
  122. "userListen": {
  123. "query": {
  124. "filters": [
  125. ],
  126. "orderBys": [
  127. ],
  128. "path": "collection"
  129. },
  130. "targetId": 2
  131. },
  132. "expectedState": {
  133. "activeTargets": {
  134. "2": {
  135. "queries": [
  136. {
  137. "filters": [
  138. ],
  139. "orderBys": [
  140. ],
  141. "path": "collection"
  142. }
  143. ],
  144. "resumeToken": ""
  145. }
  146. }
  147. }
  148. },
  149. {
  150. "userSet": [
  151. "collection/key",
  152. {
  153. "foo": "bar"
  154. }
  155. ],
  156. "expectedSnapshotEvents": [
  157. {
  158. "added": [
  159. {
  160. "createTime": 0,
  161. "key": "collection/key",
  162. "options": {
  163. "hasCommittedMutations": false,
  164. "hasLocalMutations": true
  165. },
  166. "value": {
  167. "foo": "bar"
  168. },
  169. "version": 0
  170. }
  171. ],
  172. "errorCode": 0,
  173. "fromCache": true,
  174. "hasPendingWrites": true,
  175. "query": {
  176. "filters": [
  177. ],
  178. "orderBys": [
  179. ],
  180. "path": "collection"
  181. }
  182. }
  183. ]
  184. }
  185. ]
  186. }
  187. }