@sprucelabs/spruce-test-fixtures 45.2.9 → 46.0.2

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 +19 -19
@@ -0,0 +1,125 @@
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_event_utils_1 = require("@sprucelabs/spruce-event-utils");
13
+ const test_1 = require("@sprucelabs/test");
14
+ const __1 = require("../..");
15
+ const SpruceError_1 = __importDefault(require("../../errors/SpruceError"));
16
+ const eventFaker_1 = __importDefault(require("../../tests/eventFaker"));
17
+ class FakingErrorResponsesTest extends __1.AbstractSpruceFixtureTest {
18
+ static async beforeEach() {
19
+ await super.beforeEach();
20
+ this.client = (await this.mercury.connectToApi());
21
+ }
22
+ static async throwsWhenFakingResponse(fqen, targetAndPayload) {
23
+ await eventFaker_1.default.makeEventThrow(fqen);
24
+ await this.assertResponseIsFakeEventError(fqen, targetAndPayload);
25
+ }
26
+ static async onClearsPreviousListeners(fqen) {
27
+ let wasOldHit = false;
28
+ let wasNewHit = false;
29
+ if (!this.client.doesHandleEvent(fqen)) {
30
+ this.client.mixinContract({
31
+ eventSignatures: {
32
+ [fqen]: {},
33
+ },
34
+ });
35
+ }
36
+ await this.client.on(fqen, () => {
37
+ wasOldHit = true;
38
+ });
39
+ await eventFaker_1.default.on(fqen, () => {
40
+ wasNewHit = true;
41
+ return {
42
+ auth: {},
43
+ type: 'anonymous',
44
+ };
45
+ });
46
+ test_1.assert.isFalse(wasNewHit);
47
+ await this.client.emit(fqen);
48
+ test_1.assert.isFalse(wasOldHit);
49
+ test_1.assert.isTrue(wasNewHit);
50
+ }
51
+ static async throwsEvenWhenFakingWithPreviousListeners() {
52
+ //@ts-ignore
53
+ await this.client.on('whoami::v2020_12_25', async () => {
54
+ return {};
55
+ });
56
+ await eventFaker_1.default.makeEventThrow('whoami::v2020_12_25');
57
+ await this.assertResponseIsFakeEventError('whoami::v2020_12_25');
58
+ }
59
+ static async fakeEventsAreClearedFromPreviousTest() {
60
+ await this.client.on('request-pin::v2020_12_25', async () => {
61
+ return {
62
+ challenge: 'aoeu',
63
+ };
64
+ });
65
+ await this.client.emitAndFlattenResponses('request-pin::v2020_12_25', {
66
+ payload: {
67
+ phone: '+555-000-0001',
68
+ },
69
+ });
70
+ }
71
+ static async canFakeEventWithNoResponse() {
72
+ const fqen = 'test-burrito::v1';
73
+ this.client.mixinContract({
74
+ eventSignatures: {
75
+ [fqen]: {
76
+ isGlobal: true,
77
+ },
78
+ },
79
+ });
80
+ await eventFaker_1.default.handleReactiveEvent(fqen);
81
+ const results = await this.client.emit(fqen);
82
+ test_1.assert.isEqual(results.totalErrors, 0);
83
+ }
84
+ static async canCustomizeTheErrorPassedIn() {
85
+ var _a;
86
+ const error = new SpruceError_1.default({
87
+ code: 'INVALID_TARGET',
88
+ });
89
+ await eventFaker_1.default.makeEventThrow('whoami::v2020_12_25', error);
90
+ const results = await this.client.emit('whoami::v2020_12_25');
91
+ test_1.assert.isEqualDeep((_a = results.responses[0].errors) === null || _a === void 0 ? void 0 : _a[0], error);
92
+ }
93
+ static async assertResponseIsFakeEventError(fqen, targetAndPayload) {
94
+ const results = await this.client.emit(fqen, targetAndPayload);
95
+ test_1.assert.isEqual(results.totalErrors, 1);
96
+ spruce_event_utils_1.eventAssertUtil.assertErrorFromResponse(results, 'FAKE_EVENT_ERROR', {
97
+ fqen,
98
+ });
99
+ }
100
+ }
101
+ __decorate([
102
+ (0, test_1.test)('faking whoami::v2020_12_25', 'whoami::v2020_12_25'),
103
+ (0, test_1.test)('faking request-pin::v2020_12_25', 'request-pin::v2020_12_25', {
104
+ payload: {
105
+ phone: '+555-000-0001',
106
+ },
107
+ })
108
+ ], FakingErrorResponsesTest, "throwsWhenFakingResponse", null);
109
+ __decorate([
110
+ (0, test_1.test)('on clears previous listeners 1', 'whoami::v2020_12_25'),
111
+ (0, test_1.test)('on clears previous listeners 2', 'what-the::v2020_12_25')
112
+ ], FakingErrorResponsesTest, "onClearsPreviousListeners", null);
113
+ __decorate([
114
+ (0, test_1.test)()
115
+ ], FakingErrorResponsesTest, "throwsEvenWhenFakingWithPreviousListeners", null);
116
+ __decorate([
117
+ (0, test_1.test)()
118
+ ], FakingErrorResponsesTest, "fakeEventsAreClearedFromPreviousTest", null);
119
+ __decorate([
120
+ (0, test_1.test)()
121
+ ], FakingErrorResponsesTest, "canFakeEventWithNoResponse", null);
122
+ __decorate([
123
+ (0, test_1.test)()
124
+ ], FakingErrorResponsesTest, "canCustomizeTheErrorPassedIn", null);
125
+ exports.default = FakingErrorResponsesTest;
@@ -0,0 +1,7 @@
1
+ import AbstractSpruceTest from '@sprucelabs/test';
2
+ export default class FixtureFactoryTest extends AbstractSpruceTest {
3
+ protected static throwsWithBadFixture(): void;
4
+ protected static getsFixture(name: string, Class: any): void;
5
+ private static Fixture;
6
+ protected static destroyDisconnectsClient(): Promise<void>;
7
+ }
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || function (mod) {
25
+ if (mod && mod.__esModule) return mod;
26
+ var result = {};
27
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
+ __setModuleDefault(result, mod);
29
+ return result;
30
+ };
31
+ var __importDefault = (this && this.__importDefault) || function (mod) {
32
+ return (mod && mod.__esModule) ? mod : { "default": mod };
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ const test_1 = __importStar(require("@sprucelabs/test"));
36
+ const test_utils_1 = require("@sprucelabs/test-utils");
37
+ const FixtureFactory_1 = __importDefault(require("../../tests/fixtures/FixtureFactory"));
38
+ const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
39
+ const OrganizationFixture_1 = __importDefault(require("../../tests/fixtures/OrganizationFixture"));
40
+ const PersonFixture_1 = __importDefault(require("../../tests/fixtures/PersonFixture"));
41
+ const SkillFixture_1 = __importDefault(require("../../tests/fixtures/SkillFixture"));
42
+ class FixtureFactoryTest extends test_1.default {
43
+ static throwsWithBadFixture() {
44
+ //@ts-ignore
45
+ const err = test_1.assert.doesThrow(() => this.Fixture().Fixture('taco'));
46
+ test_utils_1.errorAssert.assertError(err, 'INVALID_FIXTURE', {
47
+ suppliedName: 'taco',
48
+ });
49
+ }
50
+ static getsFixture(name, Class) {
51
+ //@ts-ignore
52
+ const fixture = this.Fixture().Fixture(name);
53
+ test_1.assert.isTrue(fixture instanceof Class);
54
+ }
55
+ static Fixture() {
56
+ return new FixtureFactory_1.default({ cwd: this.cwd });
57
+ }
58
+ static async destroyDisconnectsClient() {
59
+ const { client } = await this.Fixture()
60
+ .Fixture('person')
61
+ .loginAsDemoPerson();
62
+ test_1.assert.isTrue(client.isConnected());
63
+ await FixtureFactory_1.default.destroy();
64
+ test_1.assert.isFalse(client.isConnected());
65
+ }
66
+ }
67
+ __decorate([
68
+ (0, test_1.test)()
69
+ ], FixtureFactoryTest, "throwsWithBadFixture", null);
70
+ __decorate([
71
+ (0, test_1.test)('person fixture', 'person', PersonFixture_1.default),
72
+ (0, test_1.test)('mercury fixture', 'mercury', MercuryFixture_1.default),
73
+ (0, test_1.test)('org fixture', 'organization', OrganizationFixture_1.default),
74
+ (0, test_1.test)('skill fixture', 'skill', SkillFixture_1.default)
75
+ ], FixtureFactoryTest, "getsFixture", null);
76
+ __decorate([
77
+ (0, test_1.test)()
78
+ ], FixtureFactoryTest, "destroyDisconnectsClient", null);
79
+ exports.default = FixtureFactoryTest;
@@ -0,0 +1,15 @@
1
+ import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
2
+ export default class LocationFixtureTest extends AbstractSpruceFixtureTest {
3
+ protected static beforeEach(): Promise<void>;
4
+ protected static canCreateWithSpecificOrg(): Promise<void>;
5
+ protected static canCreatLocationWithNoParams(): Promise<void>;
6
+ protected static isNotPartOfLocationToStart(): Promise<void>;
7
+ protected static canAddPersonToLocation(): Promise<void>;
8
+ protected static throwsWhenTryingToRemovePersonWithBadIds(): Promise<void>;
9
+ protected static canRemoveRole(): Promise<void>;
10
+ private static isPersonPartOfLocation;
11
+ protected static seedLocationAndAddPerson(): Promise<{
12
+ location: import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/mercury-types").SpruceSchemas.Spruce.v2020_07_22.LocationSchema, false, import("@sprucelabs/schema").SchemaOptionalFieldNames<import("@sprucelabs/mercury-types").SpruceSchemas.Spruce.v2020_07_22.LocationSchema>, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/mercury-types").SpruceSchemas.Spruce.v2020_07_22.LocationSchema, false>>;
13
+ person: import("@sprucelabs/mercury-types").SpruceSchemas.Spruce.v2020_07_22.Person;
14
+ }>;
15
+ }
@@ -0,0 +1,128 @@
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
+ var LocationFixtureTest_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ const test_1 = require("@sprucelabs/test");
14
+ const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
15
+ const constants_1 = require("../../tests/constants");
16
+ const fake_1 = __importDefault(require("../../tests/decorators/fake"));
17
+ let LocationFixtureTest = LocationFixtureTest_1 = class LocationFixtureTest extends AbstractSpruceFixtureTest_1.default {
18
+ static async beforeEach() {
19
+ await super.beforeEach();
20
+ await this.seeder.resetAccount();
21
+ await this.seeder.resetAccount(constants_1.DEMO_NUMBER_LOCATION_FIXTURE_OUTSIDER);
22
+ }
23
+ static async canCreateWithSpecificOrg() {
24
+ const org = await this.organizations.seedDemoOrganization({
25
+ name: 'Location fixture org',
26
+ });
27
+ const location = await this.locations.seedDemoLocation({
28
+ name: 'Location fixture location',
29
+ organizationId: org.id,
30
+ });
31
+ test_1.assert.isEqual(org.id, location.organizationId);
32
+ }
33
+ static async canCreatLocationWithNoParams() {
34
+ const location = await this.locations.seedDemoLocation({});
35
+ test_1.assert.isTruthy(location);
36
+ }
37
+ static async isNotPartOfLocationToStart() {
38
+ const location = await this.locations.seedDemoLocation({
39
+ name: 'Location fixture location',
40
+ });
41
+ const { person } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER_LOCATION_FIXTURE_OUTSIDER);
42
+ const isHired = await this.locations.isPartOfLocation({
43
+ personId: person.id,
44
+ locationId: location.id,
45
+ phone: constants_1.DEMO_NUMBER_LOCATION_FIXTURE,
46
+ });
47
+ test_1.assert.isFalse(isHired);
48
+ }
49
+ static async canAddPersonToLocation() {
50
+ const { person, location } = await this.seedLocationAndAddPerson();
51
+ const isHired = await LocationFixtureTest_1.isPersonPartOfLocation(person.id, location.id);
52
+ test_1.assert.isTrue(isHired);
53
+ }
54
+ static async throwsWhenTryingToRemovePersonWithBadIds() {
55
+ await test_1.assert.doesThrowAsync(() => this.locations.removePerson({
56
+ phone: constants_1.DEMO_NUMBER_LOCATION_FIXTURE,
57
+ personId: 'aoeu',
58
+ locationId: 'aoeu',
59
+ roleBase: 'test',
60
+ organizationId: '234',
61
+ }));
62
+ }
63
+ static async canRemoveRole() {
64
+ const { person, location } = await this.seedLocationAndAddPerson();
65
+ await this.locations.removePerson({
66
+ phone: constants_1.DEMO_NUMBER_LOCATION_FIXTURE,
67
+ personId: person.id,
68
+ locationId: location.id,
69
+ organizationId: location.organizationId,
70
+ roleBase: 'guest',
71
+ });
72
+ const isHired = await this.isPersonPartOfLocation(person.id, location.id);
73
+ test_1.assert.isFalse(isHired);
74
+ }
75
+ static async isPersonPartOfLocation(personId, locationId) {
76
+ return await this.locations.isPartOfLocation({
77
+ phone: constants_1.DEMO_NUMBER_LOCATION_FIXTURE,
78
+ personId,
79
+ locationId,
80
+ });
81
+ }
82
+ static async seedLocationAndAddPerson() {
83
+ const org = await this.organizations.seedDemoOrganization({
84
+ name: 'Location fixture org',
85
+ phone: constants_1.DEMO_NUMBER_LOCATION_FIXTURE,
86
+ });
87
+ await this.organizations.seedDemoOrganization({
88
+ name: 'Outside org',
89
+ phone: constants_1.DEMO_NUMBER_LOCATION_FIXTURE_OUTSIDER,
90
+ });
91
+ const location = await this.locations.seedDemoLocation({
92
+ name: 'Location fixture location',
93
+ phone: constants_1.DEMO_NUMBER_LOCATION_FIXTURE,
94
+ organizationId: org.id,
95
+ });
96
+ const { person } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER_LOCATION_FIXTURE_OUTSIDER);
97
+ await this.locations.addPerson({
98
+ personId: person.id,
99
+ organizationId: org.id,
100
+ locationId: location.id,
101
+ roleBase: 'guest',
102
+ phone: constants_1.DEMO_NUMBER_LOCATION_FIXTURE,
103
+ });
104
+ return { location, person };
105
+ }
106
+ };
107
+ __decorate([
108
+ (0, test_1.test)()
109
+ ], LocationFixtureTest, "canCreateWithSpecificOrg", null);
110
+ __decorate([
111
+ (0, test_1.test)()
112
+ ], LocationFixtureTest, "canCreatLocationWithNoParams", null);
113
+ __decorate([
114
+ (0, test_1.test)()
115
+ ], LocationFixtureTest, "isNotPartOfLocationToStart", null);
116
+ __decorate([
117
+ (0, test_1.test)()
118
+ ], LocationFixtureTest, "canAddPersonToLocation", null);
119
+ __decorate([
120
+ (0, test_1.test)()
121
+ ], LocationFixtureTest, "throwsWhenTryingToRemovePersonWithBadIds", null);
122
+ __decorate([
123
+ (0, test_1.test)()
124
+ ], LocationFixtureTest, "canRemoveRole", null);
125
+ LocationFixtureTest = LocationFixtureTest_1 = __decorate([
126
+ fake_1.default.login(constants_1.DEMO_NUMBER_LOCATION_FIXTURE)
127
+ ], LocationFixtureTest);
128
+ exports.default = LocationFixtureTest;
@@ -0,0 +1,12 @@
1
+ import { AbstractSpruceFixtureTest } from '../..';
2
+ export default class LoginDecoratorHandlingProxiesForMeTest extends AbstractSpruceFixtureTest {
3
+ private static lastToken?;
4
+ protected static proxyTokenGeneratorReturnsExpectedProxyToken(expected: string): Promise<void>;
5
+ protected static onlyEmitsEventOnce(): Promise<void>;
6
+ protected static tokenSetBackAfterEachTest(): Promise<void>;
7
+ protected static tokenBackToOriginLoggedInPerson(): Promise<void>;
8
+ protected static loggingAnAsDemoPerson2AgainSetsValidProxy(): Promise<void>;
9
+ private static getDecorator;
10
+ private static generateToken;
11
+ private static loginAsSecondPerson;
12
+ }
@@ -0,0 +1,92 @@
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_event_utils_1 = require("@sprucelabs/spruce-event-utils");
13
+ const test_1 = require("@sprucelabs/test");
14
+ const __1 = require("../..");
15
+ const ClientProxyDecorator_1 = __importDefault(require("../../ClientProxyDecorator"));
16
+ const constants_1 = require("../../tests/constants");
17
+ let LoginDecoratorHandlingProxiesForMeTest = class LoginDecoratorHandlingProxiesForMeTest extends __1.AbstractSpruceFixtureTest {
18
+ static async proxyTokenGeneratorReturnsExpectedProxyToken(expected) {
19
+ await __1.login.getClient().on('register-proxy-token::v2020_12_25', () => {
20
+ return {
21
+ token: expected,
22
+ };
23
+ });
24
+ const token = await this.generateToken();
25
+ test_1.assert.isEqual(token, expected);
26
+ }
27
+ static async onlyEmitsEventOnce() {
28
+ let hitCount = 0;
29
+ await __1.login.getClient().on('register-proxy-token::v2020_12_25', () => {
30
+ hitCount++;
31
+ return {
32
+ token: 'aoeu',
33
+ };
34
+ });
35
+ const generator = this.getDecorator().getProxyTokenGenerator();
36
+ await (generator === null || generator === void 0 ? void 0 : generator());
37
+ test_1.assert.isEqual(hitCount, 0);
38
+ await (generator === null || generator === void 0 ? void 0 : generator());
39
+ await (generator === null || generator === void 0 ? void 0 : generator());
40
+ test_1.assert.isEqual(hitCount, 0);
41
+ }
42
+ static async tokenSetBackAfterEachTest() {
43
+ this.lastToken = await this.generateToken();
44
+ await this.loginAsSecondPerson();
45
+ const newToken = await this.generateToken();
46
+ test_1.assert.isNotEqual(this.lastToken, newToken);
47
+ }
48
+ static async tokenBackToOriginLoggedInPerson() {
49
+ const token = await this.generateToken();
50
+ test_1.assert.isEqual(this.lastToken, token);
51
+ }
52
+ static async loggingAnAsDemoPerson2AgainSetsValidProxy() {
53
+ const { client } = await this.loginAsSecondPerson();
54
+ const token = await this.generateToken();
55
+ const results = await client.emit('whoami::v2020_12_25', {
56
+ source: {
57
+ proxyToken: token,
58
+ },
59
+ });
60
+ spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
61
+ }
62
+ static getDecorator() {
63
+ return ClientProxyDecorator_1.default.getInstance();
64
+ }
65
+ static async generateToken() {
66
+ const generator = this.getDecorator().getProxyTokenGenerator();
67
+ const token = await (generator === null || generator === void 0 ? void 0 : generator());
68
+ return token;
69
+ }
70
+ static async loginAsSecondPerson() {
71
+ return this.Fixture('view').loginAsDemoPerson(constants_1.DEMO_NUMBER_LOGIN_DECORATOR_2);
72
+ }
73
+ };
74
+ __decorate([
75
+ (0, test_1.test)('proxy set to random', `${Math.random() * new Date().getTime()}`)
76
+ ], LoginDecoratorHandlingProxiesForMeTest, "proxyTokenGeneratorReturnsExpectedProxyToken", null);
77
+ __decorate([
78
+ (0, test_1.test)()
79
+ ], LoginDecoratorHandlingProxiesForMeTest, "onlyEmitsEventOnce", null);
80
+ __decorate([
81
+ (0, test_1.test)()
82
+ ], LoginDecoratorHandlingProxiesForMeTest, "tokenSetBackAfterEachTest", null);
83
+ __decorate([
84
+ (0, test_1.test)()
85
+ ], LoginDecoratorHandlingProxiesForMeTest, "tokenBackToOriginLoggedInPerson", null);
86
+ __decorate([
87
+ (0, test_1.test)()
88
+ ], LoginDecoratorHandlingProxiesForMeTest, "loggingAnAsDemoPerson2AgainSetsValidProxy", null);
89
+ LoginDecoratorHandlingProxiesForMeTest = __decorate([
90
+ (0, __1.login)(constants_1.DEMO_NUMBER_LOGIN_DECORATOR)
91
+ ], LoginDecoratorHandlingProxiesForMeTest);
92
+ exports.default = LoginDecoratorHandlingProxiesForMeTest;
@@ -0,0 +1,4 @@
1
+ import { AbstractSpruceFixtureTest } from '../..';
2
+ export default class MakingSureLocalEventsAreHandledLocallyTest extends AbstractSpruceFixtureTest {
3
+ protected static throwsWhenNoListenerSetForLocalEvent(): Promise<void>;
4
+ }
@@ -0,0 +1,29 @@
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 mercury_client_1 = require("@sprucelabs/mercury-client");
10
+ const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
11
+ const test_1 = require("@sprucelabs/test");
12
+ const __1 = require("../..");
13
+ const constants_1 = require("../../tests/constants");
14
+ let MakingSureLocalEventsAreHandledLocallyTest = class MakingSureLocalEventsAreHandledLocallyTest extends __1.AbstractSpruceFixtureTest {
15
+ static async throwsWhenNoListenerSetForLocalEvent() {
16
+ await this.SkillFromTestDir('skill');
17
+ const skill = await this.Fixture('skill').seedDemoSkill();
18
+ spruce_skill_utils_1.AuthService.Auth(this.cwd).updateCurrentSkill(skill);
19
+ await __1.MercuryFixture.beforeEach(this.cwd);
20
+ test_1.assert.isEqualDeep(mercury_client_1.MercuryTestClient.getNamespacesThatMustBeHandledLocally(), [skill.slug]);
21
+ }
22
+ };
23
+ __decorate([
24
+ (0, test_1.test)()
25
+ ], MakingSureLocalEventsAreHandledLocallyTest, "throwsWhenNoListenerSetForLocalEvent", null);
26
+ MakingSureLocalEventsAreHandledLocallyTest = __decorate([
27
+ (0, __1.login)(constants_1.DEMO_NUMBER_HANDLING_EVENTS_LOCALLY)
28
+ ], MakingSureLocalEventsAreHandledLocallyTest);
29
+ exports.default = MakingSureLocalEventsAreHandledLocallyTest;
@@ -0,0 +1,19 @@
1
+ import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
2
+ export default class MercuryFixtureTest extends AbstractSpruceFixtureTest {
3
+ private static fixture;
4
+ protected static beforeEach(): Promise<void>;
5
+ protected static hasDefaultContractByDefault(): Promise<void>;
6
+ protected static canGetMoreThanOneClient(): Promise<void>;
7
+ protected static canCreateMercuryFixture(): Promise<void>;
8
+ protected static returnsConnectedClient(): Promise<void>;
9
+ protected static returnsSameClientOnSecondConnect(): Promise<void>;
10
+ protected static importsContractIfLocalOneIsGenerated(sigs: any[]): Promise<void>;
11
+ protected static beforeEachResetsBackToSavedContract(): Promise<void>;
12
+ protected static typesTestProperly(): Promise<void>;
13
+ protected static canSetDefaultClient(): Promise<void>;
14
+ protected static allClientsGoingForwardUseThatClient(): Promise<void>;
15
+ protected static resetsDefaultClientBeforeEach(): Promise<void>;
16
+ protected static canForceNewClient(): Promise<void>;
17
+ private static connectToApi;
18
+ private static createDirWriteContractFileAndSetCwd;
19
+ }