collection_spec_test.json 3.5 KB

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