@sprucelabs/spruce-test-fixtures 62.2.23 → 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,34 +0,0 @@
1
- import { AuthorizerCanOptions } from '@sprucelabs/heartwood-view-controllers';
2
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
3
- export default class CheckingPermissionsTest extends AbstractSpruceFixtureTest {
4
- private static contractId;
5
- protected static beforeEach(): Promise<void>;
6
- protected static canCreateCheckingPermissions(): Promise<void>;
7
- protected static sharesInstances(): Promise<void>;
8
- protected static permsFixtureResetsInstance(): Promise<void>;
9
- protected static throwsWhenMissingOnCan(): Promise<void>;
10
- protected static throwsWhenNotSettingResponse(): Promise<void>;
11
- protected static throwsWhenContractIdNotFaked(): Promise<void>;
12
- protected static doesNotThrowWhenMatchingSecondContractId(): Promise<void>;
13
- protected static throwsWhenNotFindingPermissionId(): Promise<void>;
14
- protected static throwsWhenFindingLaterMissingPermId(): Promise<void>;
15
- protected static returnsFakedResponses(permissionIds: string[], can: boolean): Promise<void>;
16
- protected static fixtureAndLoadOptionsShareAuthorizer(): Promise<void>;
17
- protected static authorizerClobbersMatchingContracts(): Promise<void>;
18
- protected static usesLatestMatchWhenMultipleSent(): Promise<void>;
19
- protected static canHandleMulplePermissionsWithDifferentContracts(): Promise<void>;
20
- protected static sameAuthorizerAsViews(): Promise<void>;
21
- protected static sameAuthenticatorAsViews(): Promise<void>;
22
- protected static canSpyOnSavePermissions(): Promise<void>;
23
- protected static canSeeLastCanOptions(can: AuthorizerCanOptions<any>): Promise<void>;
24
- private static assertCanOptionsMatch;
25
- private static assertSpysOnOptionsWhenSaving;
26
- private static assertPermNotFound;
27
- private static changeContractId;
28
- private static assertThrowsFakeError;
29
- private static fakePermissions;
30
- private static can;
31
- private static setupEmptyViewFixture;
32
- private static get instance();
33
- private static get auth();
34
- }
@@ -1,272 +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 test_utils_1 = require("@sprucelabs/test-utils");
13
- const test_utils_2 = require("@sprucelabs/test-utils");
14
- const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
15
- const FakeAuthorizer_1 = __importDefault(require("../../../tests/FakeAuthorizer"));
16
- const PermissionFixture_1 = __importDefault(require("../../../tests/fixtures/PermissionFixture"));
17
- class CheckingPermissionsTest extends AbstractSpruceFixtureTest_1.default {
18
- static async beforeEach() {
19
- await super.beforeEach();
20
- this.contractId = (0, test_utils_2.generateId)();
21
- }
22
- static async canCreateCheckingPermissions() {
23
- test_utils_1.assert.isTrue(this.instance instanceof FakeAuthorizer_1.default);
24
- }
25
- static async sharesInstances() {
26
- test_utils_1.assert.isEqual(this.instance, this.instance);
27
- }
28
- static async permsFixtureResetsInstance() {
29
- const instance = this.instance;
30
- PermissionFixture_1.default.beforeEach();
31
- test_utils_1.assert.isNotEqual(this.instance, instance);
32
- }
33
- static async throwsWhenMissingOnCan() {
34
- const err = await test_utils_1.assert.doesThrowAsync(() =>
35
- //@ts-ignore
36
- this.instance.can());
37
- test_utils_2.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
38
- parameters: ['contractId', 'permissionIds'],
39
- });
40
- }
41
- static async throwsWhenNotSettingResponse() {
42
- await this.assertThrowsFakeError();
43
- }
44
- static async throwsWhenContractIdNotFaked() {
45
- this.fakePermissions([{ id: 'test', can: true }]);
46
- this.changeContractId();
47
- await this.assertThrowsFakeError();
48
- }
49
- static async doesNotThrowWhenMatchingSecondContractId() {
50
- this.fakePermissions([{ id: 'test', can: true }]);
51
- this.changeContractId();
52
- this.fakePermissions([{ id: 'test2', can: true }]);
53
- await this.can(['test2']);
54
- }
55
- static async throwsWhenNotFindingPermissionId() {
56
- this.fakePermissions([{ id: 'test', can: true }]);
57
- await this.assertPermNotFound(['test2'], 'test2');
58
- }
59
- static async throwsWhenFindingLaterMissingPermId() {
60
- this.fakePermissions([{ id: 'test', can: true }]);
61
- await this.assertPermNotFound(['test', 'test2'], 'test2');
62
- }
63
- static async returnsFakedResponses(permissionIds, can) {
64
- const faked = [];
65
- const expected = {};
66
- permissionIds.forEach((id) => ((expected[id] = can), faked.push({ id, can })));
67
- this.fakePermissions(faked);
68
- const results = await this.can(permissionIds);
69
- test_utils_1.assert.isEqualDeep(results, expected);
70
- }
71
- static async fixtureAndLoadOptionsShareAuthorizer() {
72
- this.setupEmptyViewFixture();
73
- const auth = this.auth;
74
- const router = this.views.getRouter();
75
- test_utils_1.assert.isEqual(auth, router.buildLoadOptions().authorizer);
76
- }
77
- static async authorizerClobbersMatchingContracts() {
78
- this.fakePermissions([{ id: 'test', can: true }]);
79
- this.fakePermissions([{ id: 'test', can: false }]);
80
- const perms = await this.can(['test']);
81
- test_utils_1.assert.isFalse(perms['test']);
82
- }
83
- static async usesLatestMatchWhenMultipleSent() {
84
- this.fakePermissions([
85
- { id: 'test', can: false },
86
- { id: 'test2', can: false },
87
- ]);
88
- this.fakePermissions([
89
- { id: 'test', can: true },
90
- { id: 'test2', can: false },
91
- ]);
92
- const perms = await this.can(['test', 'test2']);
93
- test_utils_1.assert.isTrue(perms['test']);
94
- test_utils_1.assert.isFalse(perms['test2']);
95
- }
96
- static async canHandleMulplePermissionsWithDifferentContracts() {
97
- const firstId = this.contractId;
98
- this.fakePermissions([{ id: 'test', can: true }]);
99
- this.changeContractId();
100
- this.fakePermissions([{ id: 'test', can: false }]);
101
- this.contractId = firstId;
102
- const perms = await this.can(['test']);
103
- test_utils_1.assert.isTrue(perms['test']);
104
- }
105
- static async sameAuthorizerAsViews() {
106
- this.setupEmptyViewFixture();
107
- const auth1 = this.views.getAuthorizer();
108
- const auth2 = this.permissions.getAuthorizer();
109
- test_utils_1.assert.isEqual(auth1, auth2);
110
- }
111
- static async sameAuthenticatorAsViews() {
112
- this.setupEmptyViewFixture();
113
- const auth1 = this.views.getAuthenticator();
114
- const auth2 = this.permissions.getAuthenticator();
115
- test_utils_1.assert.isEqual(auth1, auth2);
116
- }
117
- static async canSpyOnSavePermissions() {
118
- await this.assertSpysOnOptionsWhenSaving({
119
- contractId: 'events-contract',
120
- target: {},
121
- permissions: [],
122
- });
123
- await this.assertSpysOnOptionsWhenSaving({
124
- contractId: 'feed-contract',
125
- target: {
126
- locationId: (0, test_utils_2.generateId)(),
127
- personId: (0, test_utils_2.generateId)(),
128
- },
129
- permissions: [
130
- {
131
- id: 'can-see-other-persons-feed',
132
- can: {
133
- clockedIn: true,
134
- },
135
- },
136
- ],
137
- });
138
- }
139
- static async canSeeLastCanOptions(can) {
140
- await this.assertCanOptionsMatch(can);
141
- }
142
- static async assertCanOptionsMatch(can) {
143
- const { contractId } = can;
144
- this.auth.fakePermissions({
145
- contractId: contractId,
146
- permissions: [
147
- {
148
- id: 'can-register-global-events',
149
- can: true,
150
- },
151
- {
152
- id: 'can-register-global-events-2',
153
- can: true,
154
- },
155
- {
156
- id: 'can-register-global-events-3',
157
- can: true,
158
- },
159
- ],
160
- });
161
- await this.auth.can(can);
162
- test_utils_1.assert.isEqualDeep(this.auth.getLastCanOptions(), can);
163
- }
164
- static async assertSpysOnOptionsWhenSaving(options) {
165
- await this.auth.savePermissions(options);
166
- test_utils_1.assert.isEqualDeep(this.auth.getLastSavePermissionsOptions(), options);
167
- }
168
- static async assertPermNotFound(checkIds, id) {
169
- await test_utils_1.assert.doesThrowAsync(() => this.can(checkIds), id);
170
- }
171
- static changeContractId() {
172
- this.contractId = (0, test_utils_2.generateId)();
173
- }
174
- static async assertThrowsFakeError() {
175
- await test_utils_1.assert.doesThrowAsync(() => this.can(['test']), `Contract with the id '${this.contractId}'`);
176
- }
177
- static fakePermissions(faked) {
178
- this.instance.fakePermissions({
179
- contractId: this.contractId,
180
- permissions: faked,
181
- });
182
- }
183
- static can(permissionIds) {
184
- return this.instance.can({
185
- contractId: this.contractId,
186
- permissionIds: permissionIds,
187
- });
188
- }
189
- static setupEmptyViewFixture() {
190
- this.views = this.Fixture('view', {
191
- controllerMap: {},
192
- });
193
- }
194
- static get instance() {
195
- return this.permissions.getAuthorizer();
196
- }
197
- static get auth() {
198
- return this.permissions.getAuthorizer();
199
- }
200
- }
201
- exports.default = CheckingPermissionsTest;
202
- __decorate([
203
- (0, test_utils_1.test)()
204
- ], CheckingPermissionsTest, "canCreateCheckingPermissions", null);
205
- __decorate([
206
- (0, test_utils_1.test)()
207
- ], CheckingPermissionsTest, "sharesInstances", null);
208
- __decorate([
209
- (0, test_utils_1.test)()
210
- ], CheckingPermissionsTest, "permsFixtureResetsInstance", null);
211
- __decorate([
212
- (0, test_utils_1.test)()
213
- ], CheckingPermissionsTest, "throwsWhenMissingOnCan", null);
214
- __decorate([
215
- (0, test_utils_1.test)()
216
- ], CheckingPermissionsTest, "throwsWhenNotSettingResponse", null);
217
- __decorate([
218
- (0, test_utils_1.test)()
219
- ], CheckingPermissionsTest, "throwsWhenContractIdNotFaked", null);
220
- __decorate([
221
- (0, test_utils_1.test)()
222
- ], CheckingPermissionsTest, "doesNotThrowWhenMatchingSecondContractId", null);
223
- __decorate([
224
- (0, test_utils_1.test)()
225
- ], CheckingPermissionsTest, "throwsWhenNotFindingPermissionId", null);
226
- __decorate([
227
- (0, test_utils_1.test)()
228
- ], CheckingPermissionsTest, "throwsWhenFindingLaterMissingPermId", null);
229
- __decorate([
230
- (0, test_utils_1.test)('returns false on can 1', ['first', 'second', 'third'], false),
231
- (0, test_utils_1.test)('returns false on can 2', ['third', 'fourth'], false),
232
- (0, test_utils_1.test)('returns false on can 3', ['first', 'second', 'third'], true),
233
- (0, test_utils_1.test)('returns false on can 4', ['third', 'fourth'], true)
234
- ], CheckingPermissionsTest, "returnsFakedResponses", null);
235
- __decorate([
236
- (0, test_utils_1.test)()
237
- ], CheckingPermissionsTest, "fixtureAndLoadOptionsShareAuthorizer", null);
238
- __decorate([
239
- (0, test_utils_1.test)()
240
- ], CheckingPermissionsTest, "authorizerClobbersMatchingContracts", null);
241
- __decorate([
242
- (0, test_utils_1.test)()
243
- ], CheckingPermissionsTest, "usesLatestMatchWhenMultipleSent", null);
244
- __decorate([
245
- (0, test_utils_1.test)()
246
- ], CheckingPermissionsTest, "canHandleMulplePermissionsWithDifferentContracts", null);
247
- __decorate([
248
- (0, test_utils_1.test)()
249
- ], CheckingPermissionsTest, "sameAuthorizerAsViews", null);
250
- __decorate([
251
- (0, test_utils_1.test)()
252
- ], CheckingPermissionsTest, "sameAuthenticatorAsViews", null);
253
- __decorate([
254
- (0, test_utils_1.test)()
255
- ], CheckingPermissionsTest, "canSpyOnSavePermissions", null);
256
- __decorate([
257
- (0, test_utils_1.test)('can see last can options 1', {
258
- contractId: 'events-contract',
259
- permissionIds: ['can-register-global-events'],
260
- target: {},
261
- }),
262
- (0, test_utils_1.test)('can see last can options 2', {
263
- contractId: 'events-contract-2',
264
- permissionIds: [
265
- 'can-register-global-events',
266
- 'can-register-global-events-2',
267
- ],
268
- target: {
269
- personId: (0, test_utils_2.generateId)(),
270
- },
271
- })
272
- ], CheckingPermissionsTest, "canSeeLastCanOptions", null);
@@ -1,5 +0,0 @@
1
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
2
- export default class PermissionFixtureTest extends AbstractSpruceFixtureTest {
3
- protected static disablesPermissionsAtStart(): Promise<void>;
4
- protected static permissionFixtureShouldUseSharedInstance(): Promise<void>;
5
- }
@@ -1,35 +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 spruce_permission_utils_1 = require("@sprucelabs/spruce-permission-utils");
13
- const test_utils_1 = require("@sprucelabs/test-utils");
14
- const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
15
- const fake_1 = __importDefault(require("../../../tests/decorators/fake"));
16
- let PermissionFixtureTest = class PermissionFixtureTest extends AbstractSpruceFixtureTest_1.default {
17
- static async disablesPermissionsAtStart() {
18
- test_utils_1.assert.isEqual(process.env.SHOULD_REGISTER_PERMISSIONS, 'false');
19
- }
20
- static async permissionFixtureShouldUseSharedInstance() {
21
- const actual = this.permissions.getAuthorizer();
22
- const expected = spruce_permission_utils_1.AuthorizerFactory.getInstance();
23
- test_utils_1.assert.isEqual(actual, expected);
24
- }
25
- };
26
- __decorate([
27
- (0, test_utils_1.test)()
28
- ], PermissionFixtureTest, "disablesPermissionsAtStart", null);
29
- __decorate([
30
- (0, test_utils_1.test)()
31
- ], PermissionFixtureTest, "permissionFixtureShouldUseSharedInstance", null);
32
- PermissionFixtureTest = __decorate([
33
- fake_1.default.login()
34
- ], PermissionFixtureTest);
35
- exports.default = PermissionFixtureTest;
@@ -1,24 +0,0 @@
1
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
2
- export default class SeedingDataTest extends AbstractSpruceFixtureTest {
3
- private static fixture;
4
- private static client;
5
- protected static beforeEach(): Promise<void>;
6
- protected static hasSeedFixture(): void;
7
- protected static canSeedManyOrgs(): Promise<void>;
8
- protected static actuallyCreatesOrgs(): Promise<void>;
9
- protected static canSeedLocations(): Promise<void>;
10
- protected static seedingOrgsCreatesOrganization(): Promise<void>;
11
- protected static canPassOrgToLocationSeeder(): Promise<void>;
12
- protected static throwsWhenSeedingWithoutCount(): Promise<void>;
13
- protected static actuallyCreatesLocations(): Promise<void>;
14
- protected static needsStartingPhoneWhenSeedingPeople(options: any): Promise<void>;
15
- protected static returnsSeededGuests(options: any, expectedCount: number, base: string): Promise<void>;
16
- protected static setsFirstPersonsNumberToTheStartingPhone(phone: string): Promise<void>;
17
- protected static canSeedMultipleRolesAtOnce(): Promise<void>;
18
- protected static seededPeopleHaveNames(): Promise<void>;
19
- protected static peopleAllHaveUniqueNames(): Promise<void>;
20
- protected static namesAreOnlyAssignedIfNotYetAssigned(): Promise<void>;
21
- private static listPeople;
22
- private static seedLocations;
23
- private static assertOnlyOneOrgExists;
24
- }
@@ -1,271 +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 __rest = (this && this.__rest) || function (s, e) {
9
- var t = {};
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
11
- t[p] = s[p];
12
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
13
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
14
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
15
- t[p[i]] = s[p[i]];
16
- }
17
- return t;
18
- };
19
- var __importDefault = (this && this.__importDefault) || function (mod) {
20
- return (mod && mod.__esModule) ? mod : { "default": mod };
21
- };
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- const schema_1 = require("@sprucelabs/schema");
24
- const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
25
- const test_utils_1 = require("@sprucelabs/test-utils");
26
- const test_utils_2 = require("@sprucelabs/test-utils");
27
- const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
28
- const constants_1 = require("../../../tests/constants");
29
- const fake_1 = __importDefault(require("../../../tests/decorators/fake"));
30
- const sorter = (a, b) => (a.id > b.id ? 1 : -1);
31
- let SeedingDataTest = class SeedingDataTest extends AbstractSpruceFixtureTest_1.default {
32
- static async beforeEach() {
33
- await super.beforeEach();
34
- this.client = fake_1.default.getClient();
35
- this.fixture = this.Fixture('seed');
36
- await this.fixture.resetAccount(constants_1.DEMO_NUMBER_SEED_FIXTURE);
37
- }
38
- static hasSeedFixture() {
39
- test_utils_1.assert.isTruthy(this.fixture);
40
- }
41
- static async canSeedManyOrgs() {
42
- const organizations = await this.fixture.seedOrganizations({
43
- totalOrganizations: 5,
44
- });
45
- test_utils_1.assert.isLength(organizations, 5);
46
- }
47
- static async actuallyCreatesOrgs() {
48
- const organizations = await this.fixture.seedOrganizations({
49
- totalOrganizations: 3,
50
- });
51
- const results = await this.client.emit('list-organizations::v2020_12_25', {
52
- payload: {
53
- shouldOnlyShowMine: true,
54
- },
55
- });
56
- const { organizations: matched } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
57
- test_utils_1.assert.isLength(matched, 3);
58
- test_utils_1.assert.isLength(organizations, 3);
59
- for (const org of organizations) {
60
- const results = await this.client.emit('get-organization::v2020_12_25', {
61
- target: {
62
- organizationId: org.id,
63
- },
64
- });
65
- spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
66
- }
67
- }
68
- static async canSeedLocations() {
69
- const { locations } = await this.fixture.seedAccount({
70
- totalLocations: 5,
71
- });
72
- test_utils_1.assert.isLength(locations, 5);
73
- }
74
- static async seedingOrgsCreatesOrganization() {
75
- const { locations } = await this.fixture.seedAccount({
76
- totalLocations: 3,
77
- });
78
- test_utils_1.assert.isLength(locations, 3);
79
- await this.assertOnlyOneOrgExists();
80
- }
81
- static async canPassOrgToLocationSeeder() {
82
- const org = await this.organizations.seedDemoOrganization();
83
- await this.fixture.seedAccount({
84
- totalLocations: 3,
85
- organizationId: org.id,
86
- });
87
- await this.assertOnlyOneOrgExists();
88
- }
89
- static async throwsWhenSeedingWithoutCount() {
90
- const err = await test_utils_1.assert.doesThrowAsync(() =>
91
- //@ts-ignore
92
- this.fixture.seedAccount({}));
93
- test_utils_2.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
94
- parameters: ['totalLocations'],
95
- });
96
- }
97
- static async actuallyCreatesLocations() {
98
- const { organization, locations } = await this.seedLocations();
99
- const results = await this.client.emit('list-locations::v2020_12_25', {
100
- target: {
101
- organizationId: organization.id,
102
- },
103
- });
104
- const { locations: matches } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
105
- test_utils_1.assert.isLength(matches, 3);
106
- for (const location of locations) {
107
- const results = await this.client.emit('get-location::v2020_12_25', {
108
- target: {
109
- locationId: location.id,
110
- },
111
- });
112
- spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
113
- }
114
- }
115
- static async needsStartingPhoneWhenSeedingPeople(options) {
116
- const err = await test_utils_1.assert.doesThrowAsync(() => this.seedLocations(Object.assign({}, options)));
117
- test_utils_2.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
118
- parameters: ['startingPhone'],
119
- });
120
- }
121
- static async returnsSeededGuests(options, expectedCount, base) {
122
- var _a;
123
- const _b = await this.seedLocations(Object.assign({ totalLocations: 1, startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE }, options)), { locations } = _b, rest = __rest(_b, ["locations"]);
124
- const withoutOwner = await this.listPeople(locations[0], base);
125
- const withoutOwnerCleaned = withoutOwner.map((_a) => {
126
- var { roleIds: _ } = _a, rest = __rest(_a, ["roleIds"]);
127
- return rest;
128
- });
129
- //@ts-ignore
130
- const people = (_a = rest[base + 's']) !== null && _a !== void 0 ? _a : [];
131
- people.sort(sorter);
132
- withoutOwnerCleaned.sort(sorter);
133
- test_utils_1.assert.isLength(withoutOwner, expectedCount);
134
- test_utils_1.assert.isEqualDeep(people, withoutOwnerCleaned);
135
- }
136
- static async setsFirstPersonsNumberToTheStartingPhone(phone) {
137
- const { guests } = await this.seedLocations({
138
- totalLocations: 1,
139
- totalGuests: 1,
140
- startingPhone: phone,
141
- });
142
- test_utils_1.assert.isEqual(guests[0].phone, (0, schema_1.formatPhoneNumber)(phone));
143
- }
144
- static async canSeedMultipleRolesAtOnce() {
145
- const { locations } = await this.seedLocations({
146
- startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
147
- totalLocations: 1,
148
- totalGuests: 3,
149
- totalManagers: 2,
150
- });
151
- const people = await this.listPeople(locations[0], ['guest', 'manager']);
152
- test_utils_1.assert.isLength(people, 5);
153
- }
154
- static async seededPeopleHaveNames() {
155
- const { teammates } = await this.seedLocations({
156
- startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
157
- totalLocations: 1,
158
- totalTeammates: 2,
159
- });
160
- test_utils_1.assert.isTruthy(teammates[0].firstName);
161
- }
162
- static async peopleAllHaveUniqueNames() {
163
- const { teammates } = await this.seedLocations({
164
- startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
165
- totalLocations: 1,
166
- totalTeammates: 2,
167
- });
168
- const names = teammates.map((t) => t.casualName);
169
- const unique = [...new Set(names)];
170
- test_utils_1.assert.isLength(unique, names.length);
171
- }
172
- static async namesAreOnlyAssignedIfNotYetAssigned() {
173
- const { client } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE);
174
- const firstName = `Test person:: ${Math.random()}`;
175
- const lastName = `${Math.random()}`;
176
- await client.emitAndFlattenResponses('update-person::v2020_12_25', {
177
- payload: {
178
- firstName,
179
- lastName,
180
- },
181
- });
182
- const { teammates } = await this.seedLocations({
183
- startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
184
- totalLocations: 1,
185
- totalTeammates: 1,
186
- });
187
- const [tm1] = teammates;
188
- test_utils_1.assert.isEqual(tm1.casualName, firstName + ' ' + lastName[0] + '.');
189
- }
190
- static async listPeople(location, base) {
191
- const people = await this.people.listPeople({
192
- locationId: location.id,
193
- organizationId: location.organizationId,
194
- roleBases: Array.isArray(base) ? base : [base],
195
- shouldIncludePrivateFields: true,
196
- });
197
- const withoutOwner = people.filter((p) => p.id !== fake_1.default.getPerson().id);
198
- return withoutOwner;
199
- }
200
- static async seedLocations(options) {
201
- const org = await this.organizations.seedDemoOrganization();
202
- const results = await this.fixture.seedAccount(Object.assign({ totalLocations: 3, organizationId: org.id }, options));
203
- return Object.assign({ organization: org }, results);
204
- }
205
- static async assertOnlyOneOrgExists() {
206
- const results = await this.client.emit('list-organizations::v2020_12_25', {
207
- payload: {
208
- shouldOnlyShowMine: true,
209
- },
210
- });
211
- const { organizations } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
212
- test_utils_1.assert.isLength(organizations, 1);
213
- test_utils_1.assert.isObject(organizations[0].address);
214
- }
215
- };
216
- __decorate([
217
- (0, test_utils_1.test)()
218
- ], SeedingDataTest, "hasSeedFixture", null);
219
- __decorate([
220
- (0, test_utils_1.test)()
221
- ], SeedingDataTest, "canSeedManyOrgs", null);
222
- __decorate([
223
- (0, test_utils_1.test)()
224
- ], SeedingDataTest, "actuallyCreatesOrgs", null);
225
- __decorate([
226
- (0, test_utils_1.test)()
227
- ], SeedingDataTest, "canSeedLocations", null);
228
- __decorate([
229
- (0, test_utils_1.test)()
230
- ], SeedingDataTest, "seedingOrgsCreatesOrganization", null);
231
- __decorate([
232
- (0, test_utils_1.test)()
233
- ], SeedingDataTest, "canPassOrgToLocationSeeder", null);
234
- __decorate([
235
- (0, test_utils_1.test)()
236
- ], SeedingDataTest, "throwsWhenSeedingWithoutCount", null);
237
- __decorate([
238
- (0, test_utils_1.test)()
239
- ], SeedingDataTest, "actuallyCreatesLocations", null);
240
- __decorate([
241
- (0, test_utils_1.test)('missing starting phone with totalGuests', { totalGuests: 10 }),
242
- (0, test_utils_1.test)('missing starting phone with totalTeammates', { totalTeammates: 10 })
243
- ], SeedingDataTest, "needsStartingPhoneWhenSeedingPeople", null);
244
- __decorate([
245
- (0, test_utils_1.test)('can seed 3 guests', { totalGuests: 3 }, 3, 'guest'),
246
- (0, test_utils_1.test)('can seed 5 guests', { totalGuests: 5 }, 5, 'guest'),
247
- (0, test_utils_1.test)('can seed 2 teammates', { totalTeammates: 2 }, 2, 'teammate'),
248
- (0, test_utils_1.test)('can seed 3 managers', { totalManagers: 3 }, 3, 'manager'),
249
- (0, test_utils_1.test)('can seed 3 groupManager', { totalGroupManagers: 3 }, 3, 'groupManager'),
250
- (0, test_utils_1.test)('can seed 1 owners', { totalOwners: 1 }, 1, 'owner')
251
- ], SeedingDataTest, "returnsSeededGuests", null);
252
- __decorate([
253
- (0, test_utils_1.test)('seeds with starting phone 1', constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE),
254
- (0, test_utils_1.test)('seeds with starting phone 2', constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE_ALT)
255
- ], SeedingDataTest, "setsFirstPersonsNumberToTheStartingPhone", null);
256
- __decorate([
257
- (0, test_utils_1.test)()
258
- ], SeedingDataTest, "canSeedMultipleRolesAtOnce", null);
259
- __decorate([
260
- (0, test_utils_1.test)()
261
- ], SeedingDataTest, "seededPeopleHaveNames", null);
262
- __decorate([
263
- (0, test_utils_1.test)()
264
- ], SeedingDataTest, "peopleAllHaveUniqueNames", null);
265
- __decorate([
266
- (0, test_utils_1.test)()
267
- ], SeedingDataTest, "namesAreOnlyAssignedIfNotYetAssigned", null);
268
- SeedingDataTest = __decorate([
269
- fake_1.default.login(constants_1.DEMO_NUMBER_SEED_FIXTURE)
270
- ], SeedingDataTest);
271
- exports.default = SeedingDataTest;