collection_spec_test.json 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. "useGarbageCollection": 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. "key": "collection/key",
  50. "options": {
  51. "hasCommittedMutations": false,
  52. "hasLocalMutations": false
  53. },
  54. "value": {
  55. "foo": "bar"
  56. },
  57. "version": 1000
  58. }
  59. ],
  60. "targets": [
  61. 2
  62. ]
  63. }
  64. },
  65. {
  66. "watchCurrent": [
  67. [
  68. 2
  69. ],
  70. "resume-token-1001"
  71. ]
  72. },
  73. {
  74. "watchSnapshot": {
  75. "targetIds": [
  76. ],
  77. "version": 1001
  78. },
  79. "expectedSnapshotEvents": [
  80. {
  81. "added": [
  82. {
  83. "key": "collection/key",
  84. "options": {
  85. "hasCommittedMutations": false,
  86. "hasLocalMutations": false
  87. },
  88. "value": {
  89. "foo": "bar"
  90. },
  91. "version": 1000
  92. }
  93. ],
  94. "errorCode": 0,
  95. "fromCache": false,
  96. "hasPendingWrites": false,
  97. "query": {
  98. "filters": [
  99. ],
  100. "orderBys": [
  101. ],
  102. "path": "collection"
  103. }
  104. }
  105. ]
  106. }
  107. ]
  108. },
  109. "Events are raised for local sets before watch ack": {
  110. "describeName": "Collections:",
  111. "itName": "Events are raised for local sets before watch ack",
  112. "tags": [
  113. ],
  114. "config": {
  115. "numClients": 1,
  116. "useGarbageCollection": true
  117. },
  118. "steps": [
  119. {
  120. "userListen": {
  121. "query": {
  122. "filters": [
  123. ],
  124. "orderBys": [
  125. ],
  126. "path": "collection"
  127. },
  128. "targetId": 2
  129. },
  130. "expectedState": {
  131. "activeTargets": {
  132. "2": {
  133. "queries": [
  134. {
  135. "filters": [
  136. ],
  137. "orderBys": [
  138. ],
  139. "path": "collection"
  140. }
  141. ],
  142. "resumeToken": ""
  143. }
  144. }
  145. }
  146. },
  147. {
  148. "userSet": [
  149. "collection/key",
  150. {
  151. "foo": "bar"
  152. }
  153. ],
  154. "expectedSnapshotEvents": [
  155. {
  156. "added": [
  157. {
  158. "key": "collection/key",
  159. "options": {
  160. "hasCommittedMutations": false,
  161. "hasLocalMutations": true
  162. },
  163. "value": {
  164. "foo": "bar"
  165. },
  166. "version": 0
  167. }
  168. ],
  169. "errorCode": 0,
  170. "fromCache": true,
  171. "hasPendingWrites": true,
  172. "query": {
  173. "filters": [
  174. ],
  175. "orderBys": [
  176. ],
  177. "path": "collection"
  178. }
  179. }
  180. ]
  181. }
  182. ]
  183. }
  184. }