collection_spec_test.json 3.6 KB

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