@sprucelabs/spruce-test-fixtures 62.2.24 → 62.2.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (291) hide show
  1. package/build/esm/index.d.ts +1 -1
  2. package/build/esm/index.js +1 -1
  3. package/build/esm/tests/fixtures/ViewFixture.d.ts +1 -1
  4. package/build/esm/tests/routers/TestRouter.d.ts +1 -1
  5. package/build/esm/tests/routers/TestRouter.js +1 -1
  6. package/build/index.d.ts +1 -1
  7. package/build/index.js +1 -1
  8. package/build/tests/fixtures/ViewFixture.d.ts +1 -1
  9. package/build/tests/routers/TestRouter.d.ts +1 -1
  10. package/build/tests/routers/TestRouter.js +1 -1
  11. package/package.json +19 -19
  12. package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
  13. package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -112
  14. package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
  15. package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -34
  16. package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
  17. package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -26
  18. package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
  19. package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -69
  20. package/build/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
  21. package/build/__tests__/behavioral/FakingEventResponses.test.js +0 -126
  22. package/build/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
  23. package/build/__tests__/behavioral/FixtureFactory.test.js +0 -79
  24. package/build/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
  25. package/build/__tests__/behavioral/LocationFixture.test.js +0 -144
  26. package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
  27. package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -95
  28. package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
  29. package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -35
  30. package/build/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
  31. package/build/__tests__/behavioral/MercuryFixture.test.js +0 -187
  32. package/build/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
  33. package/build/__tests__/behavioral/OrganizationFixture.test.js +0 -333
  34. package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
  35. package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -21
  36. package/build/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
  37. package/build/__tests__/behavioral/PersonFixture.test.js +0 -225
  38. package/build/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
  39. package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -95
  40. package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
  41. package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -67
  42. package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
  43. package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -44
  44. package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
  45. package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -55
  46. package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
  47. package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -137
  48. package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
  49. package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -54
  50. package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
  51. package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -40
  52. package/build/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
  53. package/build/__tests__/behavioral/RoleFixture.test.js +0 -118
  54. package/build/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
  55. package/build/__tests__/behavioral/SkillFixture.test.js +0 -118
  56. package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
  57. package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -41
  58. package/build/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
  59. package/build/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -59
  60. package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
  61. package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -34
  62. package/build/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
  63. package/build/__tests__/behavioral/databases/DummyStore.js +0 -36
  64. package/build/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
  65. package/build/__tests__/behavioral/databases/StoreFixture.test.js +0 -156
  66. package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
  67. package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -73
  68. package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
  69. package/build/__tests__/behavioral/faking/FakeDecorator.test.js +0 -421
  70. package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
  71. package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -23
  72. package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
  73. package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -27
  74. package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
  75. package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -93
  76. package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
  77. package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -56
  78. package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
  79. package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -141
  80. package/build/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
  81. package/build/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -35
  82. package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
  83. package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -42
  84. package/build/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
  85. package/build/__tests__/behavioral/faking/FakingLocations.test.js +0 -45
  86. package/build/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
  87. package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -140
  88. package/build/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
  89. package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -174
  90. package/build/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
  91. package/build/__tests__/behavioral/faking/UpdatePerson.test.js +0 -32
  92. package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
  93. package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -321
  94. package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
  95. package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -48
  96. package/build/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
  97. package/build/__tests__/behavioral/faking/WhoAmI.test.js +0 -105
  98. package/build/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
  99. package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -76
  100. package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
  101. package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -272
  102. package/build/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
  103. package/build/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -35
  104. package/build/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
  105. package/build/__tests__/behavioral/seeding/SeedingData.test.js +0 -271
  106. package/build/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
  107. package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -266
  108. package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
  109. package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -117
  110. package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
  111. package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -55
  112. package/build/__tests__/behavioral/views/Routing.test.d.ts +0 -36
  113. package/build/__tests__/behavioral/views/Routing.test.js +0 -177
  114. package/build/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
  115. package/build/__tests__/behavioral/views/TestingScope.test.js +0 -197
  116. package/build/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
  117. package/build/__tests__/behavioral/views/ViewPlugins.test.js +0 -83
  118. package/build/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
  119. package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -55
  120. package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
  121. package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -761
  122. package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
  123. package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -29
  124. package/build/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
  125. package/build/__tests__/support/AbstractFakeDecoratorTest.js +0 -27
  126. package/build/__tests__/support/EventFaker.d.ts +0 -5
  127. package/build/__tests__/support/EventFaker.js +0 -36
  128. package/build/__tests__/support/RandomViewPlugin.d.ts +0 -2
  129. package/build/__tests__/support/RandomViewPlugin.js +0 -5
  130. package/build/__tests__/support/RandomViewPlugin2.d.ts +0 -2
  131. package/build/__tests__/support/RandomViewPlugin2.js +0 -5
  132. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.d.ts +0 -5
  133. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.js +0 -9
  134. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
  135. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -33
  136. package/build/__tests__/testDirsAndFiles/one-good-store-skill/src/.spruce/settings.json +0 -6
  137. package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.d.ts +0 -6
  138. package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.js +0 -11
  139. package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.d.ts +0 -6
  140. package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.js +0 -11
  141. package/build/__tests__/testDirsAndFiles/skill/build/.spruce/views/views.js +0 -18
  142. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
  143. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -11
  144. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
  145. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -19
  146. package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
  147. package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -31
  148. package/build/__tests__/testDirsAndFiles/skill/package.json +0 -5
  149. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/settings.json +0 -6
  150. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.d.ts +0 -7
  151. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.js +0 -17
  152. package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
  153. package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -11
  154. package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
  155. package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -31
  156. package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
  157. package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -128
  158. package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
  159. package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -40
  160. package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
  161. package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -23
  162. package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
  163. package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -80
  164. package/build/esm/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
  165. package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +0 -148
  166. package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
  167. package/build/esm/__tests__/behavioral/FixtureFactory.test.js +0 -61
  168. package/build/esm/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
  169. package/build/esm/__tests__/behavioral/LocationFixture.test.js +0 -173
  170. package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
  171. package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -113
  172. package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
  173. package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -41
  174. package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
  175. package/build/esm/__tests__/behavioral/MercuryFixture.test.js +0 -223
  176. package/build/esm/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
  177. package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +0 -389
  178. package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
  179. package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -18
  180. package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
  181. package/build/esm/__tests__/behavioral/PersonFixture.test.js +0 -232
  182. package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
  183. package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -112
  184. package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
  185. package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -84
  186. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
  187. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -55
  188. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
  189. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -72
  190. package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
  191. package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -146
  192. package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
  193. package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -66
  194. package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
  195. package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -51
  196. package/build/esm/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
  197. package/build/esm/__tests__/behavioral/RoleFixture.test.js +0 -143
  198. package/build/esm/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
  199. package/build/esm/__tests__/behavioral/SkillFixture.test.js +0 -141
  200. package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
  201. package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -53
  202. package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
  203. package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -48
  204. package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
  205. package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -28
  206. package/build/esm/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
  207. package/build/esm/__tests__/behavioral/databases/DummyStore.js +0 -43
  208. package/build/esm/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
  209. package/build/esm/__tests__/behavioral/databases/StoreFixture.test.js +0 -164
  210. package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
  211. package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -89
  212. package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
  213. package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +0 -482
  214. package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
  215. package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -28
  216. package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
  217. package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -32
  218. package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
  219. package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -82
  220. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
  221. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -70
  222. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
  223. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -165
  224. package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
  225. package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -43
  226. package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
  227. package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -55
  228. package/build/esm/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
  229. package/build/esm/__tests__/behavioral/faking/FakingLocations.test.js +0 -55
  230. package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
  231. package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -175
  232. package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
  233. package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -214
  234. package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
  235. package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +0 -38
  236. package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
  237. package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -360
  238. package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
  239. package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -31
  240. package/build/esm/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
  241. package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +0 -142
  242. package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
  243. package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -94
  244. package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
  245. package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -324
  246. package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
  247. package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -43
  248. package/build/esm/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
  249. package/build/esm/__tests__/behavioral/seeding/SeedingData.test.js +0 -314
  250. package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
  251. package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -322
  252. package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
  253. package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -138
  254. package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
  255. package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -70
  256. package/build/esm/__tests__/behavioral/views/Routing.test.d.ts +0 -36
  257. package/build/esm/__tests__/behavioral/views/Routing.test.js +0 -212
  258. package/build/esm/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
  259. package/build/esm/__tests__/behavioral/views/TestingScope.test.js +0 -238
  260. package/build/esm/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
  261. package/build/esm/__tests__/behavioral/views/ViewPlugins.test.js +0 -103
  262. package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
  263. package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -64
  264. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
  265. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -856
  266. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
  267. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -39
  268. package/build/esm/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
  269. package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +0 -34
  270. package/build/esm/__tests__/support/EventFaker.d.ts +0 -5
  271. package/build/esm/__tests__/support/EventFaker.js +0 -45
  272. package/build/esm/__tests__/support/RandomViewPlugin.d.ts +0 -2
  273. package/build/esm/__tests__/support/RandomViewPlugin.js +0 -2
  274. package/build/esm/__tests__/support/RandomViewPlugin2.d.ts +0 -2
  275. package/build/esm/__tests__/support/RandomViewPlugin2.js +0 -2
  276. package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
  277. package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -41
  278. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
  279. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -9
  280. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
  281. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -28
  282. package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
  283. package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -26
  284. package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
  285. package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -9
  286. package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
  287. package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -26
  288. /package/build/{__tests__/support → esm/tests}/FakeThemeManager.d.ts +0 -0
  289. /package/build/esm/{__tests__/support → tests}/FakeThemeManager.js +0 -0
  290. /package/build/{esm/__tests__/support → tests}/FakeThemeManager.d.ts +0 -0
  291. /package/build/{__tests__/support → tests}/FakeThemeManager.js +0 -0
@@ -1,214 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- import { test, assert } from '@sprucelabs/test-utils';
17
- import { errorAssert, generateId } from '@sprucelabs/test-utils';
18
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
19
- import fake from '../../../tests/decorators/fake.js';
20
- let FakingSkillEventsTest = class FakingSkillEventsTest extends AbstractSpruceFixtureTest {
21
- static canSeedSkill() {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- const skill = yield this.seedDemoSkill();
24
- assert.isEqual(skill.creators[0].personId, this.fakedPerson.id);
25
- });
26
- }
27
- static skillsGenerateUniqueValues() {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- const skill1 = yield this.seedDemoSkill();
30
- const skill2 = yield this.seedDemoSkill();
31
- assert.isNotEqual(skill1.id, skill2.id);
32
- assert.isNotEqual(skill1.slug, skill2.slug);
33
- assert.isNotEqual(skill1.name, skill2.name);
34
- assert.isNotEqual(skill1.apiKey, skill2.apiKey);
35
- });
36
- }
37
- static canLoginAsCurrentSkillWithoutEnvSet() {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- yield this.skills.loginAsCurrentSkill();
40
- });
41
- }
42
- static doesNotMutateSkillEnvIfExists() {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- this.lastEnvSkillId = process.env.SKILL_ID = generateId();
45
- this.lastEnvApiKey = process.env.SKILL_API_KEY = generateId();
46
- });
47
- }
48
- static doesNotMutateSkillEnvIfExistsCheck() {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- assert.isEqual(this.lastEnvSkillId, process.env.SKILL_ID);
51
- assert.isEqual(this.lastEnvApiKey, process.env.SKILL_API_KEY);
52
- });
53
- }
54
- static seededSkillsAvailableLocally() {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- const skill1 = yield this.seedDemoSkill();
57
- assert.isEqualDeep(this.fakedSkills, [skill1]);
58
- const skill2 = yield this.seedDemoSkill();
59
- assert.isEqualDeep(this.fakedSkills, [skill2, skill1]);
60
- });
61
- }
62
- static authenticateThrowsWhenBadAuth() {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- const err = yield assert.doesThrowAsync(() => this.emitAuthenticateAsSkill('', ''));
65
- errorAssert.assertError(err, 'INVALID_AUTH_TOKEN');
66
- });
67
- }
68
- static authenticateThrowsWhenBadAuthId() {
69
- return __awaiter(this, void 0, void 0, function* () {
70
- const skill = yield this.seedDemoSkill();
71
- const err = yield assert.doesThrowAsync(() => this.emitAuthenticateAsSkill(skill.apiKey, generateId()));
72
- errorAssert.assertError(err, 'INVALID_AUTH_TOKEN');
73
- });
74
- }
75
- static canAuthenticateAsSkill() {
76
- return __awaiter(this, void 0, void 0, function* () {
77
- const skill = yield this.seedDemoSkill();
78
- const { type } = yield this.emitAuthenticateAsSkill(skill.apiKey, skill.id);
79
- assert.isEqual(type, 'authenticated');
80
- });
81
- }
82
- static returnsTheExpectedSkill() {
83
- return __awaiter(this, void 0, void 0, function* () {
84
- const skill1 = yield this.seedDemoSkill();
85
- const skill2 = yield this.seedDemoSkill();
86
- yield this.assertCanAuthAsSkill(skill1);
87
- yield this.assertCanAuthAsSkill(skill2);
88
- });
89
- }
90
- static skillSeedsWithPassedValues() {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- const skill1 = yield this.seedDemoSkill({
93
- name: 'taco',
94
- slug: 'bravo',
95
- });
96
- assert.isEqual(skill1.name, 'taco');
97
- assert.isEqual(skill1.slug, 'bravo');
98
- });
99
- }
100
- static whoAmIReturnsSkill() {
101
- return __awaiter(this, void 0, void 0, function* () {
102
- const { client, skill } = yield this.skills.loginAsDemoSkill({
103
- name: 'Testing login',
104
- });
105
- yield this.assertExpectedWhoAmIResults(client, skill);
106
- });
107
- }
108
- static whoAmIReturnsSkillExpectedSkill() {
109
- return __awaiter(this, void 0, void 0, function* () {
110
- const { client, skill } = yield this.skills.loginAsDemoSkill({
111
- name: 'Testing login',
112
- });
113
- yield this.seedDemoSkill();
114
- yield this.assertExpectedWhoAmIResults(client, skill);
115
- });
116
- }
117
- static returnsCurrentSkillIfEnvSet() {
118
- return __awaiter(this, void 0, void 0, function* () {
119
- const skillId = generateId();
120
- const apiKey = generateId();
121
- process.env.SKILL_ID = skillId;
122
- process.env.SKILL_API_KEY = apiKey;
123
- const client = yield this.mercury.connectToApi();
124
- const [{ type, auth }] = yield client.emitAndFlattenResponses('authenticate::v2020_12_25', {
125
- payload: {
126
- skillId,
127
- apiKey,
128
- },
129
- });
130
- const { skill } = auth;
131
- assert.isEqual(type, 'authenticated');
132
- assert.isEqual(skill === null || skill === void 0 ? void 0 : skill.id, skillId);
133
- assert.isEqual(skill === null || skill === void 0 ? void 0 : skill.apiKey, apiKey);
134
- });
135
- }
136
- static assertExpectedWhoAmIResults(client, skill) {
137
- return __awaiter(this, void 0, void 0, function* () {
138
- const [{ type, auth }] = yield client.emitAndFlattenResponses('whoami::v2020_12_25');
139
- assert.isEqual(type, 'authenticated');
140
- assert.isEqualDeep(auth.skill, skill);
141
- });
142
- }
143
- static seedDemoSkill(values) {
144
- return __awaiter(this, void 0, void 0, function* () {
145
- return yield this.skills.seedDemoSkill(values);
146
- });
147
- }
148
- static assertCanAuthAsSkill(skill1) {
149
- return __awaiter(this, void 0, void 0, function* () {
150
- const { auth } = yield this.emitAuthenticateAsSkill(skill1.apiKey, skill1.id);
151
- assert.isEqualDeep(auth.skill, skill1);
152
- });
153
- }
154
- static emitAuthenticateAsSkill(apiKey, skillId) {
155
- return __awaiter(this, void 0, void 0, function* () {
156
- const [{ auth, type }] = yield this.client.emitAndFlattenResponses('authenticate::v2020_12_25', {
157
- payload: {
158
- apiKey,
159
- skillId,
160
- },
161
- });
162
- return { auth, type };
163
- });
164
- }
165
- static get client() {
166
- return fake.getClient();
167
- }
168
- };
169
- __decorate([
170
- test()
171
- ], FakingSkillEventsTest, "canSeedSkill", null);
172
- __decorate([
173
- test()
174
- ], FakingSkillEventsTest, "skillsGenerateUniqueValues", null);
175
- __decorate([
176
- test()
177
- ], FakingSkillEventsTest, "canLoginAsCurrentSkillWithoutEnvSet", null);
178
- __decorate([
179
- test()
180
- ], FakingSkillEventsTest, "doesNotMutateSkillEnvIfExists", null);
181
- __decorate([
182
- test()
183
- ], FakingSkillEventsTest, "doesNotMutateSkillEnvIfExistsCheck", null);
184
- __decorate([
185
- test()
186
- ], FakingSkillEventsTest, "seededSkillsAvailableLocally", null);
187
- __decorate([
188
- test()
189
- ], FakingSkillEventsTest, "authenticateThrowsWhenBadAuth", null);
190
- __decorate([
191
- test()
192
- ], FakingSkillEventsTest, "authenticateThrowsWhenBadAuthId", null);
193
- __decorate([
194
- test()
195
- ], FakingSkillEventsTest, "canAuthenticateAsSkill", null);
196
- __decorate([
197
- test()
198
- ], FakingSkillEventsTest, "returnsTheExpectedSkill", null);
199
- __decorate([
200
- test()
201
- ], FakingSkillEventsTest, "skillSeedsWithPassedValues", null);
202
- __decorate([
203
- test()
204
- ], FakingSkillEventsTest, "whoAmIReturnsSkill", null);
205
- __decorate([
206
- test()
207
- ], FakingSkillEventsTest, "whoAmIReturnsSkillExpectedSkill", null);
208
- __decorate([
209
- test()
210
- ], FakingSkillEventsTest, "returnsCurrentSkillIfEnvSet", null);
211
- FakingSkillEventsTest = __decorate([
212
- fake.login()
213
- ], FakingSkillEventsTest);
214
- export default FakingSkillEventsTest;
@@ -1,4 +0,0 @@
1
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
2
- export default class UpdatePersonTest extends AbstractSpruceFixtureTest {
3
- protected static badUpdateThrowsBadTarget(): Promise<void>;
4
- }
@@ -1,38 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- import { test, assert } from '@sprucelabs/test-utils';
17
- import { errorAssert, generateId } from '@sprucelabs/test-utils';
18
- import { fake } from '../../../index.js';
19
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
20
- let UpdatePersonTest = class UpdatePersonTest extends AbstractSpruceFixtureTest {
21
- static badUpdateThrowsBadTarget() {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- const err = yield assert.doesThrowAsync(() => this.fakedClient.emitAndFlattenResponses('update-person::v2020_12_25', {
24
- target: {
25
- personId: generateId(),
26
- },
27
- }));
28
- errorAssert.assertError(err, 'INVALID_TARGET');
29
- });
30
- }
31
- };
32
- __decorate([
33
- test()
34
- ], UpdatePersonTest, "badUpdateThrowsBadTarget", null);
35
- UpdatePersonTest = __decorate([
36
- fake.login()
37
- ], UpdatePersonTest);
38
- export default UpdatePersonTest;
@@ -1,35 +0,0 @@
1
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
2
- import { CoreSeedTarget } from '../../../tests/decorators/seed';
3
- export default class UsingFakeDecoratorsTest extends AbstractSpruceFixtureTest {
4
- private static wasBeforeAllInvoked;
5
- private static wasBeforeEachInvoked;
6
- private static client;
7
- protected static beforeAll(): Promise<void>;
8
- protected static beforeEach(): Promise<void>;
9
- protected static resetsFakedOwners(): Promise<void>;
10
- protected static canGetClient(): Promise<void>;
11
- protected static skillCallsHooks(): Promise<void>;
12
- protected static canSeedOrganization(): Promise<void>;
13
- protected static seedingLocationSeedsToExpectedOrg(orgIdx: number): Promise<void>;
14
- protected static canSeedAndListLocations(orgIdx: number): Promise<void>;
15
- protected static canSeedTeammates(target: CoreSeedTarget): Promise<void>;
16
- protected static canSeedOwners(): Promise<void>;
17
- protected static whoAmIReturnsExpectedPerson(): Promise<void>;
18
- protected static canSkillBeAnonLogin(): Promise<void>;
19
- protected static canListTeammatesByLocation(): Promise<void>;
20
- protected static setsFakedOwners(): Promise<void>;
21
- protected static someThingsThrowWhenNotFaked(): void;
22
- protected static deletingOrgAndLocationDoesNotCrash(): Promise<void>;
23
- protected static canBeUsedWithSeedDecorator(): void;
24
- protected static canGetLocationById(idx: number): Promise<void>;
25
- protected static throwsAsExpectedWithBadLocation(): Promise<void>;
26
- protected static canFilterByManyRolesAtOnceWhenListingPeople(): Promise<void>;
27
- protected static listingPeopleThrowsWhenDoingSomethingNotSupported(payload: any): Promise<void>;
28
- protected static throwingInRequestPinDoesNotCrashNextTest(): Promise<void>;
29
- protected static thisTestShouldNotCrashBecauseTestBeforeIt(): Promise<void>;
30
- protected static emitGetLocationEvent(locationId: string): Promise<Pick<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types").SpruceSchemas.Spruce.v2020_07_22.LocationSchema, false, import("@sprucelabs/schema").SchemaOptionalFieldNames<import("@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types").SpruceSchemas.Spruce.v2020_07_22.LocationSchema>, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types").SpruceSchemas.Spruce.v2020_07_22.LocationSchema, false>>, "id" | "address" | "phone" | "name" | "organizationId" | "timezone" | "dateCreated" | "dateDeleted" | "isPublic" | "slug" | "num">>;
31
- protected static shouldBeAbleToOffListenersAndNotBreakEverything(): Promise<void>;
32
- protected static thisWhoAmIShouldStillWork(): Promise<void>;
33
- private static emitWhoAmI;
34
- private static assertFakedPeople;
35
- }
@@ -1,360 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- import { formatPhoneNumber } from '@sprucelabs/schema';
17
- import { test, assert } from '@sprucelabs/test-utils';
18
- import { errorAssert, generateId } from '@sprucelabs/test-utils';
19
- import { seed, StoreFixture } from '../../../index.js';
20
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
21
- import fake, { fakeTargetToPropName, pluralToSingular, } from '../../../tests/decorators/fake.js';
22
- import eventFaker from '../../../tests/eventFaker.js';
23
- import MercuryFixture from '../../../tests/fixtures/MercuryFixture.js';
24
- // eslint-disable-next-line spruce/prohibit-import-from-build-folder
25
- import GoodStore from '../../testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js';
26
- import { DummyStore } from '../databases/DummyStore.js';
27
- let UsingFakeDecoratorsTest = class UsingFakeDecoratorsTest extends AbstractSpruceFixtureTest {
28
- static beforeAll() {
29
- const _super = Object.create(null, {
30
- beforeAll: { get: () => super.beforeAll }
31
- });
32
- return __awaiter(this, void 0, void 0, function* () {
33
- yield _super.beforeAll.call(this);
34
- this.wasBeforeAllInvoked = true;
35
- });
36
- }
37
- static beforeEach() {
38
- const _super = Object.create(null, {
39
- beforeEach: { get: () => super.beforeEach }
40
- });
41
- return __awaiter(this, void 0, void 0, function* () {
42
- yield _super.beforeEach.call(this);
43
- this.wasBeforeEachInvoked = true;
44
- this.client = yield this.mercury.connectToApi();
45
- yield this.client.emitAndFlattenResponses('whoami::v2020_12_25');
46
- });
47
- }
48
- static resetsFakedOwners() {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- assert.isEqualDeep(this.fakedOwners, []);
51
- });
52
- }
53
- static canGetClient() {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- assert.isEqual(MercuryFixture.getDefaultClient(), fake.getClient());
56
- assert.isEqual(this.fakedPerson, fake.getPerson());
57
- });
58
- }
59
- static skillCallsHooks() {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- assert.isTrue(this.wasBeforeAllInvoked);
62
- assert.isTrue(this.wasBeforeEachInvoked);
63
- });
64
- }
65
- static canSeedOrganization() {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- const org = yield this.organizations.seedDemoOrganization({
68
- name: 'Test org',
69
- });
70
- assert.isEqual(org.name, 'Test org');
71
- });
72
- }
73
- static seedingLocationSeedsToExpectedOrg(orgIdx) {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- const id = this.fakedOrganizations[orgIdx].id;
76
- const location = yield this.locations.seedDemoLocation({
77
- name: 'Test location',
78
- organizationId: id,
79
- });
80
- assert.isEqual(id, location.organizationId);
81
- });
82
- }
83
- static canSeedAndListLocations(orgIdx) {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- const id = this.fakedOrganizations[orgIdx].id;
86
- const [{ locations }] = yield this.client.emitAndFlattenResponses('list-locations::v2020_12_25', {
87
- target: {
88
- organizationId: id,
89
- },
90
- });
91
- const expected = this.fakedLocations.filter((l) => l.organizationId === id);
92
- assert.isEqualDeep(locations, expected);
93
- });
94
- }
95
- static canSeedTeammates(target) {
96
- return __awaiter(this, void 0, void 0, function* () {
97
- let total = 3;
98
- const { people, fakedRecords } = yield this.assertFakedPeople(target, total);
99
- assert.doesNotInclude(people, this.fakedPerson);
100
- assert.isEqualDeep(people, fakedRecords);
101
- });
102
- }
103
- static canSeedOwners() {
104
- return __awaiter(this, void 0, void 0, function* () {
105
- yield this.assertFakedPeople('owners', 4);
106
- });
107
- }
108
- static whoAmIReturnsExpectedPerson() {
109
- return __awaiter(this, void 0, void 0, function* () {
110
- const phone = formatPhoneNumber('555-111-1111');
111
- const { person, client } = yield this.people.loginAsDemoPerson(phone);
112
- assert.isEqual(person.phone, phone);
113
- const [{ auth }] = yield client.emitAndFlattenResponses('whoami::v2020_12_25');
114
- assert.isEqualDeep(auth.person, person);
115
- });
116
- }
117
- static canSkillBeAnonLogin() {
118
- return __awaiter(this, void 0, void 0, function* () {
119
- const client = yield this.mercury.connectToApi({
120
- shouldReUseClient: false,
121
- });
122
- const [{ type }] = yield client.emitAndFlattenResponses('whoami::v2020_12_25');
123
- assert.isEqualDeep(type, 'anonymous');
124
- });
125
- }
126
- static canListTeammatesByLocation() {
127
- return __awaiter(this, void 0, void 0, function* () {
128
- const [{ people }] = yield this.client.emitAndFlattenResponses('list-people::v2020_12_25', {
129
- target: {
130
- organizationId: this.fakedLocations[0].organizationId,
131
- locationId: this.fakedLocations[0].id,
132
- },
133
- });
134
- assert.isLength(people, 5);
135
- });
136
- }
137
- static setsFakedOwners() {
138
- return __awaiter(this, void 0, void 0, function* () {
139
- assert.isEqual(this.fakedPerson, this.fakedOwners[0]);
140
- });
141
- }
142
- static someThingsThrowWhenNotFaked() {
143
- assert.doesThrow(() => this.fakedLocations);
144
- }
145
- static deletingOrgAndLocationDoesNotCrash() {
146
- return __awaiter(this, void 0, void 0, function* () {
147
- yield this.client.emit('delete-organization::v2020_12_25', {
148
- target: {
149
- organizationId: '1234',
150
- },
151
- });
152
- });
153
- }
154
- static canBeUsedWithSeedDecorator() { }
155
- static canGetLocationById(idx) {
156
- return __awaiter(this, void 0, void 0, function* () {
157
- const location = yield this.emitGetLocationEvent(this.fakedLocations[idx].id);
158
- assert.isEqualDeep(location, this.fakedLocations[idx]);
159
- });
160
- }
161
- static throwsAsExpectedWithBadLocation() {
162
- return __awaiter(this, void 0, void 0, function* () {
163
- const err = yield assert.doesThrowAsync(() => this.emitGetLocationEvent(generateId()));
164
- errorAssert.assertError(err, 'INVALID_TARGET');
165
- });
166
- }
167
- static canFilterByManyRolesAtOnceWhenListingPeople() {
168
- return __awaiter(this, void 0, void 0, function* () {
169
- const [{ people }] = yield this.client.emitAndFlattenResponses('list-people::v2020_12_25', {
170
- payload: {
171
- roleBases: ['teammate', 'manager'],
172
- },
173
- });
174
- assert.isLength(people, 2);
175
- });
176
- }
177
- static listingPeopleThrowsWhenDoingSomethingNotSupported(payload) {
178
- return __awaiter(this, void 0, void 0, function* () {
179
- yield assert.doesThrowAsync(() => this.client.emitAndFlattenResponses('list-people::v2020_12_25', {
180
- payload,
181
- }));
182
- });
183
- }
184
- static throwingInRequestPinDoesNotCrashNextTest() {
185
- return __awaiter(this, void 0, void 0, function* () {
186
- yield eventFaker.makeEventThrow('request-pin::v2020_12_25');
187
- });
188
- }
189
- static thisTestShouldNotCrashBecauseTestBeforeIt() {
190
- return __awaiter(this, void 0, void 0, function* () { });
191
- }
192
- static emitGetLocationEvent(locationId) {
193
- return __awaiter(this, void 0, void 0, function* () {
194
- const [{ location }] = yield this.client.emitAndFlattenResponses('get-location::v2020_12_25', {
195
- target: {
196
- locationId,
197
- },
198
- });
199
- return location;
200
- });
201
- }
202
- static shouldBeAbleToOffListenersAndNotBreakEverything() {
203
- return __awaiter(this, void 0, void 0, function* () {
204
- yield this.client.off('whoami::v2020_12_25');
205
- yield this.client.on('whoami::v2020_12_25', () => {
206
- return {
207
- auth: {},
208
- type: 'authenticated',
209
- };
210
- });
211
- const results = yield this.emitWhoAmI();
212
- assert.isLength(results, 1);
213
- });
214
- }
215
- static thisWhoAmIShouldStillWork() {
216
- return __awaiter(this, void 0, void 0, function* () {
217
- const [{ auth }] = yield this.emitWhoAmI();
218
- const { client } = yield this.views.loginAsDemoPerson();
219
- assert.isEqualDeep(DummyStore.lastFakedOwner, auth.person);
220
- //@ts-ignore
221
- assert.isEqualDeep(auth.person, client.auth.person);
222
- assert.isEqualDeep(auth.person, this.fakedPerson);
223
- });
224
- }
225
- static emitWhoAmI() {
226
- return __awaiter(this, void 0, void 0, function* () {
227
- return this.client.emitAndFlattenResponses('whoami::v2020_12_25');
228
- });
229
- }
230
- static assertFakedPeople(target, total) {
231
- return __awaiter(this, void 0, void 0, function* () {
232
- //@ts-ignore
233
- const fakedRecords = this[`${fakeTargetToPropName(target)}`];
234
- assert.isLength(fakedRecords, total);
235
- const people = yield this.people.listPeople({
236
- locationId: this.fakedLocations[0].id,
237
- roleBases: [pluralToSingular(target)],
238
- organizationId: this.fakedLocations[0].organizationId,
239
- });
240
- assert.isLength(people, total);
241
- assert.isTruthy(fakedRecords[0].firstName);
242
- assert.isNotEqual(fakedRecords[0].casualName, 'friend');
243
- return { people, fakedRecords };
244
- });
245
- }
246
- };
247
- UsingFakeDecoratorsTest.wasBeforeAllInvoked = false;
248
- UsingFakeDecoratorsTest.wasBeforeEachInvoked = false;
249
- __decorate([
250
- seed('dummies', 1)
251
- ], UsingFakeDecoratorsTest, "beforeEach", null);
252
- __decorate([
253
- test()
254
- ], UsingFakeDecoratorsTest, "resetsFakedOwners", null);
255
- __decorate([
256
- test()
257
- ], UsingFakeDecoratorsTest, "canGetClient", null);
258
- __decorate([
259
- test()
260
- ], UsingFakeDecoratorsTest, "skillCallsHooks", null);
261
- __decorate([
262
- test()
263
- ], UsingFakeDecoratorsTest, "canSeedOrganization", null);
264
- __decorate([
265
- test('can seed location to org 1', 0),
266
- test('can seed location to org 2', 1),
267
- seed('organizations', 2)
268
- ], UsingFakeDecoratorsTest, "seedingLocationSeedsToExpectedOrg", null);
269
- __decorate([
270
- test('list locations by org 1', 0),
271
- test('list locations by org 0', 1),
272
- seed('organizations', 1),
273
- seed('locations', 2),
274
- seed('organizations', 1),
275
- seed('locations', 2)
276
- ], UsingFakeDecoratorsTest, "canSeedAndListLocations", null);
277
- __decorate([
278
- test('can seed teammates', 'teammates'),
279
- test('can seed managers', 'managers'),
280
- test('can seed guests', 'guests'),
281
- test('can seed groupManagers', 'groupManagers'),
282
- seed('locations', 1),
283
- seed('teammates', 3),
284
- seed('managers', 3),
285
- seed('guests', 3),
286
- seed('groupManagers', 3)
287
- ], UsingFakeDecoratorsTest, "canSeedTeammates", null);
288
- __decorate([
289
- test(),
290
- seed('locations', 1),
291
- seed('owners', 3)
292
- ], UsingFakeDecoratorsTest, "canSeedOwners", null);
293
- __decorate([
294
- test(),
295
- seed('locations', 1)
296
- ], UsingFakeDecoratorsTest, "whoAmIReturnsExpectedPerson", null);
297
- __decorate([
298
- test()
299
- ], UsingFakeDecoratorsTest, "canSkillBeAnonLogin", null);
300
- __decorate([
301
- test(),
302
- seed('locations', 1),
303
- seed('teammates', 4)
304
- ], UsingFakeDecoratorsTest, "canListTeammatesByLocation", null);
305
- __decorate([
306
- test(),
307
- seed('locations', 1)
308
- ], UsingFakeDecoratorsTest, "setsFakedOwners", null);
309
- __decorate([
310
- test()
311
- ], UsingFakeDecoratorsTest, "someThingsThrowWhenNotFaked", null);
312
- __decorate([
313
- test()
314
- ], UsingFakeDecoratorsTest, "deletingOrgAndLocationDoesNotCrash", null);
315
- __decorate([
316
- test(),
317
- seed('good')
318
- ], UsingFakeDecoratorsTest, "canBeUsedWithSeedDecorator", null);
319
- __decorate([
320
- test('can get location by id 1', 0),
321
- test('can get location by id 2', 1),
322
- seed('locations', 3)
323
- ], UsingFakeDecoratorsTest, "canGetLocationById", null);
324
- __decorate([
325
- test()
326
- ], UsingFakeDecoratorsTest, "throwsAsExpectedWithBadLocation", null);
327
- __decorate([
328
- test(),
329
- seed('locations', 1),
330
- seed('teammates', 1),
331
- seed('managers', 1)
332
- ], UsingFakeDecoratorsTest, "canFilterByManyRolesAtOnceWhenListingPeople", null);
333
- __decorate([
334
- test('listing by people by role id throws', { roleIds: [] }),
335
- test('listing by people by person id throws', { personIds: [] })
336
- ], UsingFakeDecoratorsTest, "listingPeopleThrowsWhenDoingSomethingNotSupported", null);
337
- __decorate([
338
- test()
339
- ], UsingFakeDecoratorsTest, "throwingInRequestPinDoesNotCrashNextTest", null);
340
- __decorate([
341
- test()
342
- ], UsingFakeDecoratorsTest, "thisTestShouldNotCrashBecauseTestBeforeIt", null);
343
- __decorate([
344
- test()
345
- ], UsingFakeDecoratorsTest, "shouldBeAbleToOffListenersAndNotBreakEverything", null);
346
- __decorate([
347
- test()
348
- ], UsingFakeDecoratorsTest, "thisWhoAmIShouldStillWork", null);
349
- UsingFakeDecoratorsTest = __decorate([
350
- fake.login('555-000-0001')
351
- ], UsingFakeDecoratorsTest);
352
- export default UsingFakeDecoratorsTest;
353
- DummyStore.seedCb = () => __awaiter(void 0, void 0, void 0, function* () {
354
- var _a, _b;
355
- fake.getPerson();
356
- //@ts-ignore
357
- DummyStore.lastFakedOwner = (_b = (_a = MercuryFixture.getDefaultClient()) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.person;
358
- });
359
- StoreFixture.setStore('good', GoodStore);
360
- StoreFixture.setStore('dummies', DummyStore);
@@ -1,4 +0,0 @@
1
- import AbstractSpruceTest from '@sprucelabs/test-utils';
2
- export default class UsingFakesOnIncompatibleClassTest extends AbstractSpruceTest {
3
- protected static shouldNotCrash(): Promise<void>;
4
- }