@sprucelabs/spruce-test-fixtures 62.2.23 → 62.2.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (281) hide show
  1. package/package.json +19 -19
  2. package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
  3. package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -112
  4. package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
  5. package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -34
  6. package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
  7. package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -26
  8. package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
  9. package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -69
  10. package/build/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
  11. package/build/__tests__/behavioral/FakingEventResponses.test.js +0 -126
  12. package/build/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
  13. package/build/__tests__/behavioral/FixtureFactory.test.js +0 -79
  14. package/build/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
  15. package/build/__tests__/behavioral/LocationFixture.test.js +0 -144
  16. package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
  17. package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -95
  18. package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
  19. package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -35
  20. package/build/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
  21. package/build/__tests__/behavioral/MercuryFixture.test.js +0 -187
  22. package/build/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
  23. package/build/__tests__/behavioral/OrganizationFixture.test.js +0 -333
  24. package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
  25. package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -21
  26. package/build/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
  27. package/build/__tests__/behavioral/PersonFixture.test.js +0 -225
  28. package/build/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
  29. package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -95
  30. package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
  31. package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -67
  32. package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
  33. package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -44
  34. package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
  35. package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -55
  36. package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
  37. package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -137
  38. package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
  39. package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -54
  40. package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
  41. package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -40
  42. package/build/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
  43. package/build/__tests__/behavioral/RoleFixture.test.js +0 -118
  44. package/build/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
  45. package/build/__tests__/behavioral/SkillFixture.test.js +0 -118
  46. package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
  47. package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -41
  48. package/build/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
  49. package/build/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -59
  50. package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
  51. package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -34
  52. package/build/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
  53. package/build/__tests__/behavioral/databases/DummyStore.js +0 -36
  54. package/build/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
  55. package/build/__tests__/behavioral/databases/StoreFixture.test.js +0 -156
  56. package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
  57. package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -73
  58. package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
  59. package/build/__tests__/behavioral/faking/FakeDecorator.test.js +0 -421
  60. package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
  61. package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -23
  62. package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
  63. package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -27
  64. package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
  65. package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -93
  66. package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
  67. package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -56
  68. package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
  69. package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -141
  70. package/build/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
  71. package/build/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -35
  72. package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
  73. package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -42
  74. package/build/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
  75. package/build/__tests__/behavioral/faking/FakingLocations.test.js +0 -45
  76. package/build/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
  77. package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -140
  78. package/build/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
  79. package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -174
  80. package/build/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
  81. package/build/__tests__/behavioral/faking/UpdatePerson.test.js +0 -32
  82. package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
  83. package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -321
  84. package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
  85. package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -48
  86. package/build/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
  87. package/build/__tests__/behavioral/faking/WhoAmI.test.js +0 -105
  88. package/build/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
  89. package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -76
  90. package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
  91. package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -272
  92. package/build/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
  93. package/build/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -35
  94. package/build/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
  95. package/build/__tests__/behavioral/seeding/SeedingData.test.js +0 -271
  96. package/build/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
  97. package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -266
  98. package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
  99. package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -117
  100. package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
  101. package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -55
  102. package/build/__tests__/behavioral/views/Routing.test.d.ts +0 -36
  103. package/build/__tests__/behavioral/views/Routing.test.js +0 -177
  104. package/build/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
  105. package/build/__tests__/behavioral/views/TestingScope.test.js +0 -197
  106. package/build/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
  107. package/build/__tests__/behavioral/views/ViewPlugins.test.js +0 -83
  108. package/build/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
  109. package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -55
  110. package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
  111. package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -761
  112. package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
  113. package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -29
  114. package/build/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
  115. package/build/__tests__/support/AbstractFakeDecoratorTest.js +0 -27
  116. package/build/__tests__/support/EventFaker.d.ts +0 -5
  117. package/build/__tests__/support/EventFaker.js +0 -36
  118. package/build/__tests__/support/FakeThemeManager.d.ts +0 -8
  119. package/build/__tests__/support/FakeThemeManager.js +0 -40
  120. package/build/__tests__/support/RandomViewPlugin.d.ts +0 -2
  121. package/build/__tests__/support/RandomViewPlugin.js +0 -5
  122. package/build/__tests__/support/RandomViewPlugin2.d.ts +0 -2
  123. package/build/__tests__/support/RandomViewPlugin2.js +0 -5
  124. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.d.ts +0 -5
  125. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.js +0 -9
  126. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
  127. package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -33
  128. package/build/__tests__/testDirsAndFiles/one-good-store-skill/src/.spruce/settings.json +0 -6
  129. package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.d.ts +0 -6
  130. package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.js +0 -11
  131. package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.d.ts +0 -6
  132. package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.js +0 -11
  133. package/build/__tests__/testDirsAndFiles/skill/build/.spruce/views/views.js +0 -18
  134. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
  135. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -11
  136. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
  137. package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -19
  138. package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
  139. package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -31
  140. package/build/__tests__/testDirsAndFiles/skill/package.json +0 -5
  141. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/settings.json +0 -6
  142. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.d.ts +0 -7
  143. package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.js +0 -17
  144. package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
  145. package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -11
  146. package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
  147. package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -31
  148. package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
  149. package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -128
  150. package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
  151. package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -40
  152. package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
  153. package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -23
  154. package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
  155. package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -80
  156. package/build/esm/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
  157. package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +0 -148
  158. package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
  159. package/build/esm/__tests__/behavioral/FixtureFactory.test.js +0 -61
  160. package/build/esm/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
  161. package/build/esm/__tests__/behavioral/LocationFixture.test.js +0 -173
  162. package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
  163. package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -113
  164. package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
  165. package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -41
  166. package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
  167. package/build/esm/__tests__/behavioral/MercuryFixture.test.js +0 -223
  168. package/build/esm/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
  169. package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +0 -389
  170. package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
  171. package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -18
  172. package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
  173. package/build/esm/__tests__/behavioral/PersonFixture.test.js +0 -232
  174. package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
  175. package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -112
  176. package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
  177. package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -84
  178. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
  179. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -55
  180. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
  181. package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -72
  182. package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
  183. package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -146
  184. package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
  185. package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -66
  186. package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
  187. package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -51
  188. package/build/esm/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
  189. package/build/esm/__tests__/behavioral/RoleFixture.test.js +0 -143
  190. package/build/esm/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
  191. package/build/esm/__tests__/behavioral/SkillFixture.test.js +0 -141
  192. package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
  193. package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -53
  194. package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
  195. package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -48
  196. package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
  197. package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -28
  198. package/build/esm/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
  199. package/build/esm/__tests__/behavioral/databases/DummyStore.js +0 -43
  200. package/build/esm/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
  201. package/build/esm/__tests__/behavioral/databases/StoreFixture.test.js +0 -164
  202. package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
  203. package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -89
  204. package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
  205. package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +0 -482
  206. package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
  207. package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -28
  208. package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
  209. package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -32
  210. package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
  211. package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -82
  212. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
  213. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -70
  214. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
  215. package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -165
  216. package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
  217. package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -43
  218. package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
  219. package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -55
  220. package/build/esm/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
  221. package/build/esm/__tests__/behavioral/faking/FakingLocations.test.js +0 -55
  222. package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
  223. package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -175
  224. package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
  225. package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -214
  226. package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
  227. package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +0 -38
  228. package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
  229. package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -360
  230. package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
  231. package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -31
  232. package/build/esm/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
  233. package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +0 -142
  234. package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
  235. package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -94
  236. package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
  237. package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -324
  238. package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
  239. package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -43
  240. package/build/esm/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
  241. package/build/esm/__tests__/behavioral/seeding/SeedingData.test.js +0 -314
  242. package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
  243. package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -322
  244. package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
  245. package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -138
  246. package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
  247. package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -70
  248. package/build/esm/__tests__/behavioral/views/Routing.test.d.ts +0 -36
  249. package/build/esm/__tests__/behavioral/views/Routing.test.js +0 -212
  250. package/build/esm/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
  251. package/build/esm/__tests__/behavioral/views/TestingScope.test.js +0 -238
  252. package/build/esm/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
  253. package/build/esm/__tests__/behavioral/views/ViewPlugins.test.js +0 -103
  254. package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
  255. package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -64
  256. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
  257. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -856
  258. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
  259. package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -39
  260. package/build/esm/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
  261. package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +0 -34
  262. package/build/esm/__tests__/support/EventFaker.d.ts +0 -5
  263. package/build/esm/__tests__/support/EventFaker.js +0 -45
  264. package/build/esm/__tests__/support/FakeThemeManager.d.ts +0 -8
  265. package/build/esm/__tests__/support/FakeThemeManager.js +0 -37
  266. package/build/esm/__tests__/support/RandomViewPlugin.d.ts +0 -2
  267. package/build/esm/__tests__/support/RandomViewPlugin.js +0 -2
  268. package/build/esm/__tests__/support/RandomViewPlugin2.d.ts +0 -2
  269. package/build/esm/__tests__/support/RandomViewPlugin2.js +0 -2
  270. package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
  271. package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -41
  272. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
  273. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -9
  274. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
  275. package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -28
  276. package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
  277. package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -26
  278. package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
  279. package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -9
  280. package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
  281. package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -26
@@ -1,212 +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
- /* eslint-disable spruce/prohibit-import-from-build-folder */
17
- import { LocaleImpl } from '@sprucelabs/calendar-utils';
18
- import { vcAssert, } from '@sprucelabs/heartwood-view-controllers';
19
- import { diskUtil } from '@sprucelabs/spruce-skill-utils';
20
- import { test, assert } from '@sprucelabs/test-utils';
21
- import { errorAssert } from '@sprucelabs/test-utils';
22
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
23
- import FakeSkillViewController from '../../../tests/Fake.svc.js';
24
- import FakeAuthorizer from '../../../tests/FakeAuthorizer.js';
25
- import TestRouter from '../../../tests/routers/TestRouter.js';
26
- import BookSkillViewController from '../../testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js';
27
- import SpySkillViewController from '../../testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js';
28
- class RoutingTest extends AbstractSpruceFixtureTest {
29
- static beforeEach() {
30
- const _super = Object.create(null, {
31
- beforeEach: { get: () => super.beforeEach }
32
- });
33
- return __awaiter(this, void 0, void 0, function* () {
34
- yield _super.beforeEach.call(this);
35
- const fixture = this.Fixture('view', { vcDir: this.vcDir });
36
- this.router = fixture.getRouter();
37
- this.factory = fixture.getFactory();
38
- });
39
- }
40
- static throwsWithBadDestination() {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- const err = yield assert.doesThrowAsync(() =>
43
- //@ts-ignore
44
- this.assertRedirects(() => this.router.redirect('waka.waka')));
45
- errorAssert.assertError(err, 'INVALID_VIEW_CONTROLLER_NAME', {
46
- name: 'waka.waka',
47
- });
48
- });
49
- }
50
- static getPresentVcIsEmptyToStart() {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- assert.isFalsy(this.router.getPresentVc());
53
- });
54
- }
55
- static canRedirectToGoodSvcWithoutNamespace(id, Vc) {
56
- return __awaiter(this, void 0, void 0, function* () {
57
- yield this.assertRedirects(() => this.router.redirect(id, {}));
58
- const vc = this.router.getPresentVc();
59
- assert.isTrue(vc instanceof Vc);
60
- });
61
- }
62
- static redirectTriggersLoadWithExpectedItems(args) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- TestRouter.setShouldLoadDestinationVc(false);
65
- //@ts-ignore
66
- const vc = yield this.assertRedirects(() => this.router.redirect('spruceTestFixtures.spy', args));
67
- const lastLoad = vc.loads.pop();
68
- assert.isFalsy(lastLoad);
69
- });
70
- }
71
- static redirectByDefaultDoesNotLoadWithExpectedItems(args) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- //@ts-ignore
74
- const vc = yield this.assertRedirects(() => this.router.redirect('spruceTestFixtures.spy', args));
75
- const lastLoad = vc.loads.pop();
76
- assert.isFalsy(lastLoad);
77
- });
78
- }
79
- static canHookIntoRedirectEvents(expectedArgs) {
80
- return __awaiter(this, void 0, void 0, function* () {
81
- let wasHit = false;
82
- let passedId = '';
83
- let passedVc = null;
84
- let passedArgs = null;
85
- yield this.router.on('did-redirect', ({ id, vc, args }) => {
86
- wasHit = true;
87
- passedId = id;
88
- passedVc = vc;
89
- passedArgs = args;
90
- });
91
- yield this.assertRedirects(() => this.router.redirect('spruceTestFixtures.book', expectedArgs));
92
- assert.isTrue(wasHit);
93
- assert.isEqual(passedId, 'spruceTestFixtures.book');
94
- assert.isTruthy(passedVc);
95
- assert.isTrue(passedVc instanceof BookSkillViewController);
96
- assert.isEqualDeep(passedArgs, expectedArgs);
97
- });
98
- }
99
- static canFakeRedirectToHeartwoodRoot() {
100
- return __awaiter(this, void 0, void 0, function* () {
101
- const svc = yield this.assertRedirects(() => this.router.redirect('heartwood.root'));
102
- assert.isTrue(svc instanceof FakeSkillViewController);
103
- });
104
- }
105
- static canSuppressBadControllerIdOnRedirect() {
106
- return __awaiter(this, void 0, void 0, function* () {
107
- TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
108
- const id = `${new Date().getTime()}.root`;
109
- //@ts-ignore
110
- this.factory.setController(id, null);
111
- yield this.assertRedirects(() => this.router.redirect(id));
112
- });
113
- }
114
- static shouldThrowWithBadSvcBecauseTestRouterIsReset() {
115
- return __awaiter(this, void 0, void 0, function* () {
116
- yield assert.doesThrowAsync(() =>
117
- //@ts-ignore
118
- this.router.redirect('waka.waka'));
119
- });
120
- }
121
- static testRouterBuildsOptionsWithLocaleAndAuthorizer() {
122
- const options = this.router.buildLoadOptions();
123
- assert.isTrue(options.locale instanceof LocaleImpl);
124
- assert.isTrue(options.authorizer instanceof FakeAuthorizer);
125
- }
126
- static canSetPresentVc() {
127
- return __awaiter(this, void 0, void 0, function* () {
128
- const vc = this.views.Controller('heartwood.root', {});
129
- this.setPresentVc(vc);
130
- const actual = this.router.getPresentVc();
131
- assert.isEqual(actual, vc);
132
- });
133
- }
134
- static canPullNamespaceFromPresentVc(id, namespace) {
135
- return __awaiter(this, void 0, void 0, function* () {
136
- this.views.setController(id, FakeSkillViewController);
137
- const vc = this.views.Controller(id, {});
138
- this.setPresentVc(vc);
139
- this.assertCurrentNamespace(namespace);
140
- });
141
- }
142
- static canSetNamespaceDirectly() {
143
- return __awaiter(this, void 0, void 0, function* () {
144
- this.router.setNamespace('forms');
145
- this.assertCurrentNamespace('forms');
146
- this.router.setNamespace('heartwood');
147
- this.assertCurrentNamespace('heartwood');
148
- });
149
- }
150
- static assertCurrentNamespace(namespace) {
151
- const actual = this.router.getNamespace();
152
- assert.isEqual(actual, namespace);
153
- }
154
- static setPresentVc(vc) {
155
- this.router.setPresentVc(vc);
156
- }
157
- static assertRedirects(action) {
158
- return __awaiter(this, void 0, void 0, function* () {
159
- return vcAssert.assertActionRedirects({
160
- action,
161
- router: this.router,
162
- });
163
- });
164
- }
165
- }
166
- RoutingTest.vcDir = diskUtil.resolvePath(__dirname, '..', '..', 'testDirsAndFiles', 'skill', 'build');
167
- export default RoutingTest;
168
- __decorate([
169
- test()
170
- ], RoutingTest, "throwsWithBadDestination", null);
171
- __decorate([
172
- test()
173
- ], RoutingTest, "getPresentVcIsEmptyToStart", null);
174
- __decorate([
175
- test('can get book svc', 'spruceTestFixtures.book', BookSkillViewController),
176
- test('can get spy svc', 'spruceTestFixtures.spy', SpySkillViewController)
177
- ], RoutingTest, "canRedirectToGoodSvcWithoutNamespace", null);
178
- __decorate([
179
- test('redirect calls load on destination vc if set 1', { hey: 'there' }),
180
- test('redirect calls load on destination vc if set 2', { what: 'the!?' })
181
- ], RoutingTest, "redirectTriggersLoadWithExpectedItems", null);
182
- __decorate([
183
- test('redirect does not call load on destination vc 1', { hey: 'there' }),
184
- test('redirect does not call load on destination vc 2', { what: 'the!?' })
185
- ], RoutingTest, "redirectByDefaultDoesNotLoadWithExpectedItems", null);
186
- __decorate([
187
- test('can hook into redirect no args', undefined),
188
- test('can hook into redirect args 1', { taco: 'bell' })
189
- ], RoutingTest, "canHookIntoRedirectEvents", null);
190
- __decorate([
191
- test()
192
- ], RoutingTest, "canFakeRedirectToHeartwoodRoot", null);
193
- __decorate([
194
- test()
195
- ], RoutingTest, "canSuppressBadControllerIdOnRedirect", null);
196
- __decorate([
197
- test()
198
- ], RoutingTest, "shouldThrowWithBadSvcBecauseTestRouterIsReset", null);
199
- __decorate([
200
- test()
201
- ], RoutingTest, "testRouterBuildsOptionsWithLocaleAndAuthorizer", null);
202
- __decorate([
203
- test()
204
- ], RoutingTest, "canSetPresentVc", null);
205
- __decorate([
206
- test('can set namespace to heartwood', 'heartwood.root', 'heartwood'),
207
- test('can set namespace to forms', 'forms.root', 'forms'),
208
- test('can set namespace to forms.go', 'forms.go', 'forms')
209
- ], RoutingTest, "canPullNamespaceFromPresentVc", null);
210
- __decorate([
211
- test()
212
- ], RoutingTest, "canSetNamespaceDirectly", null);
@@ -1,24 +0,0 @@
1
- import { ScopeFlag } from '@sprucelabs/heartwood-view-controllers';
2
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
3
- export default class TestingScopeTest extends AbstractSpruceFixtureTest {
4
- private static scope;
5
- protected static beforeEach(): Promise<void>;
6
- protected static canResetScope(): Promise<void>;
7
- protected static canSetCurrentOrgToNull(): Promise<void>;
8
- protected static canSetCurrentLocationToNull(): Promise<void>;
9
- protected static clearsLocationIdWhenSettingOrgId(): Promise<void>;
10
- protected static scopeFlagsCanBeSet(flags: ScopeFlag[]): Promise<void>;
11
- protected static noneScopeFlagsByDefault(): Promise<void>;
12
- protected static getCurrentLocationThrowsWhenScopedToOrg(flags: ScopeFlag[]): Promise<void>;
13
- protected static getCurrentOrgThrowsWhenScopedToNone(): Promise<void>;
14
- protected static canGetCurrentLocationWhenScopedToLocation(flags: ScopeFlag[]): Promise<void>;
15
- protected static canGetCurrentOrganizationWhenScopedToOrg(flags: ScopeFlag[]): Promise<void>;
16
- protected static loadingAVcSetsFlags(flags: ScopeFlag[]): Promise<void>;
17
- protected static canDisableThrowOnInvalidScopeRequest(): Promise<void>;
18
- protected static canEnableThrowsOnInvalidScopeRequest(): Promise<void>;
19
- private static disableThrowOnRequestOutOfScope;
20
- private static asserthInvalidScopeOnGetOrganization;
21
- private static assertCurrentOrgEqualsLatest;
22
- private static assertCurrentLocationEqualsLatest;
23
- private static setFlags;
24
- }
@@ -1,238 +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 { AbstractSkillViewController, } from '@sprucelabs/heartwood-view-controllers';
17
- import { assert, errorAssert, test } from '@sprucelabs/test-utils';
18
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
19
- import { DEMO_NUMBER_SCOPE } from '../../../tests/constants.js';
20
- import fake from '../../../tests/decorators/fake.js';
21
- import seed from '../../../tests/decorators/seed.js';
22
- let TestingScopeTest = class TestingScopeTest extends AbstractSpruceFixtureTest {
23
- static beforeEach() {
24
- const _super = Object.create(null, {
25
- beforeEach: { get: () => super.beforeEach }
26
- });
27
- return __awaiter(this, void 0, void 0, function* () {
28
- yield _super.beforeEach.call(this);
29
- this.views = this.Fixture('view', {
30
- controllerMap: {
31
- scoped: ScopedSkillViewController,
32
- },
33
- });
34
- this.scope = this.views.getScope();
35
- });
36
- }
37
- static canResetScope() {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- yield this.seeder.resetAccount();
40
- this.scope.setCurrentLocation('aoeu');
41
- this.scope.setCurrentOrganization('aoeu');
42
- this.scope.clearSession();
43
- const location = yield this.scope.getCurrentLocation();
44
- assert.isFalsy(location);
45
- });
46
- }
47
- static canSetCurrentOrgToNull() {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- this.scope.setCurrentOrganization(null);
50
- const org = yield this.scope.getCurrentOrganization();
51
- assert.isNull(org);
52
- });
53
- }
54
- static canSetCurrentLocationToNull() {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- this.scope.setCurrentLocation(null);
57
- const org = yield this.organizations.getNewestOrganization();
58
- assert.isTruthy(org);
59
- const location = yield this.scope.getCurrentLocation();
60
- assert.isNull(location);
61
- });
62
- }
63
- static clearsLocationIdWhenSettingOrgId() {
64
- return __awaiter(this, void 0, void 0, function* () {
65
- this.scope.setCurrentLocation('aoeu');
66
- this.scope.setCurrentOrganization('aoeu');
67
- //@ts-ignore
68
- assert.isFalsy(this.scope.currentLocationId);
69
- });
70
- }
71
- static scopeFlagsCanBeSet(flags) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- this.setFlags(flags);
74
- assert.isEqualDeep(this.scope.getFlags(), flags);
75
- });
76
- }
77
- static noneScopeFlagsByDefault() {
78
- return __awaiter(this, void 0, void 0, function* () {
79
- assert.isEqualDeep(this.scope.getFlags(), ['none']);
80
- });
81
- }
82
- static getCurrentLocationThrowsWhenScopedToOrg(flags) {
83
- return __awaiter(this, void 0, void 0, function* () {
84
- this.setFlags(flags);
85
- const err = yield assert.doesThrowAsync(() => this.scope.getCurrentLocation());
86
- errorAssert.assertError(err, 'INVALID_SCOPE_REQUEST', {
87
- flags,
88
- attemptedToGet: 'location',
89
- });
90
- });
91
- }
92
- static getCurrentOrgThrowsWhenScopedToNone() {
93
- return __awaiter(this, void 0, void 0, function* () {
94
- this.setFlags(['none']);
95
- yield this.asserthInvalidScopeOnGetOrganization();
96
- });
97
- }
98
- static canGetCurrentLocationWhenScopedToLocation(flags) {
99
- return __awaiter(this, void 0, void 0, function* () {
100
- this.setFlags(flags);
101
- yield this.assertCurrentLocationEqualsLatest();
102
- });
103
- }
104
- static canGetCurrentOrganizationWhenScopedToOrg(flags) {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- this.setFlags(flags);
107
- yield this.assertCurrentOrgEqualsLatest();
108
- });
109
- }
110
- static loadingAVcSetsFlags(flags) {
111
- return __awaiter(this, void 0, void 0, function* () {
112
- ScopedSkillViewController.scopeFlags = flags;
113
- const vc = this.views.Controller('scoped', {});
114
- yield this.views.load(vc);
115
- assert.isEqualDeep(this.scope.getFlags(), ScopedSkillViewController.scopeFlags);
116
- });
117
- }
118
- static canDisableThrowOnInvalidScopeRequest() {
119
- return __awaiter(this, void 0, void 0, function* () {
120
- this.disableThrowOnRequestOutOfScope();
121
- this.setFlags(['organization']);
122
- yield this.assertCurrentLocationEqualsLatest();
123
- this.setFlags(['none']);
124
- yield this.assertCurrentOrgEqualsLatest();
125
- });
126
- }
127
- static canEnableThrowsOnInvalidScopeRequest() {
128
- return __awaiter(this, void 0, void 0, function* () {
129
- this.disableThrowOnRequestOutOfScope();
130
- this.scope.enableThrowOnRequestOutOfScope();
131
- this.setFlags(['none']);
132
- yield this.asserthInvalidScopeOnGetOrganization();
133
- });
134
- }
135
- static disableThrowOnRequestOutOfScope() {
136
- this.scope.disableThrowOnRequestOutOfScope();
137
- }
138
- static asserthInvalidScopeOnGetOrganization() {
139
- return __awaiter(this, void 0, void 0, function* () {
140
- const err = yield assert.doesThrowAsync(() => this.scope.getCurrentOrganization());
141
- errorAssert.assertError(err, 'INVALID_SCOPE_REQUEST', {
142
- flags: ['none'],
143
- attemptedToGet: 'organization',
144
- });
145
- });
146
- }
147
- static assertCurrentOrgEqualsLatest() {
148
- return __awaiter(this, void 0, void 0, function* () {
149
- const org = yield this.scope.getCurrentOrganization();
150
- assert.isEqualDeep(org, this.fakedOrganizations[0]);
151
- });
152
- }
153
- static assertCurrentLocationEqualsLatest() {
154
- return __awaiter(this, void 0, void 0, function* () {
155
- const location = yield this.scope.getCurrentLocation();
156
- assert.isEqualDeep(location, this.fakedLocations[0]);
157
- });
158
- }
159
- static setFlags(flags) {
160
- this.scope.setFlags(flags);
161
- }
162
- };
163
- __decorate([
164
- test()
165
- ], TestingScopeTest, "canResetScope", null);
166
- __decorate([
167
- test(),
168
- seed('organizations', 1)
169
- ], TestingScopeTest, "canSetCurrentOrgToNull", null);
170
- __decorate([
171
- test(),
172
- seed('organizations', 1),
173
- seed('locations', 1)
174
- ], TestingScopeTest, "canSetCurrentLocationToNull", null);
175
- __decorate([
176
- test()
177
- ], TestingScopeTest, "clearsLocationIdWhenSettingOrgId", null);
178
- __decorate([
179
- test('can set flags 1', ['organization']),
180
- test('can set flags 2', ['location']),
181
- test('can set flags 3', ['organization', 'employed'])
182
- ], TestingScopeTest, "scopeFlagsCanBeSet", null);
183
- __decorate([
184
- test()
185
- ], TestingScopeTest, "noneScopeFlagsByDefault", null);
186
- __decorate([
187
- test('get current location throws when scoped to organization', [
188
- 'organization',
189
- ]),
190
- test('get current location throws when scoped to none', ['none'])
191
- ], TestingScopeTest, "getCurrentLocationThrowsWhenScopedToOrg", null);
192
- __decorate([
193
- test()
194
- ], TestingScopeTest, "getCurrentOrgThrowsWhenScopedToNone", null);
195
- __decorate([
196
- test('can get lecation when scoped to location', ['location']),
197
- test('can get lecation when scoped to location and employed', [
198
- 'employed',
199
- 'location',
200
- ]),
201
- seed('locations', 1)
202
- ], TestingScopeTest, "canGetCurrentLocationWhenScopedToLocation", null);
203
- __decorate([
204
- test('can get current org when scoped to org', ['organization']),
205
- test('can get current org when scoped to org and employed', [
206
- 'employed',
207
- 'organization',
208
- ]),
209
- seed('organizations', 1)
210
- ], TestingScopeTest, "canGetCurrentOrganizationWhenScopedToOrg", null);
211
- __decorate([
212
- test('loading svc sets flags 1', ['location']),
213
- test('loading svc sets flags 2', ['organization']),
214
- seed('locations', 1)
215
- ], TestingScopeTest, "loadingAVcSetsFlags", null);
216
- __decorate([
217
- test(),
218
- seed('locations', 1)
219
- ], TestingScopeTest, "canDisableThrowOnInvalidScopeRequest", null);
220
- __decorate([
221
- test(),
222
- seed('locations', 1)
223
- ], TestingScopeTest, "canEnableThrowsOnInvalidScopeRequest", null);
224
- TestingScopeTest = __decorate([
225
- fake.login(DEMO_NUMBER_SCOPE)
226
- ], TestingScopeTest);
227
- export default TestingScopeTest;
228
- class ScopedSkillViewController extends AbstractSkillViewController {
229
- getScope() {
230
- return ScopedSkillViewController.scopeFlags;
231
- }
232
- render() {
233
- return {
234
- layouts: [],
235
- };
236
- }
237
- }
238
- ScopedSkillViewController.scopeFlags = [];
@@ -1,12 +0,0 @@
1
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
2
- export default class ViewPluginsTest extends AbstractSpruceFixtureTest {
3
- protected static beforeEach(): Promise<void>;
4
- protected static vcAssertLoadsControllersAndMapWithPlugnsByName(): Promise<void>;
5
- protected static getsPluginWithExpectedClassReference(dirName: string, key: string, Expected: any): Promise<void>;
6
- protected static doesNotIncludePluginsNotExported(): Promise<void>;
7
- protected static passesPluginsToTheViewFactory(): Promise<void>;
8
- protected static loadsPluginsFromDifferentDirectory(): Promise<void>;
9
- private static VcWithPlugins;
10
- private static loadControllersAndMap;
11
- private static resolvePathToTestSkill;
12
- }
@@ -1,103 +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 { vcPluginAssert } from '@sprucelabs/heartwood-view-controllers';
17
- import { test, assert, generateId } from '@sprucelabs/test-utils';
18
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
19
- import FixtureFactory from '../../../tests/fixtures/FixtureFactory.js';
20
- import vcDiskUtil from '../../../utilities/vcDisk.utility.js';
21
- import RandomViewPlugin from '../../support/RandomViewPlugin.js';
22
- import RandomViewPlugin2 from '../../support/RandomViewPlugin2.js';
23
- export default class ViewPluginsTest extends AbstractSpruceFixtureTest {
24
- static beforeEach() {
25
- const _super = Object.create(null, {
26
- beforeEach: { get: () => super.beforeEach }
27
- });
28
- return __awaiter(this, void 0, void 0, function* () {
29
- yield _super.beforeEach.call(this);
30
- process.env.RANDOM_VALUE = generateId();
31
- });
32
- }
33
- static vcAssertLoadsControllersAndMapWithPlugnsByName() {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- const pluginsByName = yield this.loadControllersAndMap('plugins1');
36
- assert.isTruthy(pluginsByName);
37
- assert.isTruthy(pluginsByName.test1);
38
- });
39
- }
40
- static getsPluginWithExpectedClassReference(dirName, key, Expected) {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- const pluginsByName = yield this.loadControllersAndMap(dirName);
43
- //@ts-ignore
44
- assert.isEqual(pluginsByName[key], Expected);
45
- });
46
- }
47
- static doesNotIncludePluginsNotExported() {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- const pluginsByName = yield this.loadControllersAndMap('plugins1');
50
- assert.isFalsy(pluginsByName.test2);
51
- });
52
- }
53
- static passesPluginsToTheViewFactory() {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- const vc = this.VcWithPlugins('plugins1');
56
- vcPluginAssert.pluginIsInstalled(vc, 'test1', RandomViewPlugin);
57
- assert.doesThrow(() => vcPluginAssert.pluginIsInstalled(vc, 'test2'));
58
- });
59
- }
60
- static loadsPluginsFromDifferentDirectory() {
61
- return __awaiter(this, void 0, void 0, function* () {
62
- const vc = this.VcWithPlugins('plugins2');
63
- vcPluginAssert.pluginIsInstalled(vc, 'test2', RandomViewPlugin2);
64
- assert.doesThrow(() => vcPluginAssert.pluginIsInstalled(vc, 'test1'));
65
- });
66
- }
67
- static VcWithPlugins(dirName) {
68
- const fixture = new FixtureFactory({
69
- cwd: this.resolvePath(this.resolvePathToTestSkill(dirName), '..'),
70
- namespace: generateId(),
71
- });
72
- const views = fixture.Fixture('view');
73
- const factory = views.getFactory();
74
- const vc = factory.Controller('card', {});
75
- return vc;
76
- }
77
- static loadControllersAndMap(dirName) {
78
- return __awaiter(this, void 0, void 0, function* () {
79
- const toLoad = this.resolvePathToTestSkill(dirName);
80
- const { pluginsByName } = vcDiskUtil.loadViewControllersAndBuildMap('test', toLoad);
81
- return pluginsByName;
82
- });
83
- }
84
- static resolvePathToTestSkill(dirName) {
85
- return this.resolvePath('build', '__tests__', 'testDirsAndFiles', dirName, 'build');
86
- }
87
- }
88
- __decorate([
89
- test()
90
- ], ViewPluginsTest, "vcAssertLoadsControllersAndMapWithPlugnsByName", null);
91
- __decorate([
92
- test('can load test1 plugin from plugins1', 'plugins1', 'test1', RandomViewPlugin),
93
- test('can load test2 plugin from plugins2', 'plugins2', 'test2', RandomViewPlugin2)
94
- ], ViewPluginsTest, "getsPluginWithExpectedClassReference", null);
95
- __decorate([
96
- test()
97
- ], ViewPluginsTest, "doesNotIncludePluginsNotExported", null);
98
- __decorate([
99
- test()
100
- ], ViewPluginsTest, "passesPluginsToTheViewFactory", null);
101
- __decorate([
102
- test()
103
- ], ViewPluginsTest, "loadsPluginsFromDifferentDirectory", null);
@@ -1,11 +0,0 @@
1
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
2
- export default class WorkingWithTimezonesTest extends AbstractSpruceFixtureTest {
3
- static controllerMap: {};
4
- protected static beforeEach(): Promise<void>;
5
- protected static canGetInstance(): void;
6
- protected static instanceShared(): void;
7
- protected static returnsInstanceFromRouter(): void;
8
- protected static canSetTimezoneOffset(offsetMinutes: number): void;
9
- private static assertCurrentOffset;
10
- private static getInstance;
11
- }
@@ -1,64 +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 { LocaleImpl } from '@sprucelabs/calendar-utils';
17
- import { test, assert } from '@sprucelabs/test-utils';
18
- import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
19
- class WorkingWithTimezonesTest 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.views = this.Fixture('view', { controllerMap: this.controllerMap });
27
- });
28
- }
29
- static canGetInstance() {
30
- const instance = this.getInstance();
31
- assert.isTrue(instance instanceof LocaleImpl);
32
- }
33
- static instanceShared() {
34
- assert.isEqual(this.getInstance(), this.getInstance());
35
- }
36
- static returnsInstanceFromRouter() {
37
- assert.isEqual(this.views.getRouter().buildLoadOptions().locale, this.getInstance());
38
- }
39
- static canSetTimezoneOffset(offsetMinutes) {
40
- this.getInstance().setTimezoneOffsetMinutes(offsetMinutes);
41
- this.assertCurrentOffset(offsetMinutes);
42
- }
43
- static assertCurrentOffset(offsetMinutes) {
44
- assert.isEqual(this.getInstance().getTimezoneOffsetMinutes(), offsetMinutes);
45
- }
46
- static getInstance() {
47
- return this.views.getLocale();
48
- }
49
- }
50
- WorkingWithTimezonesTest.controllerMap = {};
51
- export default WorkingWithTimezonesTest;
52
- __decorate([
53
- test()
54
- ], WorkingWithTimezonesTest, "canGetInstance", null);
55
- __decorate([
56
- test()
57
- ], WorkingWithTimezonesTest, "instanceShared", null);
58
- __decorate([
59
- test()
60
- ], WorkingWithTimezonesTest, "returnsInstanceFromRouter", null);
61
- __decorate([
62
- test('can set offset 1', 10),
63
- test('can set offset 2', 20)
64
- ], WorkingWithTimezonesTest, "canSetTimezoneOffset", null);