@sprucelabs/spruce-test-fixtures 62.2.24 → 62.2.26

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 (291) hide show
  1. package/build/esm/index.d.ts +1 -1
  2. package/build/esm/index.js +1 -1
  3. package/build/esm/tests/fixtures/ViewFixture.d.ts +1 -1
  4. package/build/esm/tests/routers/TestRouter.d.ts +1 -1
  5. package/build/esm/tests/routers/TestRouter.js +1 -1
  6. package/build/index.d.ts +1 -1
  7. package/build/index.js +1 -1
  8. package/build/tests/fixtures/ViewFixture.d.ts +1 -1
  9. package/build/tests/routers/TestRouter.d.ts +1 -1
  10. package/build/tests/routers/TestRouter.js +1 -1
  11. package/package.json +19 -19
  12. package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
  13. package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -112
  14. package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
  15. package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -34
  16. package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
  17. package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -26
  18. package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
  19. package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -69
  20. package/build/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
  21. package/build/__tests__/behavioral/FakingEventResponses.test.js +0 -126
  22. package/build/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
  23. package/build/__tests__/behavioral/FixtureFactory.test.js +0 -79
  24. package/build/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
  25. package/build/__tests__/behavioral/LocationFixture.test.js +0 -144
  26. package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
  27. package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -95
  28. package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
  29. package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -35
  30. package/build/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
  31. package/build/__tests__/behavioral/MercuryFixture.test.js +0 -187
  32. package/build/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
  33. package/build/__tests__/behavioral/OrganizationFixture.test.js +0 -333
  34. package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
  35. package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -21
  36. package/build/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
  37. package/build/__tests__/behavioral/PersonFixture.test.js +0 -225
  38. package/build/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
  39. package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -95
  40. package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
  41. package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -67
  42. package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
  43. package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -44
  44. package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
  45. package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -55
  46. package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
  47. package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -137
  48. package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
  49. package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -54
  50. package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
  51. package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -40
  52. package/build/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
  53. package/build/__tests__/behavioral/RoleFixture.test.js +0 -118
  54. package/build/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
  55. package/build/__tests__/behavioral/SkillFixture.test.js +0 -118
  56. package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
  57. package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -41
  58. package/build/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
  59. package/build/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -59
  60. package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
  61. package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -34
  62. package/build/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
  63. package/build/__tests__/behavioral/databases/DummyStore.js +0 -36
  64. package/build/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
  65. package/build/__tests__/behavioral/databases/StoreFixture.test.js +0 -156
  66. package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
  67. package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -73
  68. package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
  69. package/build/__tests__/behavioral/faking/FakeDecorator.test.js +0 -421
  70. package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
  71. package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -23
  72. package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
  73. package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -27
  74. package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
  75. package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -93
  76. package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
  77. package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -56
  78. package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
  79. package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -141
  80. package/build/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
  81. package/build/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -35
  82. package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
  83. package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -42
  84. package/build/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
  85. package/build/__tests__/behavioral/faking/FakingLocations.test.js +0 -45
  86. package/build/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
  87. package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -140
  88. package/build/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
  89. package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -174
  90. package/build/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
  91. package/build/__tests__/behavioral/faking/UpdatePerson.test.js +0 -32
  92. package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
  93. package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -321
  94. package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
  95. package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -48
  96. package/build/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
  97. package/build/__tests__/behavioral/faking/WhoAmI.test.js +0 -105
  98. package/build/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
  99. package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -76
  100. package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
  101. package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -272
  102. package/build/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
  103. package/build/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -35
  104. package/build/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
  105. package/build/__tests__/behavioral/seeding/SeedingData.test.js +0 -271
  106. package/build/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
  107. package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -266
  108. package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
  109. package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -117
  110. package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
  111. package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -55
  112. package/build/__tests__/behavioral/views/Routing.test.d.ts +0 -36
  113. package/build/__tests__/behavioral/views/Routing.test.js +0 -177
  114. package/build/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
  115. package/build/__tests__/behavioral/views/TestingScope.test.js +0 -197
  116. package/build/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
  117. package/build/__tests__/behavioral/views/ViewPlugins.test.js +0 -83
  118. package/build/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
  119. package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -55
  120. package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
  121. package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -761
  122. package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
  123. package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -29
  124. package/build/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
  125. package/build/__tests__/support/AbstractFakeDecoratorTest.js +0 -27
  126. package/build/__tests__/support/EventFaker.d.ts +0 -5
  127. package/build/__tests__/support/EventFaker.js +0 -36
  128. package/build/__tests__/support/RandomViewPlugin.d.ts +0 -2
  129. package/build/__tests__/support/RandomViewPlugin.js +0 -5
  130. package/build/__tests__/support/RandomViewPlugin2.d.ts +0 -2
  131. package/build/__tests__/support/RandomViewPlugin2.js +0 -5
  132. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.d.ts +0 -5
  133. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.js +0 -9
  134. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
  135. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -33
  136. package/build/__tests__/testDirsAndFiles/one-good-store-skill/src/.spruce/settings.json +0 -6
  137. package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.d.ts +0 -6
  138. package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.js +0 -11
  139. package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.d.ts +0 -6
  140. package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.js +0 -11
  141. package/build/__tests__/testDirsAndFiles/skill/build/.spruce/views/views.js +0 -18
  142. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
  143. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -11
  144. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
  145. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -19
  146. package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
  147. package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -31
  148. package/build/__tests__/testDirsAndFiles/skill/package.json +0 -5
  149. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/settings.json +0 -6
  150. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.d.ts +0 -7
  151. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.js +0 -17
  152. package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
  153. package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -11
  154. package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
  155. package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -31
  156. package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
  157. package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -128
  158. package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
  159. package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -40
  160. package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
  161. package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -23
  162. package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
  163. package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -80
  164. package/build/esm/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
  165. package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +0 -148
  166. package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
  167. package/build/esm/__tests__/behavioral/FixtureFactory.test.js +0 -61
  168. package/build/esm/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
  169. package/build/esm/__tests__/behavioral/LocationFixture.test.js +0 -173
  170. package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
  171. package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -113
  172. package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
  173. package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -41
  174. package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
  175. package/build/esm/__tests__/behavioral/MercuryFixture.test.js +0 -223
  176. package/build/esm/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
  177. package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +0 -389
  178. package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
  179. package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -18
  180. package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
  181. package/build/esm/__tests__/behavioral/PersonFixture.test.js +0 -232
  182. package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
  183. package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -112
  184. package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
  185. package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -84
  186. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
  187. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -55
  188. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
  189. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -72
  190. package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
  191. package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -146
  192. package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
  193. package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -66
  194. package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
  195. package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -51
  196. package/build/esm/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
  197. package/build/esm/__tests__/behavioral/RoleFixture.test.js +0 -143
  198. package/build/esm/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
  199. package/build/esm/__tests__/behavioral/SkillFixture.test.js +0 -141
  200. package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
  201. package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -53
  202. package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
  203. package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -48
  204. package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
  205. package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -28
  206. package/build/esm/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
  207. package/build/esm/__tests__/behavioral/databases/DummyStore.js +0 -43
  208. package/build/esm/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
  209. package/build/esm/__tests__/behavioral/databases/StoreFixture.test.js +0 -164
  210. package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
  211. package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -89
  212. package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
  213. package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +0 -482
  214. package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
  215. package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -28
  216. package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
  217. package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -32
  218. package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
  219. package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -82
  220. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
  221. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -70
  222. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
  223. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -165
  224. package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
  225. package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -43
  226. package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
  227. package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -55
  228. package/build/esm/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
  229. package/build/esm/__tests__/behavioral/faking/FakingLocations.test.js +0 -55
  230. package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
  231. package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -175
  232. package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
  233. package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -214
  234. package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
  235. package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +0 -38
  236. package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
  237. package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -360
  238. package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
  239. package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -31
  240. package/build/esm/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
  241. package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +0 -142
  242. package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
  243. package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -94
  244. package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
  245. package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -324
  246. package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
  247. package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -43
  248. package/build/esm/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
  249. package/build/esm/__tests__/behavioral/seeding/SeedingData.test.js +0 -314
  250. package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
  251. package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -322
  252. package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
  253. package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -138
  254. package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
  255. package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -70
  256. package/build/esm/__tests__/behavioral/views/Routing.test.d.ts +0 -36
  257. package/build/esm/__tests__/behavioral/views/Routing.test.js +0 -212
  258. package/build/esm/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
  259. package/build/esm/__tests__/behavioral/views/TestingScope.test.js +0 -238
  260. package/build/esm/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
  261. package/build/esm/__tests__/behavioral/views/ViewPlugins.test.js +0 -103
  262. package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
  263. package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -64
  264. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
  265. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -856
  266. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
  267. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -39
  268. package/build/esm/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
  269. package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +0 -34
  270. package/build/esm/__tests__/support/EventFaker.d.ts +0 -5
  271. package/build/esm/__tests__/support/EventFaker.js +0 -45
  272. package/build/esm/__tests__/support/RandomViewPlugin.d.ts +0 -2
  273. package/build/esm/__tests__/support/RandomViewPlugin.js +0 -2
  274. package/build/esm/__tests__/support/RandomViewPlugin2.d.ts +0 -2
  275. package/build/esm/__tests__/support/RandomViewPlugin2.js +0 -2
  276. package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
  277. package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -41
  278. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
  279. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -9
  280. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
  281. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -28
  282. package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
  283. package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -26
  284. package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
  285. package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -9
  286. package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
  287. package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -26
  288. /package/build/{__tests__/support → esm/tests}/FakeThemeManager.d.ts +0 -0
  289. /package/build/esm/{__tests__/support → tests}/FakeThemeManager.js +0 -0
  290. /package/build/{esm/__tests__/support → tests}/FakeThemeManager.d.ts +0 -0
  291. /package/build/{__tests__/support → tests}/FakeThemeManager.js +0 -0
@@ -1,31 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- import AbstractSpruceTest, { test, assert } from '@sprucelabs/test-utils';
17
- import fake from '../../../tests/decorators/fake.js';
18
- let UsingFakesOnIncompatibleClassTest = class UsingFakesOnIncompatibleClassTest extends AbstractSpruceTest {
19
- static shouldNotCrash() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- assert.isTrue(true);
22
- });
23
- }
24
- };
25
- __decorate([
26
- test()
27
- ], UsingFakesOnIncompatibleClassTest, "shouldNotCrash", null);
28
- UsingFakesOnIncompatibleClassTest = __decorate([
29
- fake.login()
30
- ], UsingFakesOnIncompatibleClassTest);
31
- export default UsingFakesOnIncompatibleClassTest;
@@ -1,19 +0,0 @@
1
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
2
- export default class WhoAmITest extends AbstractSpruceFixtureTest {
3
- private static auth;
4
- private static didLoginCount;
5
- protected static beforeEach(): Promise<void>;
6
- protected static afterEach(): Promise<void>;
7
- protected static afterAll(): Promise<void>;
8
- protected static canWhoAmI(): Promise<void>;
9
- protected static authIsResetBeforeEachSoListenersAreReset(): Promise<void>;
10
- protected static canRegisterProxyToken(): Promise<void>;
11
- protected static canUseProxyToEmitAsOtherPerson(): Promise<void>;
12
- protected static canUseProxyAsSecondPerson(): Promise<void>;
13
- private static loginAsOutsider;
14
- private static emitWhoAmI;
15
- private static registerOwnerProxy;
16
- private static get client();
17
- protected static resolveTestPath(...pathAfterTestDirsAndFiles: string[]): string;
18
- private static emitRegister;
19
- }
@@ -1,142 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- import { assert, test } from '@sprucelabs/test-utils';
17
- import { fake } from '../../../index.js';
18
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
19
- let WhoAmITest = class WhoAmITest extends AbstractSpruceFixtureTest {
20
- static beforeEach() {
21
- const _super = Object.create(null, {
22
- beforeEach: { get: () => super.beforeEach }
23
- });
24
- return __awaiter(this, void 0, void 0, function* () {
25
- yield _super.beforeEach.call(this);
26
- this.cwd = this.resolveTestPath('skill');
27
- yield this.emitRegister();
28
- });
29
- }
30
- static afterEach() {
31
- const _super = Object.create(null, {
32
- afterEach: { get: () => super.afterEach }
33
- });
34
- return __awaiter(this, void 0, void 0, function* () {
35
- yield _super.afterEach.call(this);
36
- yield this.emitRegister();
37
- });
38
- }
39
- static afterAll() {
40
- const _super = Object.create(null, {
41
- afterAll: { get: () => super.afterAll }
42
- });
43
- return __awaiter(this, void 0, void 0, function* () {
44
- yield _super.afterAll.call(this);
45
- yield this.emitRegister();
46
- });
47
- }
48
- static canWhoAmI() {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- this.auth = this.views.getAuthenticator();
51
- yield fake.getClient().emitAndFlattenResponses('whoami::v2020_12_25');
52
- this.views
53
- .getAuthenticator()
54
- .addEventListener('did-login', () => __awaiter(this, void 0, void 0, function* () {
55
- this.didLoginCount++;
56
- }));
57
- });
58
- }
59
- static authIsResetBeforeEachSoListenersAreReset() {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- assert.isNotEqual(this.views.getAuthenticator(), this.auth);
62
- yield fake.getClient().emitAndFlattenResponses('whoami::v2020_12_25');
63
- assert.isEqual(this.didLoginCount, 0);
64
- });
65
- }
66
- static canRegisterProxyToken() {
67
- return __awaiter(this, void 0, void 0, function* () {
68
- const proxy = yield this.registerOwnerProxy();
69
- assert.isTruthy(proxy);
70
- const proxy2 = yield this.registerOwnerProxy();
71
- assert.isNotEqual(proxy, proxy2);
72
- });
73
- }
74
- static canUseProxyToEmitAsOtherPerson() {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- const { client } = yield this.loginAsOutsider();
77
- const proxy = yield this.registerOwnerProxy();
78
- client.setProxyToken(proxy);
79
- const auth = yield this.emitWhoAmI(client);
80
- assert.isEqualDeep(auth.person, this.fakedPerson);
81
- });
82
- }
83
- static canUseProxyAsSecondPerson() {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- const { client, person } = yield this.loginAsOutsider();
86
- const proxy = yield client.registerProxyToken();
87
- this.client.setProxyToken(proxy);
88
- const auth = yield this.emitWhoAmI();
89
- assert.isEqualDeep(auth.person, person);
90
- });
91
- }
92
- static loginAsOutsider() {
93
- return __awaiter(this, void 0, void 0, function* () {
94
- const { client, person } = yield this.people.loginAsDemoPerson('555-555-1234');
95
- return { client, person };
96
- });
97
- }
98
- static emitWhoAmI(client) {
99
- return __awaiter(this, void 0, void 0, function* () {
100
- const [{ auth }] = yield (client !== null && client !== void 0 ? client : this.client).emitAndFlattenResponses('whoami::v2020_12_25');
101
- return auth;
102
- });
103
- }
104
- static registerOwnerProxy() {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- return yield this.client.registerProxyToken();
107
- });
108
- }
109
- static get client() {
110
- return fake.getClient();
111
- }
112
- static resolveTestPath(...pathAfterTestDirsAndFiles) {
113
- return this.resolvePath(__dirname, '..', '..', 'testDirsAndFiles', ...pathAfterTestDirsAndFiles);
114
- }
115
- static emitRegister() {
116
- return __awaiter(this, void 0, void 0, function* () {
117
- yield fake
118
- .getClient()
119
- .emitAndFlattenResponses('register-proxy-token::v2020_12_25');
120
- });
121
- }
122
- };
123
- WhoAmITest.didLoginCount = 0;
124
- __decorate([
125
- test()
126
- ], WhoAmITest, "canWhoAmI", null);
127
- __decorate([
128
- test()
129
- ], WhoAmITest, "authIsResetBeforeEachSoListenersAreReset", null);
130
- __decorate([
131
- test()
132
- ], WhoAmITest, "canRegisterProxyToken", null);
133
- __decorate([
134
- test()
135
- ], WhoAmITest, "canUseProxyToEmitAsOtherPerson", null);
136
- __decorate([
137
- test()
138
- ], WhoAmITest, "canUseProxyAsSecondPerson", null);
139
- WhoAmITest = __decorate([
140
- fake.login()
141
- ], WhoAmITest);
142
- export default WhoAmITest;
@@ -1,10 +0,0 @@
1
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
2
- export default class SpyingMapUtilTest extends AbstractSpruceFixtureTest {
3
- protected static beforeEach(): Promise<void>;
4
- protected static canCreateSpyingMapUtil(): Promise<void>;
5
- protected static dropsIntoViewFixture(): Promise<void>;
6
- protected static dropsSpyIntoVc(): Promise<void>;
7
- protected static redirectingIsTracked(): Promise<void>;
8
- protected static resetsLastOpenNavBetweenTests(): Promise<void>;
9
- private static get maps();
10
- }
@@ -1,94 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- import { CardViewControllerImpl } from '@sprucelabs/heartwood-view-controllers';
17
- import { test, assert } from '@sprucelabs/test-utils';
18
- import { generateId } from '@sprucelabs/test-utils';
19
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
20
- import spyMapUtil from '../../../utilities/SpyMapUtil.js';
21
- class SpyCard extends CardViewControllerImpl {
22
- getMaps() {
23
- return this.maps;
24
- }
25
- }
26
- export default class SpyingMapUtilTest extends AbstractSpruceFixtureTest {
27
- static beforeEach() {
28
- const _super = Object.create(null, {
29
- beforeEach: { get: () => super.beforeEach }
30
- });
31
- return __awaiter(this, void 0, void 0, function* () {
32
- yield _super.beforeEach.call(this);
33
- this.views = this.Fixture('view', {
34
- controllerMap: {
35
- spy: SpyCard,
36
- },
37
- });
38
- });
39
- }
40
- static canCreateSpyingMapUtil() {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- assert.isTruthy(spyMapUtil);
43
- });
44
- }
45
- static dropsIntoViewFixture() {
46
- return __awaiter(this, void 0, void 0, function* () {
47
- assert.isEqual(this.maps, spyMapUtil);
48
- });
49
- }
50
- static dropsSpyIntoVc() {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- const vc = this.views.Controller('spy', {});
53
- assert.isEqual(vc.getMaps(), this.maps);
54
- });
55
- }
56
- static redirectingIsTracked() {
57
- return __awaiter(this, void 0, void 0, function* () {
58
- var _a;
59
- const address = {
60
- city: generateId(),
61
- country: generateId(),
62
- province: generateId(),
63
- street1: generateId(),
64
- street2: generateId(),
65
- zip: generateId(),
66
- };
67
- this.maps.openNavigation({ to: address });
68
- assert.isEqualDeep((_a = this.maps.lastOpenNavigationOptions) === null || _a === void 0 ? void 0 : _a.to, address);
69
- });
70
- }
71
- static resetsLastOpenNavBetweenTests() {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- assert.isFalsy(this.maps.lastOpenNavigationOptions);
74
- });
75
- }
76
- static get maps() {
77
- return this.views.getMaps();
78
- }
79
- }
80
- __decorate([
81
- test()
82
- ], SpyingMapUtilTest, "canCreateSpyingMapUtil", null);
83
- __decorate([
84
- test()
85
- ], SpyingMapUtilTest, "dropsIntoViewFixture", null);
86
- __decorate([
87
- test()
88
- ], SpyingMapUtilTest, "dropsSpyIntoVc", null);
89
- __decorate([
90
- test()
91
- ], SpyingMapUtilTest, "redirectingIsTracked", null);
92
- __decorate([
93
- test()
94
- ], SpyingMapUtilTest, "resetsLastOpenNavBetweenTests", null);
@@ -1,34 +0,0 @@
1
- import { AuthorizerCanOptions } from '@sprucelabs/heartwood-view-controllers';
2
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
3
- export default class CheckingPermissionsTest extends AbstractSpruceFixtureTest {
4
- private static contractId;
5
- protected static beforeEach(): Promise<void>;
6
- protected static canCreateCheckingPermissions(): Promise<void>;
7
- protected static sharesInstances(): Promise<void>;
8
- protected static permsFixtureResetsInstance(): Promise<void>;
9
- protected static throwsWhenMissingOnCan(): Promise<void>;
10
- protected static throwsWhenNotSettingResponse(): Promise<void>;
11
- protected static throwsWhenContractIdNotFaked(): Promise<void>;
12
- protected static doesNotThrowWhenMatchingSecondContractId(): Promise<void>;
13
- protected static throwsWhenNotFindingPermissionId(): Promise<void>;
14
- protected static throwsWhenFindingLaterMissingPermId(): Promise<void>;
15
- protected static returnsFakedResponses(permissionIds: string[], can: boolean): Promise<void>;
16
- protected static fixtureAndLoadOptionsShareAuthorizer(): Promise<void>;
17
- protected static authorizerClobbersMatchingContracts(): Promise<void>;
18
- protected static usesLatestMatchWhenMultipleSent(): Promise<void>;
19
- protected static canHandleMulplePermissionsWithDifferentContracts(): Promise<void>;
20
- protected static sameAuthorizerAsViews(): Promise<void>;
21
- protected static sameAuthenticatorAsViews(): Promise<void>;
22
- protected static canSpyOnSavePermissions(): Promise<void>;
23
- protected static canSeeLastCanOptions(can: AuthorizerCanOptions<any>): Promise<void>;
24
- private static assertCanOptionsMatch;
25
- private static assertSpysOnOptionsWhenSaving;
26
- private static assertPermNotFound;
27
- private static changeContractId;
28
- private static assertThrowsFakeError;
29
- private static fakePermissions;
30
- private static can;
31
- private static setupEmptyViewFixture;
32
- private static get instance();
33
- private static get auth();
34
- }
@@ -1,324 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- import { test, assert } from '@sprucelabs/test-utils';
17
- import { errorAssert, generateId } from '@sprucelabs/test-utils';
18
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
19
- import FakeAuthorizer from '../../../tests/FakeAuthorizer.js';
20
- import PermissionFixture from '../../../tests/fixtures/PermissionFixture.js';
21
- export default class CheckingPermissionsTest extends AbstractSpruceFixtureTest {
22
- static beforeEach() {
23
- const _super = Object.create(null, {
24
- beforeEach: { get: () => super.beforeEach }
25
- });
26
- return __awaiter(this, void 0, void 0, function* () {
27
- yield _super.beforeEach.call(this);
28
- this.contractId = generateId();
29
- });
30
- }
31
- static canCreateCheckingPermissions() {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- assert.isTrue(this.instance instanceof FakeAuthorizer);
34
- });
35
- }
36
- static sharesInstances() {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- assert.isEqual(this.instance, this.instance);
39
- });
40
- }
41
- static permsFixtureResetsInstance() {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- const instance = this.instance;
44
- PermissionFixture.beforeEach();
45
- assert.isNotEqual(this.instance, instance);
46
- });
47
- }
48
- static throwsWhenMissingOnCan() {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- const err = yield assert.doesThrowAsync(() =>
51
- //@ts-ignore
52
- this.instance.can());
53
- errorAssert.assertError(err, 'MISSING_PARAMETERS', {
54
- parameters: ['contractId', 'permissionIds'],
55
- });
56
- });
57
- }
58
- static throwsWhenNotSettingResponse() {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- yield this.assertThrowsFakeError();
61
- });
62
- }
63
- static throwsWhenContractIdNotFaked() {
64
- return __awaiter(this, void 0, void 0, function* () {
65
- this.fakePermissions([{ id: 'test', can: true }]);
66
- this.changeContractId();
67
- yield this.assertThrowsFakeError();
68
- });
69
- }
70
- static doesNotThrowWhenMatchingSecondContractId() {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- this.fakePermissions([{ id: 'test', can: true }]);
73
- this.changeContractId();
74
- this.fakePermissions([{ id: 'test2', can: true }]);
75
- yield this.can(['test2']);
76
- });
77
- }
78
- static throwsWhenNotFindingPermissionId() {
79
- return __awaiter(this, void 0, void 0, function* () {
80
- this.fakePermissions([{ id: 'test', can: true }]);
81
- yield this.assertPermNotFound(['test2'], 'test2');
82
- });
83
- }
84
- static throwsWhenFindingLaterMissingPermId() {
85
- return __awaiter(this, void 0, void 0, function* () {
86
- this.fakePermissions([{ id: 'test', can: true }]);
87
- yield this.assertPermNotFound(['test', 'test2'], 'test2');
88
- });
89
- }
90
- static returnsFakedResponses(permissionIds, can) {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- const faked = [];
93
- const expected = {};
94
- permissionIds.forEach((id) => ((expected[id] = can), faked.push({ id, can })));
95
- this.fakePermissions(faked);
96
- const results = yield this.can(permissionIds);
97
- assert.isEqualDeep(results, expected);
98
- });
99
- }
100
- static fixtureAndLoadOptionsShareAuthorizer() {
101
- return __awaiter(this, void 0, void 0, function* () {
102
- this.setupEmptyViewFixture();
103
- const auth = this.auth;
104
- const router = this.views.getRouter();
105
- assert.isEqual(auth, router.buildLoadOptions().authorizer);
106
- });
107
- }
108
- static authorizerClobbersMatchingContracts() {
109
- return __awaiter(this, void 0, void 0, function* () {
110
- this.fakePermissions([{ id: 'test', can: true }]);
111
- this.fakePermissions([{ id: 'test', can: false }]);
112
- const perms = yield this.can(['test']);
113
- assert.isFalse(perms['test']);
114
- });
115
- }
116
- static usesLatestMatchWhenMultipleSent() {
117
- return __awaiter(this, void 0, void 0, function* () {
118
- this.fakePermissions([
119
- { id: 'test', can: false },
120
- { id: 'test2', can: false },
121
- ]);
122
- this.fakePermissions([
123
- { id: 'test', can: true },
124
- { id: 'test2', can: false },
125
- ]);
126
- const perms = yield this.can(['test', 'test2']);
127
- assert.isTrue(perms['test']);
128
- assert.isFalse(perms['test2']);
129
- });
130
- }
131
- static canHandleMulplePermissionsWithDifferentContracts() {
132
- return __awaiter(this, void 0, void 0, function* () {
133
- const firstId = this.contractId;
134
- this.fakePermissions([{ id: 'test', can: true }]);
135
- this.changeContractId();
136
- this.fakePermissions([{ id: 'test', can: false }]);
137
- this.contractId = firstId;
138
- const perms = yield this.can(['test']);
139
- assert.isTrue(perms['test']);
140
- });
141
- }
142
- static sameAuthorizerAsViews() {
143
- return __awaiter(this, void 0, void 0, function* () {
144
- this.setupEmptyViewFixture();
145
- const auth1 = this.views.getAuthorizer();
146
- const auth2 = this.permissions.getAuthorizer();
147
- assert.isEqual(auth1, auth2);
148
- });
149
- }
150
- static sameAuthenticatorAsViews() {
151
- return __awaiter(this, void 0, void 0, function* () {
152
- this.setupEmptyViewFixture();
153
- const auth1 = this.views.getAuthenticator();
154
- const auth2 = this.permissions.getAuthenticator();
155
- assert.isEqual(auth1, auth2);
156
- });
157
- }
158
- static canSpyOnSavePermissions() {
159
- return __awaiter(this, void 0, void 0, function* () {
160
- yield this.assertSpysOnOptionsWhenSaving({
161
- contractId: 'events-contract',
162
- target: {},
163
- permissions: [],
164
- });
165
- yield this.assertSpysOnOptionsWhenSaving({
166
- contractId: 'feed-contract',
167
- target: {
168
- locationId: generateId(),
169
- personId: generateId(),
170
- },
171
- permissions: [
172
- {
173
- id: 'can-see-other-persons-feed',
174
- can: {
175
- clockedIn: true,
176
- },
177
- },
178
- ],
179
- });
180
- });
181
- }
182
- static canSeeLastCanOptions(can) {
183
- return __awaiter(this, void 0, void 0, function* () {
184
- yield this.assertCanOptionsMatch(can);
185
- });
186
- }
187
- static assertCanOptionsMatch(can) {
188
- return __awaiter(this, void 0, void 0, function* () {
189
- const { contractId } = can;
190
- this.auth.fakePermissions({
191
- contractId: contractId,
192
- permissions: [
193
- {
194
- id: 'can-register-global-events',
195
- can: true,
196
- },
197
- {
198
- id: 'can-register-global-events-2',
199
- can: true,
200
- },
201
- {
202
- id: 'can-register-global-events-3',
203
- can: true,
204
- },
205
- ],
206
- });
207
- yield this.auth.can(can);
208
- assert.isEqualDeep(this.auth.getLastCanOptions(), can);
209
- });
210
- }
211
- static assertSpysOnOptionsWhenSaving(options) {
212
- return __awaiter(this, void 0, void 0, function* () {
213
- yield this.auth.savePermissions(options);
214
- assert.isEqualDeep(this.auth.getLastSavePermissionsOptions(), options);
215
- });
216
- }
217
- static assertPermNotFound(checkIds, id) {
218
- return __awaiter(this, void 0, void 0, function* () {
219
- yield assert.doesThrowAsync(() => this.can(checkIds), id);
220
- });
221
- }
222
- static changeContractId() {
223
- this.contractId = generateId();
224
- }
225
- static assertThrowsFakeError() {
226
- return __awaiter(this, void 0, void 0, function* () {
227
- yield assert.doesThrowAsync(() => this.can(['test']), `Contract with the id '${this.contractId}'`);
228
- });
229
- }
230
- static fakePermissions(faked) {
231
- this.instance.fakePermissions({
232
- contractId: this.contractId,
233
- permissions: faked,
234
- });
235
- }
236
- static can(permissionIds) {
237
- return this.instance.can({
238
- contractId: this.contractId,
239
- permissionIds: permissionIds,
240
- });
241
- }
242
- static setupEmptyViewFixture() {
243
- this.views = this.Fixture('view', {
244
- controllerMap: {},
245
- });
246
- }
247
- static get instance() {
248
- return this.permissions.getAuthorizer();
249
- }
250
- static get auth() {
251
- return this.permissions.getAuthorizer();
252
- }
253
- }
254
- __decorate([
255
- test()
256
- ], CheckingPermissionsTest, "canCreateCheckingPermissions", null);
257
- __decorate([
258
- test()
259
- ], CheckingPermissionsTest, "sharesInstances", null);
260
- __decorate([
261
- test()
262
- ], CheckingPermissionsTest, "permsFixtureResetsInstance", null);
263
- __decorate([
264
- test()
265
- ], CheckingPermissionsTest, "throwsWhenMissingOnCan", null);
266
- __decorate([
267
- test()
268
- ], CheckingPermissionsTest, "throwsWhenNotSettingResponse", null);
269
- __decorate([
270
- test()
271
- ], CheckingPermissionsTest, "throwsWhenContractIdNotFaked", null);
272
- __decorate([
273
- test()
274
- ], CheckingPermissionsTest, "doesNotThrowWhenMatchingSecondContractId", null);
275
- __decorate([
276
- test()
277
- ], CheckingPermissionsTest, "throwsWhenNotFindingPermissionId", null);
278
- __decorate([
279
- test()
280
- ], CheckingPermissionsTest, "throwsWhenFindingLaterMissingPermId", null);
281
- __decorate([
282
- test('returns false on can 1', ['first', 'second', 'third'], false),
283
- test('returns false on can 2', ['third', 'fourth'], false),
284
- test('returns false on can 3', ['first', 'second', 'third'], true),
285
- test('returns false on can 4', ['third', 'fourth'], true)
286
- ], CheckingPermissionsTest, "returnsFakedResponses", null);
287
- __decorate([
288
- test()
289
- ], CheckingPermissionsTest, "fixtureAndLoadOptionsShareAuthorizer", null);
290
- __decorate([
291
- test()
292
- ], CheckingPermissionsTest, "authorizerClobbersMatchingContracts", null);
293
- __decorate([
294
- test()
295
- ], CheckingPermissionsTest, "usesLatestMatchWhenMultipleSent", null);
296
- __decorate([
297
- test()
298
- ], CheckingPermissionsTest, "canHandleMulplePermissionsWithDifferentContracts", null);
299
- __decorate([
300
- test()
301
- ], CheckingPermissionsTest, "sameAuthorizerAsViews", null);
302
- __decorate([
303
- test()
304
- ], CheckingPermissionsTest, "sameAuthenticatorAsViews", null);
305
- __decorate([
306
- test()
307
- ], CheckingPermissionsTest, "canSpyOnSavePermissions", null);
308
- __decorate([
309
- test('can see last can options 1', {
310
- contractId: 'events-contract',
311
- permissionIds: ['can-register-global-events'],
312
- target: {},
313
- }),
314
- test('can see last can options 2', {
315
- contractId: 'events-contract-2',
316
- permissionIds: [
317
- 'can-register-global-events',
318
- 'can-register-global-events-2',
319
- ],
320
- target: {
321
- personId: generateId(),
322
- },
323
- })
324
- ], CheckingPermissionsTest, "canSeeLastCanOptions", null);
@@ -1,5 +0,0 @@
1
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
2
- export default class PermissionFixtureTest extends AbstractSpruceFixtureTest {
3
- protected static disablesPermissionsAtStart(): Promise<void>;
4
- protected static permissionFixtureShouldUseSharedInstance(): Promise<void>;
5
- }