@sprucelabs/spruce-test-fixtures 62.2.24 → 62.2.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (281) hide show
  1. package/package.json +19 -19
  2. package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
  3. package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -112
  4. package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
  5. package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -34
  6. package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
  7. package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -26
  8. package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
  9. package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -69
  10. package/build/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
  11. package/build/__tests__/behavioral/FakingEventResponses.test.js +0 -126
  12. package/build/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
  13. package/build/__tests__/behavioral/FixtureFactory.test.js +0 -79
  14. package/build/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
  15. package/build/__tests__/behavioral/LocationFixture.test.js +0 -144
  16. package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
  17. package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -95
  18. package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
  19. package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -35
  20. package/build/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
  21. package/build/__tests__/behavioral/MercuryFixture.test.js +0 -187
  22. package/build/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
  23. package/build/__tests__/behavioral/OrganizationFixture.test.js +0 -333
  24. package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
  25. package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -21
  26. package/build/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
  27. package/build/__tests__/behavioral/PersonFixture.test.js +0 -225
  28. package/build/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
  29. package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -95
  30. package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
  31. package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -67
  32. package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
  33. package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -44
  34. package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
  35. package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -55
  36. package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
  37. package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -137
  38. package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
  39. package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -54
  40. package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
  41. package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -40
  42. package/build/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
  43. package/build/__tests__/behavioral/RoleFixture.test.js +0 -118
  44. package/build/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
  45. package/build/__tests__/behavioral/SkillFixture.test.js +0 -118
  46. package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
  47. package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -41
  48. package/build/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
  49. package/build/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -59
  50. package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
  51. package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -34
  52. package/build/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
  53. package/build/__tests__/behavioral/databases/DummyStore.js +0 -36
  54. package/build/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
  55. package/build/__tests__/behavioral/databases/StoreFixture.test.js +0 -156
  56. package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
  57. package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -73
  58. package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
  59. package/build/__tests__/behavioral/faking/FakeDecorator.test.js +0 -421
  60. package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
  61. package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -23
  62. package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
  63. package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -27
  64. package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
  65. package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -93
  66. package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
  67. package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -56
  68. package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
  69. package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -141
  70. package/build/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
  71. package/build/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -35
  72. package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
  73. package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -42
  74. package/build/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
  75. package/build/__tests__/behavioral/faking/FakingLocations.test.js +0 -45
  76. package/build/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
  77. package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -140
  78. package/build/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
  79. package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -174
  80. package/build/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
  81. package/build/__tests__/behavioral/faking/UpdatePerson.test.js +0 -32
  82. package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
  83. package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -321
  84. package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
  85. package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -48
  86. package/build/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
  87. package/build/__tests__/behavioral/faking/WhoAmI.test.js +0 -105
  88. package/build/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
  89. package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -76
  90. package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
  91. package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -272
  92. package/build/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
  93. package/build/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -35
  94. package/build/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
  95. package/build/__tests__/behavioral/seeding/SeedingData.test.js +0 -271
  96. package/build/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
  97. package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -266
  98. package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
  99. package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -117
  100. package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
  101. package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -55
  102. package/build/__tests__/behavioral/views/Routing.test.d.ts +0 -36
  103. package/build/__tests__/behavioral/views/Routing.test.js +0 -177
  104. package/build/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
  105. package/build/__tests__/behavioral/views/TestingScope.test.js +0 -197
  106. package/build/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
  107. package/build/__tests__/behavioral/views/ViewPlugins.test.js +0 -83
  108. package/build/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
  109. package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -55
  110. package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
  111. package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -761
  112. package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
  113. package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -29
  114. package/build/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
  115. package/build/__tests__/support/AbstractFakeDecoratorTest.js +0 -27
  116. package/build/__tests__/support/EventFaker.d.ts +0 -5
  117. package/build/__tests__/support/EventFaker.js +0 -36
  118. package/build/__tests__/support/FakeThemeManager.d.ts +0 -8
  119. package/build/__tests__/support/FakeThemeManager.js +0 -40
  120. package/build/__tests__/support/RandomViewPlugin.d.ts +0 -2
  121. package/build/__tests__/support/RandomViewPlugin.js +0 -5
  122. package/build/__tests__/support/RandomViewPlugin2.d.ts +0 -2
  123. package/build/__tests__/support/RandomViewPlugin2.js +0 -5
  124. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.d.ts +0 -5
  125. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.js +0 -9
  126. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
  127. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -33
  128. package/build/__tests__/testDirsAndFiles/one-good-store-skill/src/.spruce/settings.json +0 -6
  129. package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.d.ts +0 -6
  130. package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.js +0 -11
  131. package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.d.ts +0 -6
  132. package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.js +0 -11
  133. package/build/__tests__/testDirsAndFiles/skill/build/.spruce/views/views.js +0 -18
  134. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
  135. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -11
  136. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
  137. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -19
  138. package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
  139. package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -31
  140. package/build/__tests__/testDirsAndFiles/skill/package.json +0 -5
  141. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/settings.json +0 -6
  142. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.d.ts +0 -7
  143. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.js +0 -17
  144. package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
  145. package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -11
  146. package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
  147. package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -31
  148. package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
  149. package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -128
  150. package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
  151. package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -40
  152. package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
  153. package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -23
  154. package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
  155. package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -80
  156. package/build/esm/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
  157. package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +0 -148
  158. package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
  159. package/build/esm/__tests__/behavioral/FixtureFactory.test.js +0 -61
  160. package/build/esm/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
  161. package/build/esm/__tests__/behavioral/LocationFixture.test.js +0 -173
  162. package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
  163. package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -113
  164. package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
  165. package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -41
  166. package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
  167. package/build/esm/__tests__/behavioral/MercuryFixture.test.js +0 -223
  168. package/build/esm/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
  169. package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +0 -389
  170. package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
  171. package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -18
  172. package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
  173. package/build/esm/__tests__/behavioral/PersonFixture.test.js +0 -232
  174. package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
  175. package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -112
  176. package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
  177. package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -84
  178. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
  179. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -55
  180. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
  181. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -72
  182. package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
  183. package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -146
  184. package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
  185. package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -66
  186. package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
  187. package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -51
  188. package/build/esm/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
  189. package/build/esm/__tests__/behavioral/RoleFixture.test.js +0 -143
  190. package/build/esm/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
  191. package/build/esm/__tests__/behavioral/SkillFixture.test.js +0 -141
  192. package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
  193. package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -53
  194. package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
  195. package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -48
  196. package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
  197. package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -28
  198. package/build/esm/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
  199. package/build/esm/__tests__/behavioral/databases/DummyStore.js +0 -43
  200. package/build/esm/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
  201. package/build/esm/__tests__/behavioral/databases/StoreFixture.test.js +0 -164
  202. package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
  203. package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -89
  204. package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
  205. package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +0 -482
  206. package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
  207. package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -28
  208. package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
  209. package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -32
  210. package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
  211. package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -82
  212. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
  213. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -70
  214. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
  215. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -165
  216. package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
  217. package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -43
  218. package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
  219. package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -55
  220. package/build/esm/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
  221. package/build/esm/__tests__/behavioral/faking/FakingLocations.test.js +0 -55
  222. package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
  223. package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -175
  224. package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
  225. package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -214
  226. package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
  227. package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +0 -38
  228. package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
  229. package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -360
  230. package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
  231. package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -31
  232. package/build/esm/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
  233. package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +0 -142
  234. package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
  235. package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -94
  236. package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
  237. package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -324
  238. package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
  239. package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -43
  240. package/build/esm/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
  241. package/build/esm/__tests__/behavioral/seeding/SeedingData.test.js +0 -314
  242. package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
  243. package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -322
  244. package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
  245. package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -138
  246. package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
  247. package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -70
  248. package/build/esm/__tests__/behavioral/views/Routing.test.d.ts +0 -36
  249. package/build/esm/__tests__/behavioral/views/Routing.test.js +0 -212
  250. package/build/esm/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
  251. package/build/esm/__tests__/behavioral/views/TestingScope.test.js +0 -238
  252. package/build/esm/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
  253. package/build/esm/__tests__/behavioral/views/ViewPlugins.test.js +0 -103
  254. package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
  255. package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -64
  256. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
  257. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -856
  258. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
  259. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -39
  260. package/build/esm/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
  261. package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +0 -34
  262. package/build/esm/__tests__/support/EventFaker.d.ts +0 -5
  263. package/build/esm/__tests__/support/EventFaker.js +0 -45
  264. package/build/esm/__tests__/support/FakeThemeManager.d.ts +0 -8
  265. package/build/esm/__tests__/support/FakeThemeManager.js +0 -37
  266. package/build/esm/__tests__/support/RandomViewPlugin.d.ts +0 -2
  267. package/build/esm/__tests__/support/RandomViewPlugin.js +0 -2
  268. package/build/esm/__tests__/support/RandomViewPlugin2.d.ts +0 -2
  269. package/build/esm/__tests__/support/RandomViewPlugin2.js +0 -2
  270. package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
  271. package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -41
  272. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
  273. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -9
  274. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
  275. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -28
  276. package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
  277. package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -26
  278. package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
  279. package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -9
  280. package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
  281. package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -26
@@ -1,333 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- 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;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const crypto_1 = require("crypto");
13
- const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
14
- const spruce_event_utils_2 = require("@sprucelabs/spruce-event-utils");
15
- const test_utils_1 = require("@sprucelabs/test-utils");
16
- const test_utils_2 = require("@sprucelabs/test-utils");
17
- const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
18
- const constants_1 = require("../../tests/constants");
19
- const fake_1 = __importDefault(require("../../tests/decorators/fake"));
20
- let OrganizationFixtureTest = class OrganizationFixtureTest extends AbstractSpruceFixtureTest_1.default {
21
- static async canCreateOrganizationFixture() {
22
- test_utils_1.assert.isTruthy(this.organizations);
23
- }
24
- static async canSeedOrg() {
25
- const org = await this.organizations.seedDemoOrganization({
26
- name: 'my org',
27
- });
28
- test_utils_1.assert.isTruthy(org);
29
- test_utils_1.assert.isEqual(org.name, 'my org');
30
- }
31
- static async orgFixtureDestroysOrgs() {
32
- const org = await this.Org();
33
- await this.organizations.destroy();
34
- await this.organizations.destroy();
35
- const client = await this.mercury.connectToApi();
36
- const results = await client.emit('get-organization::v2020_12_25', {
37
- target: {
38
- organizationId: org.id,
39
- },
40
- });
41
- spruce_event_utils_1.eventAssertUtil.assertErrorFromResponse(results, 'INVALID_TARGET');
42
- }
43
- static async isNotPartOfOrgtoStart() {
44
- const org = await this.Org();
45
- const { person } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER_HIRING);
46
- const isHired = await this.organizations.isPartOfOrg({
47
- personId: person.id,
48
- organizationId: org.id,
49
- phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
50
- });
51
- test_utils_1.assert.isFalse(isHired);
52
- }
53
- static async updatingBadOrgTHrows() {
54
- await test_utils_1.assert.doesThrowAsync(() => this.organizations.updateOrganization('aoeu', {}));
55
- }
56
- static async canUpdateOrg() {
57
- const org = await this.organizations.seedDemoOrganization({
58
- name: 'my org',
59
- phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
60
- });
61
- const name = (0, test_utils_2.generateId)();
62
- await this.organizations.updateOrganization(org.id, {
63
- name,
64
- phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
65
- });
66
- const updated = await this.organizations.getOrganizationById(org.id);
67
- test_utils_1.assert.isEqual(updated.name, name);
68
- }
69
- static async canUpdateOrgAddress() {
70
- const org = await this.organizations.seedDemoOrganization({
71
- name: 'my org',
72
- phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
73
- });
74
- let address = {
75
- city: (0, test_utils_2.generateId)(),
76
- country: (0, test_utils_2.generateId)(),
77
- province: (0, test_utils_2.generateId)(),
78
- street1: (0, test_utils_2.generateId)(),
79
- zip: (0, crypto_1.randomInt)(44444).toString(),
80
- };
81
- await this.organizations.updateOrganization(org.id, {
82
- address,
83
- phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
84
- });
85
- const updated = await this.organizations.getOrganizationById(org.id);
86
- test_utils_1.assert.isEqualDeep(updated.address, address);
87
- }
88
- static async canMakeOrgPublicAndPrivate() {
89
- const org = await this.organizations.seedDemoOrganization({
90
- name: 'my org',
91
- phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
92
- });
93
- await this.assertOrgIsPublicValue(org.id, false);
94
- await this.setAndAssertOrgIsPublic(org.id, true);
95
- await this.setAndAssertOrgIsPublic(org.id, false);
96
- }
97
- static async canAddPersonToOrg(base) {
98
- const { person, org } = await this.seedOrgAndHirePerson(base);
99
- const isHired = await this.isPersonPartOfOrg(person.id, org.id);
100
- test_utils_1.assert.isTrue(isHired);
101
- const roles = await this.roles.listRoles({
102
- organizationId: org.id,
103
- personId: person.id,
104
- phone: constants_1.DEMO_NUMBER_HIRING,
105
- });
106
- test_utils_1.assert.isLength(roles, 1);
107
- test_utils_1.assert.isEqual(roles[0].base, base);
108
- }
109
- static async isPersonPartOfOrg(personId, orgId) {
110
- return await this.organizations.isPartOfOrg({
111
- personId,
112
- organizationId: orgId,
113
- });
114
- }
115
- static async isNotInstalledByDefault() {
116
- const { skill, org } = await this.seedOrgAndSkill();
117
- const isInstalled = await this.organizations.isSkillInstalled(skill.id, org.id);
118
- test_utils_1.assert.isFalse(isInstalled);
119
- }
120
- static async showsAsInstalled() {
121
- const { skill, org } = await this.seedOrgAndSkill();
122
- await this.organizations.installSkill(skill.id, org.id);
123
- await this.assertSkillIsInstalled(skill.id, org.id);
124
- }
125
- static async cantInstallWithBadSkill() {
126
- const { org } = await this.seedOrgAndSkill();
127
- const err = await test_utils_1.assert.doesThrowAsync(() => this.organizations.installSkillsByNamespace({
128
- organizationId: org.id,
129
- namespaces: ['aoeuaoeu'],
130
- }));
131
- test_utils_2.errorAssert.assertError(err, 'INVALID_NAMESPACES', {
132
- namespaces: ['aoeuaoeu'],
133
- });
134
- }
135
- static async canInstallWithSlug() {
136
- const { skill, org } = await this.seedOrgAndSkill();
137
- await this.organizations.installSkillsByNamespace({
138
- organizationId: org.id,
139
- namespaces: [skill.slug],
140
- });
141
- await this.assertSkillIsInstalled(skill.id, org.id);
142
- }
143
- static async canInstallSkillFromAnotherPerson() {
144
- const { skill, org } = await this.seedOrgAndSkill();
145
- const skill2 = await this.skills.seedDemoSkill({
146
- name: 'testing testy 2',
147
- creatorPhone: constants_1.DEMO_NUMBER_INSTALLING_SKILLS,
148
- });
149
- await this.organizations.installSkillsByNamespace({
150
- organizationId: org.id,
151
- namespaces: [skill.slug, skill2.slug],
152
- });
153
- await this.assertSkillIsInstalled(skill.id, org.id);
154
- await this.assertSkillIsInstalled(skill2.id, org.id);
155
- }
156
- static async canDeleteAllExistingOrgs() {
157
- const firstFixture = this.Fixture('organization');
158
- await firstFixture.seedDemoOrganization({
159
- name: 'org 1',
160
- phone: constants_1.DEMO_NUMBER_INSTALLING_SKILLS,
161
- });
162
- await firstFixture.seedDemoOrganization({
163
- name: 'org 2',
164
- phone: constants_1.DEMO_NUMBER_INSTALLING_SKILLS,
165
- });
166
- const secondFixture = this.Fixture('organization');
167
- await secondFixture.deleteAllOrganizations(constants_1.DEMO_NUMBER_INSTALLING_SKILLS);
168
- const { client } = await this.Fixture('person').loginAsDemoPerson(constants_1.DEMO_NUMBER_INSTALLING_SKILLS);
169
- const results = await client.emit('list-organizations::v2020_12_25', {
170
- payload: {
171
- shouldOnlyShowMine: true,
172
- },
173
- });
174
- const { organizations } = spruce_event_utils_2.eventResponseUtil.getFirstResponseOrThrow(results);
175
- test_utils_1.assert.isLength(organizations, 0);
176
- //@ts-ignore
177
- firstFixture.destroy = () => { };
178
- //@ts-ignore
179
- secondFixture.destroy = () => { };
180
- }
181
- static async passesThroughAllFieldsToRequest() {
182
- await test_utils_1.assert.doesThrowAsync(() => this.Fixture('organization').seedDemoOrganization({
183
- //@ts-ignore
184
- waka: 'tacas',
185
- }));
186
- }
187
- static canPassPersonFixture() {
188
- const personFixture = this.Fixture('person');
189
- const orgFixture = this.Fixture('organization', {
190
- people: personFixture,
191
- });
192
- //@ts-ignore
193
- test_utils_1.assert.isEqual(orgFixture.people, personFixture);
194
- }
195
- static async canSeedOrgWithNoOptions() {
196
- const org = await this.Fixture('organization').seedDemoOrganization();
197
- test_utils_1.assert.isTruthy(org);
198
- }
199
- static async removePersonThrowsWithBadIds() {
200
- await test_utils_1.assert.doesThrowAsync(() => this.organizations.removePerson({
201
- phone: constants_1.DEMO_NUMBER_HIRING,
202
- roleBase: 'guest',
203
- organizationId: 'aoeu',
204
- personId: 'aoeu',
205
- }));
206
- }
207
- static async canRemovePersonFromOrg(roleBase) {
208
- const { person, org } = await this.seedOrgAndHirePerson(roleBase);
209
- await this.organizations.removePerson({
210
- phone: constants_1.DEMO_NUMBER_HIRING,
211
- roleBase,
212
- organizationId: org.id,
213
- personId: person.id,
214
- });
215
- const isHired = await this.isPersonPartOfOrg(person.id, org.id);
216
- test_utils_1.assert.isFalse(isHired);
217
- }
218
- static async Org() {
219
- return await this.organizations.seedDemoOrganization({
220
- name: 'my org',
221
- phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
222
- });
223
- }
224
- static async seedOrgAndHirePerson(base) {
225
- const org = await this.organizations.seedDemoOrganization({
226
- name: 'my org',
227
- phone: constants_1.DEMO_NUMBER_HIRING,
228
- });
229
- const { person } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER);
230
- await this.organizations.addPerson({
231
- personId: person.id,
232
- organizationId: org.id,
233
- roleBase: base,
234
- phone: constants_1.DEMO_NUMBER_HIRING,
235
- });
236
- return { person, org };
237
- }
238
- static async assertSkillIsInstalled(skillId, orgId) {
239
- const isInstalled = await this.organizations.isSkillInstalled(skillId, orgId);
240
- test_utils_1.assert.isTrue(isInstalled);
241
- }
242
- static async seedOrgAndSkill() {
243
- const skill = await this.skills.seedDemoSkill({
244
- name: 'testing testy',
245
- });
246
- const org = await this.organizations.seedDemoOrganization({
247
- name: 'my org',
248
- });
249
- return { skill, org };
250
- }
251
- static async assertOrgIsPublicValue(orgId, expected) {
252
- const org = await this.organizations.getOrganizationById(orgId);
253
- if (expected) {
254
- test_utils_1.assert.isTrue(org.isPublic);
255
- }
256
- else {
257
- test_utils_1.assert.isFalsy(org.isPublic);
258
- }
259
- }
260
- static async setAndAssertOrgIsPublic(orgId, isPublic) {
261
- await this.organizations.updateOrganization(orgId, {
262
- isPublic,
263
- phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
264
- });
265
- await this.assertOrgIsPublicValue(orgId, isPublic);
266
- }
267
- };
268
- __decorate([
269
- (0, test_utils_1.test)()
270
- ], OrganizationFixtureTest, "canCreateOrganizationFixture", null);
271
- __decorate([
272
- (0, test_utils_1.test)()
273
- ], OrganizationFixtureTest, "canSeedOrg", null);
274
- __decorate([
275
- (0, test_utils_1.test)()
276
- ], OrganizationFixtureTest, "orgFixtureDestroysOrgs", null);
277
- __decorate([
278
- (0, test_utils_1.test)()
279
- ], OrganizationFixtureTest, "isNotPartOfOrgtoStart", null);
280
- __decorate([
281
- (0, test_utils_1.test)()
282
- ], OrganizationFixtureTest, "updatingBadOrgTHrows", null);
283
- __decorate([
284
- (0, test_utils_1.test)()
285
- ], OrganizationFixtureTest, "canUpdateOrg", null);
286
- __decorate([
287
- (0, test_utils_1.test)()
288
- ], OrganizationFixtureTest, "canUpdateOrgAddress", null);
289
- __decorate([
290
- (0, test_utils_1.test)()
291
- ], OrganizationFixtureTest, "canMakeOrgPublicAndPrivate", null);
292
- __decorate([
293
- (0, test_utils_1.test)('can add as guest', 'guest'),
294
- (0, test_utils_1.test)('can add as teammate', 'teammate')
295
- ], OrganizationFixtureTest, "canAddPersonToOrg", null);
296
- __decorate([
297
- (0, test_utils_1.test)()
298
- ], OrganizationFixtureTest, "isNotInstalledByDefault", null);
299
- __decorate([
300
- (0, test_utils_1.test)()
301
- ], OrganizationFixtureTest, "showsAsInstalled", null);
302
- __decorate([
303
- (0, test_utils_1.test)()
304
- ], OrganizationFixtureTest, "cantInstallWithBadSkill", null);
305
- __decorate([
306
- (0, test_utils_1.test)()
307
- ], OrganizationFixtureTest, "canInstallWithSlug", null);
308
- __decorate([
309
- (0, test_utils_1.test)()
310
- ], OrganizationFixtureTest, "canInstallSkillFromAnotherPerson", null);
311
- __decorate([
312
- (0, test_utils_1.test)()
313
- ], OrganizationFixtureTest, "canDeleteAllExistingOrgs", null);
314
- __decorate([
315
- (0, test_utils_1.test)()
316
- ], OrganizationFixtureTest, "passesThroughAllFieldsToRequest", null);
317
- __decorate([
318
- (0, test_utils_1.test)()
319
- ], OrganizationFixtureTest, "canPassPersonFixture", null);
320
- __decorate([
321
- (0, test_utils_1.test)()
322
- ], OrganizationFixtureTest, "canSeedOrgWithNoOptions", null);
323
- __decorate([
324
- (0, test_utils_1.test)()
325
- ], OrganizationFixtureTest, "removePersonThrowsWithBadIds", null);
326
- __decorate([
327
- (0, test_utils_1.test)('can remove guest', 'guest'),
328
- (0, test_utils_1.test)('can remove teammate', 'teammate')
329
- ], OrganizationFixtureTest, "canRemovePersonFromOrg", null);
330
- OrganizationFixtureTest = __decorate([
331
- fake_1.default.login()
332
- ], OrganizationFixtureTest);
333
- exports.default = OrganizationFixtureTest;
@@ -1,4 +0,0 @@
1
- import { AbstractSpruceFixtureTest } from '../..';
2
- export default class PatchingConsoleErrorToErrorStreamTest extends AbstractSpruceFixtureTest {
3
- protected static patchesConsoleError(): void;
4
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- 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;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
10
- const test_utils_1 = require("@sprucelabs/test-utils");
11
- const __1 = require("../..");
12
- class PatchingConsoleErrorToErrorStreamTest extends __1.AbstractSpruceFixtureTest {
13
- static patchesConsoleError() {
14
- test_utils_1.assert.isEqual(console.error, spruce_skill_utils_1.testLog.error);
15
- console.error('Should write to console');
16
- }
17
- }
18
- exports.default = PatchingConsoleErrorToErrorStreamTest;
19
- __decorate([
20
- (0, test_utils_1.test)()
21
- ], PatchingConsoleErrorToErrorStreamTest, "patchesConsoleError", null);
@@ -1,22 +0,0 @@
1
- import AbstractSpruceTest from '@sprucelabs/test-utils';
2
- export default class PersonFixtureTest extends AbstractSpruceTest {
3
- private static fixture;
4
- protected static beforeEach(): Promise<void>;
5
- private static Fixture;
6
- protected static canCreatePersonFixture(): Promise<void>;
7
- protected static throwsWhenNoDummyNumberSetInEnv(): Promise<void>;
8
- protected static canLoginAsPerson(): Promise<void>;
9
- protected static canLoginAsPersonWithEnv(): Promise<void>;
10
- protected static canLoginWith2Numbers(): Promise<void>;
11
- protected static loggingInWithoutNumberReturnsSameClientEveryTime(): Promise<void>;
12
- protected static staysLoggedInAsThisPerson(): Promise<void>;
13
- protected static canOverrideDefaultClient(): Promise<void>;
14
- protected static honorsDefaultClientEvenWithoutDemoPhoneSet(): Promise<void>;
15
- protected static listPeoplePassesThroughVars(expectedTarget: any, expectedPayload?: {
16
- personIds: string[];
17
- roleBases: string[];
18
- roleIds: string[];
19
- shouldIncludePrivateFields: boolean;
20
- }): Promise<void>;
21
- protected static listPeopleReturnsPeople(expectedPeople: any): Promise<void>;
22
- }
@@ -1,225 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
- 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;
22
- return c > 3 && r && Object.defineProperty(target, key, r), r;
23
- };
24
- var __importStar = (this && this.__importStar) || function (mod) {
25
- if (mod && mod.__esModule) return mod;
26
- var result = {};
27
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
- __setModuleDefault(result, mod);
29
- return result;
30
- };
31
- var __importDefault = (this && this.__importDefault) || function (mod) {
32
- return (mod && mod.__esModule) ? mod : { "default": mod };
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- const mercury_client_1 = require("@sprucelabs/mercury-client");
36
- const schema_1 = require("@sprucelabs/schema");
37
- const test_utils_1 = __importStar(require("@sprucelabs/test-utils"));
38
- const test_utils_2 = require("@sprucelabs/test-utils");
39
- const dotenv_1 = __importDefault(require("dotenv"));
40
- const __1 = require("../..");
41
- const constants_1 = require("../../tests/constants");
42
- const FixtureFactory_1 = __importDefault(require("../../tests/fixtures/FixtureFactory"));
43
- dotenv_1.default.config();
44
- __1.MercuryFixture.setShouldRequireLocalListeners(false);
45
- class PersonFixtureTest extends test_utils_1.default {
46
- static async beforeEach() {
47
- await super.beforeEach();
48
- this.fixture = this.Fixture();
49
- mercury_client_1.MercuryTestClient.reset();
50
- }
51
- static Fixture() {
52
- return new FixtureFactory_1.default({ cwd: this.cwd }).Fixture('person');
53
- }
54
- static async canCreatePersonFixture() {
55
- test_utils_1.assert.isTruthy(this.fixture);
56
- }
57
- static async throwsWhenNoDummyNumberSetInEnv() {
58
- delete process.env.DEMO_NUMBER;
59
- const err = await test_utils_1.assert.doesThrowAsync(() => this.fixture.loginAsDemoPerson());
60
- test_utils_2.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
61
- parameters: ['env.DEMO_NUMBER'],
62
- });
63
- }
64
- static async canLoginAsPerson() {
65
- const { person, client } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER);
66
- test_utils_1.assert.isTruthy(person);
67
- test_utils_1.assert.isTruthy(client);
68
- await client.disconnect();
69
- }
70
- static async canLoginAsPersonWithEnv() {
71
- process.env.DEMO_NUMBER = constants_1.DEMO_NUMBER;
72
- const { person, client } = await this.fixture.loginAsDemoPerson();
73
- test_utils_1.assert.isTruthy(person);
74
- test_utils_1.assert.isEqual(person.phone, (0, schema_1.formatPhoneNumber)(constants_1.DEMO_NUMBER));
75
- test_utils_1.assert.isTruthy(client);
76
- await client.disconnect();
77
- }
78
- static async canLoginWith2Numbers() {
79
- const { person } = await this.fixture.loginAsDemoPerson();
80
- const { person: person2 } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_SECOND_LOGIN);
81
- test_utils_1.assert.isEqual(person.phone, (0, schema_1.formatPhoneNumber)(constants_1.DEMO_NUMBER));
82
- test_utils_1.assert.isEqual(person2.phone, (0, schema_1.formatPhoneNumber)(constants_1.DEMO_NUMBER_SECOND_LOGIN));
83
- }
84
- static async loggingInWithoutNumberReturnsSameClientEveryTime() {
85
- const { client } = await this.fixture.loginAsDemoPerson();
86
- const { client: client1 } = await this.fixture.loginAsDemoPerson();
87
- test_utils_1.assert.isEqual(client, client1);
88
- }
89
- static async staysLoggedInAsThisPerson() {
90
- mercury_client_1.MercuryClientFactory.setIsTestMode(true);
91
- const { client } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_SECOND_LOGIN);
92
- //@ts-ignore
93
- client.emit = () => {
94
- test_utils_1.assert.fail('should reuse client');
95
- };
96
- const { client: client1 } = await this.fixture.loginAsDemoPerson();
97
- test_utils_1.assert.isEqual(client, client1);
98
- }
99
- static async canOverrideDefaultClient() {
100
- const { client } = await this.fixture.loginAsDemoPerson();
101
- __1.MercuryFixture.setDefaultClient(client);
102
- const { client: client2 } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_SECOND_LOGIN);
103
- test_utils_1.assert.isNotEqual(client, client2);
104
- }
105
- static async honorsDefaultClientEvenWithoutDemoPhoneSet() {
106
- const phone = process.env.DEMO_NUMBER;
107
- delete process.env.DEMO_NUMBER;
108
- const { client } = await this.Fixture().loginAsDemoPerson(phone);
109
- __1.MercuryFixture.setDefaultClient(client);
110
- const { client: client2 } = await this.Fixture().loginAsDemoPerson();
111
- test_utils_1.assert.isEqual(client, client2);
112
- }
113
- static async listPeoplePassesThroughVars(expectedTarget, expectedPayload = {
114
- personIds: ['1234'],
115
- roleBases: ['1234'],
116
- roleIds: ['1234'],
117
- shouldIncludePrivateFields: true,
118
- }) {
119
- mercury_client_1.MercuryClientFactory.setIsTestMode(true);
120
- test_utils_1.assert.isFunction(this.fixture.listPeople);
121
- const { client } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_PERSON_FIXTURE);
122
- let wasHit = true;
123
- let passedTarget;
124
- let passedPayload;
125
- await client.on('list-people::v2020_12_25', ({ target, payload }) => {
126
- passedTarget = target;
127
- passedPayload = payload;
128
- wasHit = true;
129
- return {
130
- people: [
131
- {
132
- id: '1234',
133
- casualName: 'tay',
134
- dateCreated: 0,
135
- },
136
- ],
137
- };
138
- });
139
- await this.fixture.listPeople(Object.assign(Object.assign({}, expectedTarget), expectedPayload));
140
- test_utils_1.assert.isTrue(wasHit);
141
- test_utils_1.assert.isEqualDeep(passedTarget, expectedTarget);
142
- test_utils_1.assert.isEqualDeep(passedPayload, expectedPayload);
143
- }
144
- static async listPeopleReturnsPeople(expectedPeople) {
145
- mercury_client_1.MercuryClientFactory.setIsTestMode(true);
146
- const { client } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_PERSON_FIXTURE);
147
- await client.on('list-people::v2020_12_25', () => {
148
- return {
149
- people: expectedPeople,
150
- };
151
- });
152
- const people = await this.fixture.listPeople({
153
- organizationId: '1234',
154
- });
155
- test_utils_1.assert.isEqualDeep(people, expectedPeople);
156
- }
157
- }
158
- exports.default = PersonFixtureTest;
159
- __decorate([
160
- (0, test_utils_1.test)()
161
- ], PersonFixtureTest, "canCreatePersonFixture", null);
162
- __decorate([
163
- (0, test_utils_1.test)()
164
- ], PersonFixtureTest, "throwsWhenNoDummyNumberSetInEnv", null);
165
- __decorate([
166
- (0, test_utils_1.test)()
167
- ], PersonFixtureTest, "canLoginAsPerson", null);
168
- __decorate([
169
- (0, test_utils_1.test)()
170
- ], PersonFixtureTest, "canLoginAsPersonWithEnv", null);
171
- __decorate([
172
- (0, test_utils_1.test)()
173
- ], PersonFixtureTest, "canLoginWith2Numbers", null);
174
- __decorate([
175
- (0, test_utils_1.test)()
176
- ], PersonFixtureTest, "loggingInWithoutNumberReturnsSameClientEveryTime", null);
177
- __decorate([
178
- (0, test_utils_1.test)()
179
- ], PersonFixtureTest, "staysLoggedInAsThisPerson", null);
180
- __decorate([
181
- (0, test_utils_1.test)()
182
- ], PersonFixtureTest, "canOverrideDefaultClient", null);
183
- __decorate([
184
- (0, test_utils_1.test)()
185
- ], PersonFixtureTest, "honorsDefaultClientEvenWithoutDemoPhoneSet", null);
186
- __decorate([
187
- (0, test_utils_1.test)('list people passes target', {
188
- organizationId: '1234',
189
- locationId: '1234',
190
- }),
191
- (0, test_utils_1.test)('list people passes target 2', {
192
- organizationId: '5234',
193
- locationId: '2666',
194
- }),
195
- (0, test_utils_1.test)('list people passes payload 1', {
196
- organizationId: '5234',
197
- locationId: '2666',
198
- }, {
199
- personIds: ['56236'],
200
- roleBases: ['23452346'],
201
- roleIds: ['7567'],
202
- shouldIncludePrivateFields: false,
203
- })
204
- ], PersonFixtureTest, "listPeoplePassesThroughVars", null);
205
- __decorate([
206
- (0, test_utils_1.test)('returns people 1', [
207
- {
208
- id: '1234',
209
- casualName: 'tay',
210
- dateCreated: 0,
211
- },
212
- ]),
213
- (0, test_utils_1.test)('returns people 2', [
214
- {
215
- id: '234234',
216
- casualName: 'tsaoteuh',
217
- dateCreated: 230,
218
- },
219
- {
220
- id: '1234',
221
- casualName: 'tay',
222
- dateCreated: 0,
223
- },
224
- ])
225
- ], PersonFixtureTest, "listPeopleReturnsPeople", null);
@@ -1,11 +0,0 @@
1
- import { AbstractSpruceFixtureTest } from '../..';
2
- export default class PhoneNumberIncrementorTest extends AbstractSpruceFixtureTest {
3
- protected static canCreatePhoneNumberIncrementor(): Promise<void>;
4
- protected static throwsWithMissingOptions(options: any, parameters: string[]): Promise<void>;
5
- protected static throwsWithBadNumber(phone: string): Promise<void>;
6
- protected static generatesExpectedNumberOfNumbers(total: number): Promise<void>;
7
- protected static handlesFormattedNumber(): Promise<void>;
8
- protected static generatesExpectedNumbers(expected: string[]): Promise<void>;
9
- protected static generateNumbersFromDifferentStartNumber(): Promise<void>;
10
- private static generate;
11
- }