@sprucelabs/spruce-test-fixtures 45.2.9 → 46.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/build/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.d.ts +7 -0
  2. package/build/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +41 -0
  3. package/build/__tests__/behavioral/DatabaseFixture.test.d.ts +7 -0
  4. package/build/__tests__/behavioral/DatabaseFixture.test.js +59 -0
  5. package/build/__tests__/behavioral/DbResetsAsExpected.test.d.ts +5 -0
  6. package/build/__tests__/behavioral/DbResetsAsExpected.test.js +34 -0
  7. package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +15 -0
  8. package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +109 -0
  9. package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +4 -0
  10. package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +34 -0
  11. package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +5 -0
  12. package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +26 -0
  13. package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +8 -0
  14. package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +65 -0
  15. package/build/__tests__/behavioral/DummyStore.d.ts +55 -0
  16. package/build/__tests__/behavioral/DummyStore.js +36 -0
  17. package/build/__tests__/behavioral/FakingEventResponses.test.d.ts +12 -0
  18. package/build/__tests__/behavioral/FakingEventResponses.test.js +125 -0
  19. package/build/__tests__/behavioral/FixtureFactory.test.d.ts +7 -0
  20. package/build/__tests__/behavioral/FixtureFactory.test.js +79 -0
  21. package/build/__tests__/behavioral/LocationFixture.test.d.ts +15 -0
  22. package/build/__tests__/behavioral/LocationFixture.test.js +128 -0
  23. package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +12 -0
  24. package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +92 -0
  25. package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +4 -0
  26. package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +29 -0
  27. package/build/__tests__/behavioral/MercuryFixture.test.d.ts +19 -0
  28. package/build/__tests__/behavioral/MercuryFixture.test.js +175 -0
  29. package/build/__tests__/behavioral/OrganizationFixture.test.d.ts +31 -0
  30. package/build/__tests__/behavioral/OrganizationFixture.test.js +331 -0
  31. package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +4 -0
  32. package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +21 -0
  33. package/build/__tests__/behavioral/PersonFixture.test.d.ts +22 -0
  34. package/build/__tests__/behavioral/PersonFixture.test.js +224 -0
  35. package/build/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +11 -0
  36. package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +95 -0
  37. package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +8 -0
  38. package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +60 -0
  39. package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +5 -0
  40. package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +37 -0
  41. package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +7 -0
  42. package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +44 -0
  43. package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +10 -0
  44. package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +130 -0
  45. package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +7 -0
  46. package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +42 -0
  47. package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +6 -0
  48. package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +37 -0
  49. package/build/__tests__/behavioral/RoleFixture.test.d.ts +15 -0
  50. package/build/__tests__/behavioral/RoleFixture.test.js +118 -0
  51. package/build/__tests__/behavioral/SeedingData.test.d.ts +24 -0
  52. package/build/__tests__/behavioral/SeedingData.test.js +271 -0
  53. package/build/__tests__/behavioral/SkillFixture.test.d.ts +13 -0
  54. package/build/__tests__/behavioral/SkillFixture.test.js +116 -0
  55. package/build/__tests__/behavioral/StoreFixture.test.d.ts +23 -0
  56. package/build/__tests__/behavioral/StoreFixture.test.js +156 -0
  57. package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +9 -0
  58. package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +71 -0
  59. package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +45 -0
  60. package/build/__tests__/behavioral/faking/FakeDecorator.test.js +418 -0
  61. package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +4 -0
  62. package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +23 -0
  63. package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +4 -0
  64. package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +27 -0
  65. package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +8 -0
  66. package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +93 -0
  67. package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +8 -0
  68. package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +56 -0
  69. package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +14 -0
  70. package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +141 -0
  71. package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +6 -0
  72. package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +42 -0
  73. package/build/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +19 -0
  74. package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +140 -0
  75. package/build/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +24 -0
  76. package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +174 -0
  77. package/build/__tests__/behavioral/faking/UpdatePerson.test.d.ts +4 -0
  78. package/build/__tests__/behavioral/faking/UpdatePerson.test.js +32 -0
  79. package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +35 -0
  80. package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +321 -0
  81. package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +4 -0
  82. package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +48 -0
  83. package/build/__tests__/behavioral/faking/WhoAmI.test.d.ts +19 -0
  84. package/build/__tests__/behavioral/faking/WhoAmI.test.js +103 -0
  85. package/build/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +10 -0
  86. package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +76 -0
  87. package/build/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +37 -0
  88. package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +266 -0
  89. package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +14 -0
  90. package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +113 -0
  91. package/build/__tests__/behavioral/views/CheckingPermissions.test.d.ts +24 -0
  92. package/build/__tests__/behavioral/views/CheckingPermissions.test.js +162 -0
  93. package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +12 -0
  94. package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +55 -0
  95. package/build/__tests__/behavioral/views/Routing.test.d.ts +31 -0
  96. package/build/__tests__/behavioral/views/Routing.test.js +141 -0
  97. package/build/__tests__/behavioral/views/TestingScope.test.d.ts +9 -0
  98. package/build/__tests__/behavioral/views/TestingScope.test.js +67 -0
  99. package/build/__tests__/behavioral/views/ViewFixture.test.d.ts +102 -0
  100. package/build/__tests__/behavioral/views/ViewFixture.test.js +652 -0
  101. package/build/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +11 -0
  102. package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +55 -0
  103. package/build/__tests__/support/AbstractFakeDecoratorTest.d.ts +5 -0
  104. package/build/__tests__/support/AbstractFakeDecoratorTest.js +27 -0
  105. package/build/__tests__/support/EventFaker.d.ts +5 -0
  106. package/build/__tests__/support/EventFaker.js +36 -0
  107. package/build/__tests__/support/FakeThemeManager.d.ts +8 -0
  108. package/build/__tests__/support/FakeThemeManager.js +40 -0
  109. package/build/__tests__/test.types.d.ts +2 -0
  110. package/build/__tests__/test.types.js +2 -0
  111. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.d.ts +5 -0
  112. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.js +9 -0
  113. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +51 -0
  114. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +33 -0
  115. package/build/__tests__/testDirsAndFiles/one-good-store-skill/src/.spruce/settings.json +6 -0
  116. package/build/__tests__/testDirsAndFiles/skill/build/.spruce/views/views.js +18 -0
  117. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +5 -0
  118. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +11 -0
  119. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +7 -0
  120. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +19 -0
  121. package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +8 -0
  122. package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +31 -0
  123. package/build/__tests__/testDirsAndFiles/skill/package.json +5 -0
  124. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/settings.json +6 -0
  125. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.d.ts +7 -0
  126. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.js +16 -0
  127. package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +5 -0
  128. package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +11 -0
  129. package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +8 -0
  130. package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +31 -0
  131. package/build/esm/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.d.ts +7 -0
  132. package/build/esm/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +53 -0
  133. package/build/esm/__tests__/behavioral/DatabaseFixture.test.d.ts +7 -0
  134. package/build/esm/__tests__/behavioral/DatabaseFixture.test.js +48 -0
  135. package/build/esm/__tests__/behavioral/DbResetsAsExpected.test.d.ts +5 -0
  136. package/build/esm/__tests__/behavioral/DbResetsAsExpected.test.js +28 -0
  137. package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +15 -0
  138. package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +125 -0
  139. package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +4 -0
  140. package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +40 -0
  141. package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +5 -0
  142. package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +23 -0
  143. package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +8 -0
  144. package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +76 -0
  145. package/build/esm/__tests__/behavioral/DummyStore.d.ts +55 -0
  146. package/build/esm/__tests__/behavioral/DummyStore.js +43 -0
  147. package/build/esm/__tests__/behavioral/FakingEventResponses.test.d.ts +12 -0
  148. package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +147 -0
  149. package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +7 -0
  150. package/build/esm/__tests__/behavioral/FixtureFactory.test.js +61 -0
  151. package/build/esm/__tests__/behavioral/LocationFixture.test.d.ts +15 -0
  152. package/build/esm/__tests__/behavioral/LocationFixture.test.js +153 -0
  153. package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +12 -0
  154. package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +110 -0
  155. package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +4 -0
  156. package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +38 -0
  157. package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +19 -0
  158. package/build/esm/__tests__/behavioral/MercuryFixture.test.js +209 -0
  159. package/build/esm/__tests__/behavioral/OrganizationFixture.test.d.ts +31 -0
  160. package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +387 -0
  161. package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +4 -0
  162. package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +18 -0
  163. package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +22 -0
  164. package/build/esm/__tests__/behavioral/PersonFixture.test.js +231 -0
  165. package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +11 -0
  166. package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +112 -0
  167. package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +8 -0
  168. package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +80 -0
  169. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +5 -0
  170. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +51 -0
  171. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +7 -0
  172. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +59 -0
  173. package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +10 -0
  174. package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +139 -0
  175. package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +7 -0
  176. package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +57 -0
  177. package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +6 -0
  178. package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +48 -0
  179. package/build/esm/__tests__/behavioral/RoleFixture.test.d.ts +15 -0
  180. package/build/esm/__tests__/behavioral/RoleFixture.test.js +143 -0
  181. package/build/esm/__tests__/behavioral/SeedingData.test.d.ts +24 -0
  182. package/build/esm/__tests__/behavioral/SeedingData.test.js +314 -0
  183. package/build/esm/__tests__/behavioral/SkillFixture.test.d.ts +13 -0
  184. package/build/esm/__tests__/behavioral/SkillFixture.test.js +139 -0
  185. package/build/esm/__tests__/behavioral/StoreFixture.test.d.ts +23 -0
  186. package/build/esm/__tests__/behavioral/StoreFixture.test.js +164 -0
  187. package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +9 -0
  188. package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +87 -0
  189. package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +45 -0
  190. package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +479 -0
  191. package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +4 -0
  192. package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +28 -0
  193. package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +4 -0
  194. package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +32 -0
  195. package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +8 -0
  196. package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +82 -0
  197. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +8 -0
  198. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +70 -0
  199. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +14 -0
  200. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +165 -0
  201. package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +6 -0
  202. package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +55 -0
  203. package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +19 -0
  204. package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +175 -0
  205. package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +24 -0
  206. package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +214 -0
  207. package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.d.ts +4 -0
  208. package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +38 -0
  209. package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +35 -0
  210. package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +360 -0
  211. package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +4 -0
  212. package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +31 -0
  213. package/build/esm/__tests__/behavioral/faking/WhoAmI.test.d.ts +19 -0
  214. package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +140 -0
  215. package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +10 -0
  216. package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +94 -0
  217. package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +37 -0
  218. package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +322 -0
  219. package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +14 -0
  220. package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +134 -0
  221. package/build/esm/__tests__/behavioral/views/CheckingPermissions.test.d.ts +24 -0
  222. package/build/esm/__tests__/behavioral/views/CheckingPermissions.test.js +200 -0
  223. package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +12 -0
  224. package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +69 -0
  225. package/build/esm/__tests__/behavioral/views/Routing.test.d.ts +31 -0
  226. package/build/esm/__tests__/behavioral/views/Routing.test.js +169 -0
  227. package/build/esm/__tests__/behavioral/views/TestingScope.test.d.ts +9 -0
  228. package/build/esm/__tests__/behavioral/views/TestingScope.test.js +84 -0
  229. package/build/esm/__tests__/behavioral/views/ViewFixture.test.d.ts +102 -0
  230. package/build/esm/__tests__/behavioral/views/ViewFixture.test.js +731 -0
  231. package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +11 -0
  232. package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +63 -0
  233. package/build/esm/__tests__/support/AbstractFakeDecoratorTest.d.ts +5 -0
  234. package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +34 -0
  235. package/build/esm/__tests__/support/EventFaker.d.ts +5 -0
  236. package/build/esm/__tests__/support/EventFaker.js +45 -0
  237. package/build/esm/__tests__/support/FakeThemeManager.d.ts +8 -0
  238. package/build/esm/__tests__/support/FakeThemeManager.js +37 -0
  239. package/build/esm/__tests__/test.types.d.ts +2 -0
  240. package/build/esm/__tests__/test.types.js +1 -0
  241. package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +51 -0
  242. package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +41 -0
  243. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +5 -0
  244. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +8 -0
  245. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +7 -0
  246. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +27 -0
  247. package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +8 -0
  248. package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +25 -0
  249. package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +5 -0
  250. package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +8 -0
  251. package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +8 -0
  252. package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +25 -0
  253. package/build/esm/index.d.ts +1 -0
  254. package/build/esm/index.js +1 -0
  255. package/build/esm/tests/fixtures/ViewFixture.d.ts +1 -0
  256. package/build/esm/tests/fixtures/ViewFixture.js +4 -1
  257. package/build/esm/tests/routers/TestRouter.d.ts +3 -0
  258. package/build/esm/tests/routers/TestRouter.js +6 -0
  259. package/build/esm/utilities/vcDisk.utility.js +1 -0
  260. package/build/index.d.ts +1 -0
  261. package/build/index.js +3 -1
  262. package/build/tests/fixtures/ViewFixture.d.ts +1 -0
  263. package/build/tests/fixtures/ViewFixture.js +4 -1
  264. package/build/tests/routers/TestRouter.d.ts +3 -0
  265. package/build/tests/routers/TestRouter.js +6 -0
  266. package/build/utilities/vcDisk.utility.js +1 -0
  267. package/package.json +5 -5
@@ -0,0 +1,175 @@
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 mercury_core_events_1 = require("@sprucelabs/mercury-core-events");
13
+ const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
14
+ const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
15
+ const test_1 = require("@sprucelabs/test");
16
+ const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
17
+ const FixtureFactory_1 = __importDefault(require("../../tests/fixtures/FixtureFactory"));
18
+ const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
19
+ class MercuryFixtureTest extends AbstractSpruceFixtureTest_1.default {
20
+ static async beforeEach() {
21
+ await super.beforeEach();
22
+ this.fixture = this.Fixture('mercury');
23
+ }
24
+ static async hasDefaultContractByDefault() {
25
+ const client = await this.fixture.connectToApi();
26
+ //@ts-ignore
27
+ test_1.assert.isTruthy(client.eventContract);
28
+ //@ts-ignore
29
+ test_1.assert.isEqual(client.eventContract, mercury_core_events_1.coreEventContracts[0]);
30
+ }
31
+ static async canGetMoreThanOneClient() {
32
+ await this.fixture.connectToApi({ shouldReUseClient: false });
33
+ await this.fixture.connectToApi({ shouldReUseClient: false });
34
+ }
35
+ static async canCreateMercuryFixture() {
36
+ test_1.assert.isTruthy(this.fixture);
37
+ }
38
+ static async returnsConnectedClient() {
39
+ const client = await this.fixture.connectToApi();
40
+ test_1.assert.isTrue(client.isConnected());
41
+ await client.disconnect();
42
+ }
43
+ static async returnsSameClientOnSecondConnect() {
44
+ const client = await this.fixture.connectToApi();
45
+ //@ts-ignore
46
+ client.__monkeyPatch = true;
47
+ const client2 = await this.fixture.connectToApi();
48
+ //@ts-ignore
49
+ test_1.assert.isTrue(client2.__monkeyPatch);
50
+ await client.disconnect();
51
+ test_1.assert.isFalse(client2.isConnected());
52
+ }
53
+ static async importsContractIfLocalOneIsGenerated(sigs) {
54
+ this.createDirWriteContractFileAndSetCwd(sigs);
55
+ const client = await this.connectToApi();
56
+ //@ts-ignore
57
+ test_1.assert.isTruthy(client.eventContract);
58
+ test_1.assert.doesInclude(
59
+ //@ts-ignore
60
+ client.eventContract.eventSignatures, sigs[0].eventSignatures);
61
+ spruce_event_utils_1.eventContractUtil.getSignatureByName(
62
+ //@ts-ignore
63
+ client.eventContract, 'add-role::v2020_12_25');
64
+ }
65
+ static async beforeEachResetsBackToSavedContract() {
66
+ this.createDirWriteContractFileAndSetCwd([
67
+ {
68
+ eventSignatures: {
69
+ ['new-event']: true,
70
+ },
71
+ },
72
+ ]);
73
+ const client = (await this.connectToApi());
74
+ await MercuryFixture_1.default.beforeEach(this.cwd);
75
+ await client.on('new-event', () => { });
76
+ }
77
+ static async typesTestProperly() {
78
+ const test = () => {
79
+ return {};
80
+ };
81
+ const value = test();
82
+ test_1.assert.isTruthy(value);
83
+ }
84
+ static async canSetDefaultClient() {
85
+ test_1.assert.isFunction(MercuryFixture_1.default.setDefaultClient);
86
+ const client = await this.connectToApi();
87
+ MercuryFixture_1.default.setDefaultClient(client);
88
+ test_1.assert.isEqual(MercuryFixture_1.default.getDefaultClient(), client);
89
+ }
90
+ static async allClientsGoingForwardUseThatClient() {
91
+ const client = await this.connectToApi();
92
+ MercuryFixture_1.default.setDefaultClient(client);
93
+ const client2 = await this.connectToApi();
94
+ test_1.assert.isEqual(client, client2);
95
+ }
96
+ static async resetsDefaultClientBeforeEach() {
97
+ const client = await this.connectToApi();
98
+ MercuryFixture_1.default.setDefaultClient(client);
99
+ await MercuryFixture_1.default.beforeEach(this.cwd);
100
+ const client2 = await this.connectToApi();
101
+ test_1.assert.isNotEqual(client, client2);
102
+ }
103
+ static async canForceNewClient() {
104
+ const client = await this.connectToApi();
105
+ MercuryFixture_1.default.setDefaultClient(client);
106
+ const client2 = await this.Fixture('mercury').connectToApi({
107
+ shouldReUseClient: false,
108
+ });
109
+ test_1.assert.isNotEqual(client, client2);
110
+ }
111
+ static async connectToApi(options) {
112
+ return await new FixtureFactory_1.default({ cwd: this.cwd })
113
+ .Fixture('mercury')
114
+ .connectToApi(options);
115
+ }
116
+ static createDirWriteContractFileAndSetCwd(sigs) {
117
+ this.cwd = spruce_skill_utils_1.diskUtil.createRandomTempDir();
118
+ const destination = spruce_skill_utils_1.diskUtil.resolvePath(this.cwd, spruce_skill_utils_1.HASH_SPRUCE_BUILD_DIR, 'events/events.contract.js');
119
+ const contents = `exports["default"] = ${JSON.stringify([
120
+ ...mercury_core_events_1.coreEventContracts,
121
+ ...sigs,
122
+ ])};`;
123
+ spruce_skill_utils_1.diskUtil.writeFile(destination, contents);
124
+ }
125
+ }
126
+ __decorate([
127
+ (0, test_1.test)()
128
+ ], MercuryFixtureTest, "hasDefaultContractByDefault", null);
129
+ __decorate([
130
+ (0, test_1.test)()
131
+ ], MercuryFixtureTest, "canGetMoreThanOneClient", null);
132
+ __decorate([
133
+ (0, test_1.test)()
134
+ ], MercuryFixtureTest, "canCreateMercuryFixture", null);
135
+ __decorate([
136
+ (0, test_1.test)()
137
+ ], MercuryFixtureTest, "returnsConnectedClient", null);
138
+ __decorate([
139
+ (0, test_1.test)()
140
+ ], MercuryFixtureTest, "returnsSameClientOnSecondConnect", null);
141
+ __decorate([
142
+ (0, test_1.test)('auto imports signature 1', [
143
+ {
144
+ eventSignatures: {
145
+ ['taco-bravo']: true,
146
+ },
147
+ },
148
+ ]),
149
+ (0, test_1.test)('auto imports signature 2', [
150
+ {
151
+ eventSignatures: {
152
+ ['taco-bravo2']: true,
153
+ },
154
+ },
155
+ ])
156
+ ], MercuryFixtureTest, "importsContractIfLocalOneIsGenerated", null);
157
+ __decorate([
158
+ (0, test_1.test)()
159
+ ], MercuryFixtureTest, "beforeEachResetsBackToSavedContract", null);
160
+ __decorate([
161
+ (0, test_1.test)()
162
+ ], MercuryFixtureTest, "typesTestProperly", null);
163
+ __decorate([
164
+ (0, test_1.test)()
165
+ ], MercuryFixtureTest, "canSetDefaultClient", null);
166
+ __decorate([
167
+ (0, test_1.test)()
168
+ ], MercuryFixtureTest, "allClientsGoingForwardUseThatClient", null);
169
+ __decorate([
170
+ (0, test_1.test)()
171
+ ], MercuryFixtureTest, "resetsDefaultClientBeforeEach", null);
172
+ __decorate([
173
+ (0, test_1.test)()
174
+ ], MercuryFixtureTest, "canForceNewClient", null);
175
+ exports.default = MercuryFixtureTest;
@@ -0,0 +1,31 @@
1
+ import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
2
+ import { RoleBase } from '../../types/fixture.types';
3
+ export default class OrganizationFixtureTest extends AbstractSpruceFixtureTest {
4
+ protected static canCreateOrganizationFixture(): Promise<void>;
5
+ protected static canSeedOrg(): Promise<void>;
6
+ protected static orgFixtureDestroysOrgs(): Promise<void>;
7
+ protected static isNotPartOfOrgtoStart(): Promise<void>;
8
+ protected static updatingBadOrgTHrows(): Promise<void>;
9
+ protected static canUpdateOrg(): Promise<void>;
10
+ protected static canUpdateOrgAddress(): Promise<void>;
11
+ protected static canMakeOrgPublicAndPrivate(): Promise<void>;
12
+ protected static canAddPersonToOrg(base: RoleBase): Promise<void>;
13
+ private static isPersonPartOfOrg;
14
+ protected static isNotInstalledByDefault(): Promise<void>;
15
+ protected static showsAsInstalled(): Promise<void>;
16
+ protected static cantInstallWithBadSkill(): Promise<void>;
17
+ protected static canInstallWithSlug(): Promise<void>;
18
+ protected static canInstallSkillFromAnotherPerson(): Promise<void>;
19
+ protected static canDeleteAllExistingOrgs(): Promise<void>;
20
+ protected static passesThroughAllFieldsToRequest(): Promise<void>;
21
+ protected static canPassPersonFixture(): void;
22
+ protected static canSeedOrgWithNoOptions(): Promise<void>;
23
+ protected static removePersonThrowsWithBadIds(): Promise<void>;
24
+ protected static canRemovePersonFromOrg(roleBase: RoleBase): Promise<void>;
25
+ private static Org;
26
+ private static seedOrgAndHirePerson;
27
+ private static assertSkillIsInstalled;
28
+ private static seedOrgAndSkill;
29
+ private static assertOrgIsPublicValue;
30
+ private static setAndAssertOrgIsPublic;
31
+ }
@@ -0,0 +1,331 @@
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_1 = require("@sprucelabs/test");
16
+ const test_utils_1 = 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_1.assert.isTruthy(this.organizations);
23
+ }
24
+ static async canSeedOrg() {
25
+ const org = await this.organizations.seedDemoOrganization({
26
+ name: 'my org',
27
+ });
28
+ test_1.assert.isTruthy(org);
29
+ test_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_1.assert.isFalse(isHired);
52
+ }
53
+ static async updatingBadOrgTHrows() {
54
+ await test_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_1.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_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_1.generateId)(),
76
+ country: (0, test_utils_1.generateId)(),
77
+ province: (0, test_utils_1.generateId)(),
78
+ street1: (0, test_utils_1.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_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_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_1.assert.isLength(roles, 1);
107
+ test_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_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_1.assert.doesThrowAsync(() => this.organizations.installSkillsByNamespace({
128
+ organizationId: org.id,
129
+ namespaces: ['aoeuaoeu'],
130
+ }));
131
+ test_utils_1.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_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_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', { people: personFixture });
190
+ //@ts-ignore
191
+ test_1.assert.isEqual(orgFixture.people, personFixture);
192
+ }
193
+ static async canSeedOrgWithNoOptions() {
194
+ const org = await this.Fixture('organization').seedDemoOrganization();
195
+ test_1.assert.isTruthy(org);
196
+ }
197
+ static async removePersonThrowsWithBadIds() {
198
+ await test_1.assert.doesThrowAsync(() => this.organizations.removePerson({
199
+ phone: constants_1.DEMO_NUMBER_HIRING,
200
+ roleBase: 'guest',
201
+ organizationId: 'aoeu',
202
+ personId: 'aoeu',
203
+ }));
204
+ }
205
+ static async canRemovePersonFromOrg(roleBase) {
206
+ const { person, org } = await this.seedOrgAndHirePerson(roleBase);
207
+ await this.organizations.removePerson({
208
+ phone: constants_1.DEMO_NUMBER_HIRING,
209
+ roleBase,
210
+ organizationId: org.id,
211
+ personId: person.id,
212
+ });
213
+ const isHired = await this.isPersonPartOfOrg(person.id, org.id);
214
+ test_1.assert.isFalse(isHired);
215
+ }
216
+ static async Org() {
217
+ return await this.organizations.seedDemoOrganization({
218
+ name: 'my org',
219
+ phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
220
+ });
221
+ }
222
+ static async seedOrgAndHirePerson(base) {
223
+ const org = await this.organizations.seedDemoOrganization({
224
+ name: 'my org',
225
+ phone: constants_1.DEMO_NUMBER_HIRING,
226
+ });
227
+ const { person } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER);
228
+ await this.organizations.addPerson({
229
+ personId: person.id,
230
+ organizationId: org.id,
231
+ roleBase: base,
232
+ phone: constants_1.DEMO_NUMBER_HIRING,
233
+ });
234
+ return { person, org };
235
+ }
236
+ static async assertSkillIsInstalled(skillId, orgId) {
237
+ const isInstalled = await this.organizations.isSkillInstalled(skillId, orgId);
238
+ test_1.assert.isTrue(isInstalled);
239
+ }
240
+ static async seedOrgAndSkill() {
241
+ const skill = await this.skills.seedDemoSkill({
242
+ name: 'testing testy',
243
+ });
244
+ const org = await this.organizations.seedDemoOrganization({
245
+ name: 'my org',
246
+ });
247
+ return { skill, org };
248
+ }
249
+ static async assertOrgIsPublicValue(orgId, expected) {
250
+ const org = await this.organizations.getOrganizationById(orgId);
251
+ if (expected) {
252
+ test_1.assert.isTrue(org.isPublic);
253
+ }
254
+ else {
255
+ test_1.assert.isFalsy(org.isPublic);
256
+ }
257
+ }
258
+ static async setAndAssertOrgIsPublic(orgId, isPublic) {
259
+ await this.organizations.updateOrganization(orgId, {
260
+ isPublic,
261
+ phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
262
+ });
263
+ await this.assertOrgIsPublicValue(orgId, isPublic);
264
+ }
265
+ };
266
+ __decorate([
267
+ (0, test_1.test)()
268
+ ], OrganizationFixtureTest, "canCreateOrganizationFixture", null);
269
+ __decorate([
270
+ (0, test_1.test)()
271
+ ], OrganizationFixtureTest, "canSeedOrg", null);
272
+ __decorate([
273
+ (0, test_1.test)()
274
+ ], OrganizationFixtureTest, "orgFixtureDestroysOrgs", null);
275
+ __decorate([
276
+ (0, test_1.test)()
277
+ ], OrganizationFixtureTest, "isNotPartOfOrgtoStart", null);
278
+ __decorate([
279
+ (0, test_1.test)()
280
+ ], OrganizationFixtureTest, "updatingBadOrgTHrows", null);
281
+ __decorate([
282
+ (0, test_1.test)()
283
+ ], OrganizationFixtureTest, "canUpdateOrg", null);
284
+ __decorate([
285
+ (0, test_1.test)()
286
+ ], OrganizationFixtureTest, "canUpdateOrgAddress", null);
287
+ __decorate([
288
+ (0, test_1.test)()
289
+ ], OrganizationFixtureTest, "canMakeOrgPublicAndPrivate", null);
290
+ __decorate([
291
+ (0, test_1.test)('can add as guest', 'guest'),
292
+ (0, test_1.test)('can add as teammate', 'teammate')
293
+ ], OrganizationFixtureTest, "canAddPersonToOrg", null);
294
+ __decorate([
295
+ (0, test_1.test)()
296
+ ], OrganizationFixtureTest, "isNotInstalledByDefault", null);
297
+ __decorate([
298
+ (0, test_1.test)()
299
+ ], OrganizationFixtureTest, "showsAsInstalled", null);
300
+ __decorate([
301
+ (0, test_1.test)()
302
+ ], OrganizationFixtureTest, "cantInstallWithBadSkill", null);
303
+ __decorate([
304
+ (0, test_1.test)()
305
+ ], OrganizationFixtureTest, "canInstallWithSlug", null);
306
+ __decorate([
307
+ (0, test_1.test)()
308
+ ], OrganizationFixtureTest, "canInstallSkillFromAnotherPerson", null);
309
+ __decorate([
310
+ (0, test_1.test)()
311
+ ], OrganizationFixtureTest, "canDeleteAllExistingOrgs", null);
312
+ __decorate([
313
+ (0, test_1.test)()
314
+ ], OrganizationFixtureTest, "passesThroughAllFieldsToRequest", null);
315
+ __decorate([
316
+ (0, test_1.test)()
317
+ ], OrganizationFixtureTest, "canPassPersonFixture", null);
318
+ __decorate([
319
+ (0, test_1.test)()
320
+ ], OrganizationFixtureTest, "canSeedOrgWithNoOptions", null);
321
+ __decorate([
322
+ (0, test_1.test)()
323
+ ], OrganizationFixtureTest, "removePersonThrowsWithBadIds", null);
324
+ __decorate([
325
+ (0, test_1.test)('can remove guest', 'guest'),
326
+ (0, test_1.test)('can remove teammate', 'teammate')
327
+ ], OrganizationFixtureTest, "canRemovePersonFromOrg", null);
328
+ OrganizationFixtureTest = __decorate([
329
+ fake_1.default.login()
330
+ ], OrganizationFixtureTest);
331
+ exports.default = OrganizationFixtureTest;
@@ -0,0 +1,4 @@
1
+ import { AbstractSpruceFixtureTest } from '../..';
2
+ export default class PatchingConsoleErrorToErrorStreamTest extends AbstractSpruceFixtureTest {
3
+ protected static patchesConsoleError(): void;
4
+ }
@@ -0,0 +1,21 @@
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_1 = require("@sprucelabs/test");
11
+ const __1 = require("../..");
12
+ class PatchingConsoleErrorToErrorStreamTest extends __1.AbstractSpruceFixtureTest {
13
+ static patchesConsoleError() {
14
+ test_1.assert.isEqual(console.error, spruce_skill_utils_1.testLog.error);
15
+ console.error('Should write to console');
16
+ }
17
+ }
18
+ __decorate([
19
+ (0, test_1.test)()
20
+ ], PatchingConsoleErrorToErrorStreamTest, "patchesConsoleError", null);
21
+ exports.default = PatchingConsoleErrorToErrorStreamTest;
@@ -0,0 +1,22 @@
1
+ import AbstractSpruceTest from '@sprucelabs/test';
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
+ }