@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,761 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
13
- const schema_1 = require("@sprucelabs/schema");
14
- const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
15
- const test_utils_1 = require("@sprucelabs/test-utils");
16
- const test_utils_2 = require("@sprucelabs/test-utils");
17
- const __1 = require("../../../..");
18
- const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../../tests/AbstractSpruceFixtureTest"));
19
- const constants_1 = require("../../../../tests/constants");
20
- const fake_1 = __importDefault(require("../../../../tests/decorators/fake"));
21
- const Fake_svc_1 = __importDefault(require("../../../../tests/Fake.svc"));
22
- const SpyScope_1 = __importDefault(require("../../../../tests/fixtures/SpyScope"));
23
- const ViewFixture_1 = __importDefault(require("../../../../tests/fixtures/ViewFixture"));
24
- const SpyViewControllerFactory_1 = __importDefault(require("../../../../tests/SpyViewControllerFactory"));
25
- const EventFaker_1 = __importDefault(require("../../../support/EventFaker"));
26
- const FakeThemeManager_1 = __importDefault(require("../../../support/FakeThemeManager"));
27
- const DEMO_NUMBER_FORMATTED = (0, schema_1.formatPhoneNumber)(constants_1.DEMO_NUMBER !== null && constants_1.DEMO_NUMBER !== void 0 ? constants_1.DEMO_NUMBER : '');
28
- let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest_1.default {
29
- static async beforeEach() {
30
- await super.beforeEach();
31
- this.fixture = this.ViewFixture();
32
- this.fixtureNoOptions = this.Fixture('view');
33
- this.eventFaker = new EventFaker_1.default();
34
- await this.eventFaker.fakeRegisterSkill();
35
- await this.eventFaker.fakeUnregisterSkill();
36
- await this.eventFaker.fakeRegisterProxyToken();
37
- }
38
- static async canLogin() {
39
- const auth = heartwood_view_controllers_1.AuthenticatorImpl.getInstance();
40
- test_utils_1.assert.isEqualDeep(auth.getPerson(), this.fakedPerson);
41
- const { person } = await this.fixtureNoOptions.loginAsDemoPerson(constants_1.DEMO_NUMBER_VIEW_FIXTURE);
42
- const loggedIn = auth.getPerson();
43
- test_utils_1.assert.isTruthy(loggedIn);
44
- test_utils_1.assert.isEqualDeep(loggedIn, person);
45
- }
46
- static async loginFallsBackToDemoNumber() {
47
- const { person } = await this.fixtureNoOptions.loginAsDemoPerson();
48
- test_utils_1.assert.isEqual(person.phone, DEMO_NUMBER_FORMATTED);
49
- }
50
- static async canSetHeartwoodRoot() {
51
- const fixture = this.Fixture('view', {
52
- controllerMap: {
53
- 'heartwood.root': true,
54
- },
55
- });
56
- const factory = fixture.getFactory();
57
- //@ts-ignore
58
- test_utils_1.assert.isTrue(factory.controllerMap['heartwood.root']);
59
- }
60
- static fixturesShouldShareConnectToApiReferences() {
61
- const fixture1 = this.fixtureNoOptions;
62
- const fixture2 = this.fixtureNoOptions;
63
- //@ts-ignore
64
- test_utils_1.assert.isEqual(fixture1.connectToApi, fixture2.connectToApi);
65
- }
66
- static canPassThroughPersonFixture() {
67
- const personFixture = this.Fixture('person');
68
- const viewFixture = this.Fixture('view', { people: personFixture });
69
- //@ts-ignore
70
- test_utils_1.assert.isEqual(viewFixture.people, personFixture);
71
- }
72
- static async feedsInScope() {
73
- const { vc, fixture } = this.Scope();
74
- test_utils_1.assert.isNull(vc.loadOptions);
75
- await fixture.load(vc, {});
76
- test_utils_1.assert.isTruthy(vc.loadOptions);
77
- test_utils_1.assert.isTruthy(vc.loadOptions.scope);
78
- }
79
- static async scopeCanGetAndSetOrganization() {
80
- var _a;
81
- const { vc, fixture } = this.Scope();
82
- await fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_VIEW_FIXTURE);
83
- await fixture.load(vc);
84
- const scope = (_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope;
85
- test_utils_1.assert.isTruthy(scope);
86
- let org = await scope.getCurrentOrganization();
87
- test_utils_1.assert.isNull(org);
88
- const created = await this.organizations.seedDemoOrganization({
89
- name: 'Scope org',
90
- phone: constants_1.DEMO_NUMBER_VIEW_FIXTURE,
91
- });
92
- scope.setCurrentOrganization(created.id);
93
- org = await scope.getCurrentOrganization();
94
- test_utils_1.assert.isEqualDeep(org, created);
95
- }
96
- static async scopeGetsLastOrgByDefault() {
97
- const orgs = this.organizations;
98
- await orgs.seedDemoOrganization({
99
- name: 'Scope org',
100
- phone: constants_1.DEMO_NUMBER_VIEW_FIXTURE,
101
- });
102
- await orgs.seedDemoOrganization({
103
- name: 'Scope org',
104
- phone: constants_1.DEMO_NUMBER_VIEW_FIXTURE,
105
- });
106
- const expected = await orgs.seedDemoOrganization({
107
- name: 'Scope org',
108
- phone: constants_1.DEMO_NUMBER_VIEW_FIXTURE,
109
- });
110
- const viewFixture = this.fixtureNoOptions;
111
- await viewFixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_VIEW_FIXTURE);
112
- const current = await viewFixture.getScope().getCurrentOrganization();
113
- test_utils_1.assert.isEqualDeep(current, expected);
114
- }
115
- static async scopeGetsLastLocationByDefault() {
116
- const org = await this.organizations.seedDemoOrganization({
117
- name: 'Scope org',
118
- phone: constants_1.DEMO_NUMBER_VIEW_FIXTURE,
119
- });
120
- await this.locations.seedDemoLocation({
121
- organizationId: org.id,
122
- phone: constants_1.DEMO_NUMBER_VIEW_FIXTURE,
123
- });
124
- await this.locations.seedDemoLocation({
125
- organizationId: org.id,
126
- phone: constants_1.DEMO_NUMBER_VIEW_FIXTURE,
127
- });
128
- await this.locations.seedDemoLocation({
129
- organizationId: org.id,
130
- phone: constants_1.DEMO_NUMBER_VIEW_FIXTURE,
131
- });
132
- const viewFixture = this.fixtureNoOptions;
133
- await viewFixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_VIEW_FIXTURE);
134
- const current = await viewFixture.getScope().getCurrentLocation();
135
- const { client } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_VIEW_FIXTURE);
136
- const [{ locations }] = await client.emitAndFlattenResponses('list-locations::v2020_12_25', {
137
- target: {
138
- organizationId: org.id,
139
- },
140
- });
141
- const expected = locations[0];
142
- test_utils_1.assert.isEqualDeep(current, expected);
143
- }
144
- static async scopeCanGetAndSetLocation() {
145
- var _a;
146
- await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_VIEW_FIXTURE);
147
- const { vc, fixture } = this.Scope();
148
- await fixture.load(vc);
149
- const scope = (_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope;
150
- test_utils_1.assert.isTruthy(scope);
151
- let location = await scope.getCurrentLocation();
152
- test_utils_1.assert.isNull(location);
153
- const created = await this.Fixture('location').seedDemoLocation({
154
- name: 'Scope org',
155
- phone: constants_1.DEMO_NUMBER_VIEW_FIXTURE,
156
- });
157
- scope.setCurrentLocation(created.id);
158
- location = await scope.getCurrentLocation();
159
- test_utils_1.assert.isEqualDeep(location, created);
160
- }
161
- static async sharesPersonFixture() {
162
- const { fixture } = this.Scope();
163
- test_utils_1.assert.isEqual(
164
- //@ts-ignore
165
- fixture.people,
166
- //@ts-ignore
167
- fixture.orgs.people);
168
- test_utils_1.assert.isEqual(
169
- //@ts-ignore
170
- fixture.people,
171
- //@ts-ignore
172
- fixture.locations.people);
173
- test_utils_1.assert.isEqual(
174
- //@ts-ignore
175
- fixture.orgs,
176
- //@ts-ignore
177
- fixture.locations.orgs);
178
- }
179
- static async canSetScopeForCurrentOrganizationAcrossViewFixtures() {
180
- var _a;
181
- const org = await this.organizations.seedDemoOrganization({
182
- phone: constants_1.DEMO_NUMBER_VIEW_FIXTURE,
183
- name: 'My new org!',
184
- });
185
- this.fixtureNoOptions.getScope().setCurrentOrganization(org.id);
186
- const { vc, fixture } = this.Scope();
187
- await fixture.load(vc);
188
- const current = await ((_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope.getCurrentOrganization());
189
- test_utils_1.assert.isEqualDeep(current, org);
190
- }
191
- static async scopeShouldBeResetEachRun() {
192
- var _a;
193
- const { vc, fixture } = this.Scope();
194
- await fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_VIEW_FIXTURE);
195
- await fixture.load(vc);
196
- const current = await ((_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope.getCurrentOrganization());
197
- test_utils_1.assert.isNull(current);
198
- }
199
- static fixturesShareVcFactory() {
200
- const options = {
201
- controllerMap: {
202
- 'heartwood.root': true,
203
- },
204
- };
205
- const fixture1 = this.Fixture('view', options);
206
- const fixture2 = this.Fixture('view', options);
207
- test_utils_1.assert.isEqual(fixture1.getFactory(), fixture2.getFactory());
208
- }
209
- static async mixesInControllerMapWithLocalViews() {
210
- await this.bootAndRegisterSkillFromTestDir('skill');
211
- const fixture = this.Fixture('view', {
212
- controllerMap: {
213
- 'new.view': Fake_svc_1.default,
214
- },
215
- });
216
- const factory = fixture.getFactory();
217
- //@ts-ignore
218
- factory.Controller('views.book', {});
219
- //@ts-ignore
220
- factory.Controller('new.view', {});
221
- }
222
- static fixturesContinueToMixinViewControllers() {
223
- this.Fixture('view', {
224
- controllerMap: {
225
- 'new.view': Fake_svc_1.default,
226
- },
227
- }).getFactory();
228
- const fixture = this.Fixture('view', {
229
- controllerMap: {
230
- 'new.view2': Fake_svc_1.default,
231
- },
232
- });
233
- //@ts-ignore
234
- fixture.getFactory().Controller('new.view2');
235
- }
236
- static fixtureAttachesRenderCount() {
237
- const vc = this.MockVc();
238
- heartwood_view_controllers_1.vcAssert.assertTriggerRenderCount(vc, 0);
239
- vc.triggerRender();
240
- heartwood_view_controllers_1.vcAssert.assertTriggerRenderCount(vc, 1);
241
- }
242
- static async fixturePatchesAlertToThrow() {
243
- const vc = this.MockVc();
244
- //@ts-ignore
245
- test_utils_1.assert.isFunction(vc._originalAlert);
246
- //@ts-ignore
247
- await test_utils_1.assert.doesThrowAsync(() => vc.alert());
248
- }
249
- static fixturePatchesRenderInDialogToThrow() {
250
- const vc = this.MockVc();
251
- //@ts-ignore
252
- test_utils_1.assert.isFunction(vc._originalRenderInDialog);
253
- //@ts-ignore
254
- test_utils_1.assert.doesThrow(() => vc.renderInDialog({}));
255
- }
256
- static async testRouterThrowsOnRedirect() {
257
- const router = this.fixture.getRouter();
258
- await test_utils_1.assert.doesThrowAsync(() => router.redirect('heartwood.root'));
259
- await heartwood_view_controllers_1.vcAssert.assertActionRedirects({
260
- action: () => router.redirect('heartwood.root'),
261
- router,
262
- });
263
- }
264
- static canGetAuthenticatorInstance() {
265
- const viewFixture = this.Fixture('view', {
266
- controllerMap: {
267
- card: Fake_svc_1.default,
268
- },
269
- });
270
- test_utils_1.assert.isFunction(viewFixture.getAuthenticator);
271
- test_utils_1.assert.isEqual(viewFixture.getAuthenticator(), heartwood_view_controllers_1.AuthenticatorImpl.getInstance());
272
- }
273
- static activeRecordThrowsByDefault() {
274
- //@ts-ignore
275
- test_utils_1.assert.isTrue(heartwood_view_controllers_1.ActiveRecordListViewController.shouldThrowOnResponseError);
276
- heartwood_view_controllers_1.ActiveRecordListViewController.setShouldThrowOnResponseError(false);
277
- }
278
- static activeRecordThrowReset() {
279
- //@ts-ignore
280
- test_utils_1.assert.isTrue(heartwood_view_controllers_1.ActiveRecordListViewController.shouldThrowOnResponseError);
281
- }
282
- static async loggingInWithViewFixtureSetsProxyTokenForSkill() {
283
- const { client, token, generator } = await this.loginAndGetProxy();
284
- test_utils_1.assert.isTruthy(token);
285
- test_utils_1.assert.isTruthy(client.getProxyToken());
286
- test_utils_1.assert.isEqual(token, client.getProxyToken());
287
- const token2 = await (generator === null || generator === void 0 ? void 0 : generator());
288
- test_utils_1.assert.isEqual(token, token2);
289
- const results = await client.emit('whoami::v2020_12_25');
290
- spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
291
- }
292
- static async proxyGeneratorIsResetWhenDifferentPersonLogsIn() {
293
- const { token } = await this.loginAndGetProxy();
294
- const { token: token2 } = await this.loginAndGetProxy(constants_1.DEMO_NUMBER_VIEW_FIXTURE_2);
295
- test_utils_1.assert.isNotEqual(token, token2);
296
- }
297
- static async sameProxyAcrossFixturesWithSameNumber() {
298
- const { token } = await this.loginAndGetProxy();
299
- const { token: token2 } = await this.loginAndGetProxy();
300
- test_utils_1.assert.isEqual(token, token2);
301
- }
302
- static async generatorResetEachTest() {
303
- //@ts-ignore
304
- test_utils_1.assert.isEqualDeep(ViewFixture_1.default.loggedInPersonProxyTokens, {});
305
- const generator = this.getProxyGenerator();
306
- test_utils_1.assert.isFalsy(generator);
307
- }
308
- static async loggingInAsViewSetsClientForViewControllers() {
309
- const client = await this.loginAsDemoPerson();
310
- const vc = this.fixture.Controller('client', {});
311
- const client2 = await vc.connect();
312
- test_utils_1.assert.isEqual(client, client2);
313
- }
314
- static viewClientIsResetAfterEachTest() {
315
- //@ts-ignore
316
- test_utils_1.assert.isFalsy(ViewFixture_1.default.viewClient);
317
- }
318
- static async generatorIsNotVulnerableToRaceConditions() {
319
- const client = await this.loginAsDemoPerson();
320
- const generator = this.fixture.getProxyTokenGenerator();
321
- test_utils_1.assert.isTruthy(generator);
322
- let hitCount = 0;
323
- await client.on('register-proxy-token::v2020_12_25', () => {
324
- hitCount++;
325
- return {
326
- token: 'aoeu',
327
- };
328
- });
329
- await Promise.all([
330
- generator(),
331
- generator(),
332
- generator(),
333
- generator(),
334
- generator(),
335
- generator(),
336
- generator(),
337
- generator(),
338
- generator(),
339
- ]);
340
- test_utils_1.assert.isEqual(hitCount, 1);
341
- }
342
- static async patchesConfirmToThrow() {
343
- const vc = this.MockVc();
344
- //@ts-ignore
345
- await test_utils_1.assert.doesThrowAsync(() => vc.confirm());
346
- }
347
- static async setsSwipeVcJumpToSlideDuration() {
348
- test_utils_1.assert.isEqual(heartwood_view_controllers_1.SwipeViewControllerImpl.swipeDelay, 0);
349
- heartwood_view_controllers_1.SwipeViewControllerImpl.swipeDelay = 100;
350
- await ViewFixture_1.default.beforeEach();
351
- test_utils_1.assert.isEqual(heartwood_view_controllers_1.SwipeViewControllerImpl.swipeDelay, 0);
352
- }
353
- static canSetScope() {
354
- const scope = new SpyScope_1.default({
355
- organizationFixture: this.organizations,
356
- locationFixture: this.locations,
357
- });
358
- this.fixture.setScope(scope);
359
- test_utils_1.assert.isEqual(this.fixture.getScope(), scope);
360
- }
361
- static async loadingAScopedToOrgVcWithoutASeededOrgThrows() {
362
- const vc = this.ScopedByOrgVc();
363
- const err = await test_utils_1.assert.doesThrowAsync(() => this.fixture.load(vc));
364
- test_utils_2.errorAssert.assertError(err, 'SCOPE_REQUIREMENTS_NOT_MET');
365
- }
366
- static async loadingAScopedToLocationVcWithoutASeededLocationThrows() {
367
- const vc = this.ScopedByLocationVc();
368
- const err = await test_utils_1.assert.doesThrowAsync(() => this.fixture.load(vc));
369
- test_utils_2.errorAssert.assertError(err, 'SCOPE_REQUIREMENTS_NOT_MET');
370
- }
371
- static async loadingWithOrgScopeAndSeededOrg() {
372
- const vc = this.ScopedByOrgVc();
373
- await this.fixture.load(vc);
374
- vc.getScope = () => ['employed', 'organization'];
375
- await this.fixture.load(vc);
376
- }
377
- static async loadingWithLocationScopeAndSeededLocation() {
378
- const vc = this.ScopedByLocationVc();
379
- await this.fixture.load(vc);
380
- vc.getScope = () => ['employed', 'location'];
381
- await this.fixture.load(vc);
382
- }
383
- static async setsFactoryToFormAssert() {
384
- this.fixture.getFactory();
385
- //@ts-ignore
386
- test_utils_1.assert.isEqual(heartwood_view_controllers_1.formAssert.views, this.fixture.getFactory());
387
- }
388
- static async canSetMercuryClient() {
389
- const client = await this.mercury.connectToApi({
390
- shouldReUseClient: false,
391
- });
392
- this.fixture.setClient(client);
393
- //@ts-ignore
394
- test_utils_1.assert.isEqual(ViewFixture_1.default.viewClient, client);
395
- }
396
- static async loadOptionsComeWithFakeThemeManager() {
397
- const options = this.buildLoadOptions();
398
- test_utils_1.assert.isTrue(options.themes instanceof FakeThemeManager_1.default);
399
- }
400
- static async sameFakeThemeEachTime() {
401
- const options1 = this.buildLoadOptions();
402
- const options2 = this.buildLoadOptions();
403
- test_utils_1.assert.isEqual(options1.themes, options2.themes);
404
- }
405
- static async sameThemesOnFixture() {
406
- test_utils_1.assert.isEqual(this.fixture.getThemes(), this.buildLoadOptions().themes);
407
- }
408
- static async canSetController() {
409
- const factory = this.fixture.getFactory();
410
- const name = (0, test_utils_2.generateId)();
411
- const Vc = {};
412
- let passedName;
413
- let passedVc;
414
- factory.setController = (name, Vc) => {
415
- passedName = name;
416
- passedVc = Vc;
417
- };
418
- this.fixture.setController(name, Vc);
419
- test_utils_1.assert.isEqual(passedName, name);
420
- test_utils_1.assert.isEqual(passedVc, Vc);
421
- }
422
- static async deviceIsSetOnFixtureAndFactory() {
423
- const factory = this.fixture.getFactory();
424
- const device = this.fixture.getDevice();
425
- //@ts-ignore
426
- test_utils_1.assert.isEqual(factory.device, device);
427
- const factory2 = this.ViewFixture();
428
- test_utils_1.assert.isEqual(factory2.getDevice(), device);
429
- this.lastDevice = device;
430
- }
431
- static async newDeviceBeforeEach() {
432
- const device = this.fixture.getDevice();
433
- test_utils_1.assert.isNotEqual(device, this.lastDevice);
434
- }
435
- static async mutesLogs() {
436
- console.log = () => test_utils_1.assert.fail('should not be called');
437
- console.warn = () => test_utils_1.assert.fail('should not be called');
438
- console.error = () => test_utils_1.assert.fail('should not be called');
439
- const vc = this.MockVc('logging');
440
- const log = vc.getLog();
441
- log.info('hey');
442
- log.error('hey');
443
- log.warn('hey');
444
- }
445
- static async buildVcPluginExposedInFixture() {
446
- const factory = this.fixture.getFactory();
447
- let wasHit = false;
448
- let PassedClass;
449
- let response = {};
450
- //@ts-ignore
451
- factory.BuildPlugin = (Class) => {
452
- wasHit = true;
453
- PassedClass = Class;
454
- return response;
455
- };
456
- const plugin = this.fixture.BuildPlugin(SpyVcPlugin);
457
- test_utils_1.assert.isTrue(wasHit);
458
- test_utils_1.assert.isEqual(PassedClass, SpyVcPlugin);
459
- test_utils_1.assert.isEqual(plugin, response);
460
- }
461
- static async addPluginExposedInFixure() {
462
- const factory = this.fixture.getFactory();
463
- const name = (0, test_utils_2.generateId)();
464
- let passedName;
465
- let passedPlugin;
466
- const plugin = this.fixture.BuildPlugin(SpyVcPlugin);
467
- factory.addPlugin = (named, plugin) => {
468
- passedName = named;
469
- passedPlugin = plugin;
470
- };
471
- this.fixture.addPlugin(name, plugin);
472
- test_utils_1.assert.isEqual(passedName, name);
473
- test_utils_1.assert.isEqual(passedPlugin, plugin);
474
- }
475
- static async getFactoryReturnsSpyFactory() {
476
- this.assertSpyFactoryUsed();
477
- }
478
- static async spyFactoryResetForEachTestIfDeleted() {
479
- delete heartwood_view_controllers_1.ViewControllerFactory.Class;
480
- }
481
- static async getFactoryReturnsSpyFactoryForNextTest() {
482
- this.assertSpyFactoryUsed();
483
- }
484
- static assertSpyFactoryUsed() {
485
- test_utils_1.assert.isInstanceOf(this.fixture.getFactory(), SpyViewControllerFactory_1.default);
486
- }
487
- static ViewFixture() {
488
- return this.Fixture('view', {
489
- controllerMap: {
490
- scope: ScopeSvc,
491
- client: ClientSvc,
492
- scopedByOrg: ScopedByOrgSvc,
493
- scopedByLocation: ScopedByLocationSvc,
494
- },
495
- });
496
- }
497
- static buildLoadOptions() {
498
- return this.router.buildLoadOptions();
499
- }
500
- static ScopedByOrgVc() {
501
- return this.fixture.Controller('scopedByOrg', {});
502
- }
503
- static ScopedByLocationVc() {
504
- return this.fixture.Controller('scopedByLocation', {});
505
- }
506
- static async loginAsDemoPerson() {
507
- const { client } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_VIEW_FIXTURE_CLIENT_2);
508
- return client;
509
- }
510
- static async loginAndGetProxy(phone) {
511
- const { client } = await this.fixtureNoOptions.loginAsDemoPerson(phone !== null && phone !== void 0 ? phone : constants_1.DEMO_NUMBER_VIEW_FIXTURE);
512
- const generator = this.getProxyGenerator();
513
- const token = await (generator === null || generator === void 0 ? void 0 : generator());
514
- return { client, token, generator };
515
- }
516
- static getProxyGenerator() {
517
- const decorator = __1.ClientProxyDecorator.getInstance();
518
- const generator = decorator.getProxyTokenGenerator();
519
- return generator;
520
- }
521
- static Scope() {
522
- const factory = this.fixture.getFactory();
523
- const vc = factory.Controller('scope', {});
524
- return { vc, fixture: this.fixture };
525
- }
526
- static MockVc(named = 'card') {
527
- const viewFixture = this.Fixture('view', {
528
- controllerMap: {
529
- card: Fake_svc_1.default,
530
- logging: LoggingViewController,
531
- },
532
- });
533
- const factory = viewFixture.getFactory();
534
- const vc = factory.Controller(named, {
535
- header: { title: 'hey' },
536
- });
537
- return vc;
538
- }
539
- static get router() {
540
- return this.fixture.getRouter();
541
- }
542
- };
543
- __decorate([
544
- (0, test_utils_1.test)()
545
- ], ViewFixtureTest, "canLogin", null);
546
- __decorate([
547
- (0, test_utils_1.test)()
548
- ], ViewFixtureTest, "loginFallsBackToDemoNumber", null);
549
- __decorate([
550
- (0, test_utils_1.test)()
551
- ], ViewFixtureTest, "canSetHeartwoodRoot", null);
552
- __decorate([
553
- (0, test_utils_1.test)()
554
- ], ViewFixtureTest, "fixturesShouldShareConnectToApiReferences", null);
555
- __decorate([
556
- (0, test_utils_1.test)()
557
- ], ViewFixtureTest, "canPassThroughPersonFixture", null);
558
- __decorate([
559
- (0, test_utils_1.test)()
560
- ], ViewFixtureTest, "feedsInScope", null);
561
- __decorate([
562
- (0, test_utils_1.test)()
563
- ], ViewFixtureTest, "scopeCanGetAndSetOrganization", null);
564
- __decorate([
565
- (0, test_utils_1.test)()
566
- ], ViewFixtureTest, "scopeGetsLastOrgByDefault", null);
567
- __decorate([
568
- (0, test_utils_1.test)()
569
- ], ViewFixtureTest, "scopeGetsLastLocationByDefault", null);
570
- __decorate([
571
- (0, test_utils_1.test)()
572
- ], ViewFixtureTest, "scopeCanGetAndSetLocation", null);
573
- __decorate([
574
- (0, test_utils_1.test)()
575
- ], ViewFixtureTest, "sharesPersonFixture", null);
576
- __decorate([
577
- (0, test_utils_1.test)()
578
- ], ViewFixtureTest, "canSetScopeForCurrentOrganizationAcrossViewFixtures", null);
579
- __decorate([
580
- (0, test_utils_1.test)()
581
- ], ViewFixtureTest, "scopeShouldBeResetEachRun", null);
582
- __decorate([
583
- (0, test_utils_1.test)()
584
- ], ViewFixtureTest, "fixturesShareVcFactory", null);
585
- __decorate([
586
- (0, test_utils_1.test)()
587
- ], ViewFixtureTest, "mixesInControllerMapWithLocalViews", null);
588
- __decorate([
589
- (0, test_utils_1.test)()
590
- ], ViewFixtureTest, "fixturesContinueToMixinViewControllers", null);
591
- __decorate([
592
- (0, test_utils_1.test)()
593
- ], ViewFixtureTest, "fixtureAttachesRenderCount", null);
594
- __decorate([
595
- (0, test_utils_1.test)()
596
- ], ViewFixtureTest, "fixturePatchesAlertToThrow", null);
597
- __decorate([
598
- (0, test_utils_1.test)()
599
- ], ViewFixtureTest, "fixturePatchesRenderInDialogToThrow", null);
600
- __decorate([
601
- (0, test_utils_1.test)()
602
- ], ViewFixtureTest, "testRouterThrowsOnRedirect", null);
603
- __decorate([
604
- (0, test_utils_1.test)()
605
- ], ViewFixtureTest, "canGetAuthenticatorInstance", null);
606
- __decorate([
607
- (0, test_utils_1.test)()
608
- ], ViewFixtureTest, "activeRecordThrowsByDefault", null);
609
- __decorate([
610
- (0, test_utils_1.test)()
611
- ], ViewFixtureTest, "activeRecordThrowReset", null);
612
- __decorate([
613
- (0, test_utils_1.test)()
614
- ], ViewFixtureTest, "loggingInWithViewFixtureSetsProxyTokenForSkill", null);
615
- __decorate([
616
- (0, test_utils_1.test)()
617
- ], ViewFixtureTest, "proxyGeneratorIsResetWhenDifferentPersonLogsIn", null);
618
- __decorate([
619
- (0, test_utils_1.test)()
620
- ], ViewFixtureTest, "sameProxyAcrossFixturesWithSameNumber", null);
621
- __decorate([
622
- (0, test_utils_1.test)()
623
- ], ViewFixtureTest, "generatorResetEachTest", null);
624
- __decorate([
625
- (0, test_utils_1.test)()
626
- ], ViewFixtureTest, "loggingInAsViewSetsClientForViewControllers", null);
627
- __decorate([
628
- (0, test_utils_1.test)()
629
- ], ViewFixtureTest, "viewClientIsResetAfterEachTest", null);
630
- __decorate([
631
- (0, test_utils_1.test)()
632
- ], ViewFixtureTest, "generatorIsNotVulnerableToRaceConditions", null);
633
- __decorate([
634
- (0, test_utils_1.test)()
635
- ], ViewFixtureTest, "patchesConfirmToThrow", null);
636
- __decorate([
637
- (0, test_utils_1.test)()
638
- ], ViewFixtureTest, "setsSwipeVcJumpToSlideDuration", null);
639
- __decorate([
640
- (0, test_utils_1.test)()
641
- ], ViewFixtureTest, "canSetScope", null);
642
- __decorate([
643
- (0, test_utils_1.test)()
644
- ], ViewFixtureTest, "loadingAScopedToOrgVcWithoutASeededOrgThrows", null);
645
- __decorate([
646
- (0, test_utils_1.test)()
647
- ], ViewFixtureTest, "loadingAScopedToLocationVcWithoutASeededLocationThrows", null);
648
- __decorate([
649
- (0, test_utils_1.test)(),
650
- (0, __1.seed)('organizations', 1)
651
- ], ViewFixtureTest, "loadingWithOrgScopeAndSeededOrg", null);
652
- __decorate([
653
- (0, test_utils_1.test)(),
654
- (0, __1.seed)('locations', 1)
655
- ], ViewFixtureTest, "loadingWithLocationScopeAndSeededLocation", null);
656
- __decorate([
657
- (0, test_utils_1.test)()
658
- ], ViewFixtureTest, "setsFactoryToFormAssert", null);
659
- __decorate([
660
- (0, test_utils_1.test)()
661
- ], ViewFixtureTest, "canSetMercuryClient", null);
662
- __decorate([
663
- (0, test_utils_1.test)()
664
- ], ViewFixtureTest, "loadOptionsComeWithFakeThemeManager", null);
665
- __decorate([
666
- (0, test_utils_1.test)()
667
- ], ViewFixtureTest, "sameFakeThemeEachTime", null);
668
- __decorate([
669
- (0, test_utils_1.test)()
670
- ], ViewFixtureTest, "sameThemesOnFixture", null);
671
- __decorate([
672
- (0, test_utils_1.test)()
673
- ], ViewFixtureTest, "canSetController", null);
674
- __decorate([
675
- (0, test_utils_1.test)()
676
- ], ViewFixtureTest, "deviceIsSetOnFixtureAndFactory", null);
677
- __decorate([
678
- (0, test_utils_1.test)()
679
- ], ViewFixtureTest, "newDeviceBeforeEach", null);
680
- __decorate([
681
- (0, test_utils_1.test)()
682
- ], ViewFixtureTest, "mutesLogs", null);
683
- __decorate([
684
- (0, test_utils_1.test)()
685
- ], ViewFixtureTest, "buildVcPluginExposedInFixture", null);
686
- __decorate([
687
- (0, test_utils_1.test)()
688
- ], ViewFixtureTest, "addPluginExposedInFixure", null);
689
- __decorate([
690
- (0, test_utils_1.test)()
691
- ], ViewFixtureTest, "getFactoryReturnsSpyFactory", null);
692
- __decorate([
693
- (0, test_utils_1.test)()
694
- ], ViewFixtureTest, "spyFactoryResetForEachTestIfDeleted", null);
695
- __decorate([
696
- (0, test_utils_1.test)()
697
- ], ViewFixtureTest, "getFactoryReturnsSpyFactoryForNextTest", null);
698
- ViewFixtureTest = __decorate([
699
- fake_1.default.login(DEMO_NUMBER_FORMATTED)
700
- ], ViewFixtureTest);
701
- exports.default = ViewFixtureTest;
702
- class LoggingViewController extends heartwood_view_controllers_1.AbstractViewController {
703
- getLog() {
704
- return this.log;
705
- }
706
- render() {
707
- return {};
708
- }
709
- }
710
- class ScopeSvc extends heartwood_view_controllers_1.AbstractSkillViewController {
711
- constructor() {
712
- super(...arguments);
713
- this.loadOptions = null;
714
- }
715
- async load(options) {
716
- this.loadOptions = options;
717
- }
718
- render() {
719
- return {
720
- layouts: [],
721
- };
722
- }
723
- }
724
- class ScopedByOrgSvc extends heartwood_view_controllers_1.AbstractSkillViewController {
725
- constructor() {
726
- super(...arguments);
727
- this.getScope = () => ['organization'];
728
- }
729
- render() {
730
- return {
731
- layouts: [],
732
- };
733
- }
734
- }
735
- class ScopedByLocationSvc extends heartwood_view_controllers_1.AbstractSkillViewController {
736
- constructor() {
737
- super(...arguments);
738
- this.getScope = () => ['location'];
739
- }
740
- render() {
741
- return {
742
- layouts: [],
743
- };
744
- }
745
- }
746
- class ClientSvc extends heartwood_view_controllers_1.AbstractSkillViewController {
747
- constructor() {
748
- super(...arguments);
749
- this.loadOptions = null;
750
- }
751
- connect() {
752
- return this.connectToApi();
753
- }
754
- render() {
755
- return {
756
- layouts: [],
757
- };
758
- }
759
- }
760
- class SpyVcPlugin {
761
- }