collection_spec_test.json 2.9 KB

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