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