@sprucelabs/spruce-test-fixtures 45.2.9 → 46.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.d.ts +7 -0
- package/build/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +41 -0
- package/build/__tests__/behavioral/DatabaseFixture.test.d.ts +7 -0
- package/build/__tests__/behavioral/DatabaseFixture.test.js +59 -0
- package/build/__tests__/behavioral/DbResetsAsExpected.test.d.ts +5 -0
- package/build/__tests__/behavioral/DbResetsAsExpected.test.js +34 -0
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +15 -0
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +109 -0
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +4 -0
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +34 -0
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +5 -0
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +26 -0
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +8 -0
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +65 -0
- package/build/__tests__/behavioral/DummyStore.d.ts +55 -0
- package/build/__tests__/behavioral/DummyStore.js +36 -0
- package/build/__tests__/behavioral/FakingEventResponses.test.d.ts +12 -0
- package/build/__tests__/behavioral/FakingEventResponses.test.js +125 -0
- package/build/__tests__/behavioral/FixtureFactory.test.d.ts +7 -0
- package/build/__tests__/behavioral/FixtureFactory.test.js +79 -0
- package/build/__tests__/behavioral/LocationFixture.test.d.ts +15 -0
- package/build/__tests__/behavioral/LocationFixture.test.js +128 -0
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +12 -0
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +92 -0
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +4 -0
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +29 -0
- package/build/__tests__/behavioral/MercuryFixture.test.d.ts +19 -0
- package/build/__tests__/behavioral/MercuryFixture.test.js +175 -0
- package/build/__tests__/behavioral/OrganizationFixture.test.d.ts +31 -0
- package/build/__tests__/behavioral/OrganizationFixture.test.js +331 -0
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +4 -0
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +21 -0
- package/build/__tests__/behavioral/PersonFixture.test.d.ts +22 -0
- package/build/__tests__/behavioral/PersonFixture.test.js +224 -0
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +11 -0
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +95 -0
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +8 -0
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +60 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +5 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +37 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +7 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +44 -0
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +10 -0
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +130 -0
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +7 -0
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +42 -0
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +6 -0
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +37 -0
- package/build/__tests__/behavioral/RoleFixture.test.d.ts +15 -0
- package/build/__tests__/behavioral/RoleFixture.test.js +118 -0
- package/build/__tests__/behavioral/SeedingData.test.d.ts +24 -0
- package/build/__tests__/behavioral/SeedingData.test.js +271 -0
- package/build/__tests__/behavioral/SkillFixture.test.d.ts +13 -0
- package/build/__tests__/behavioral/SkillFixture.test.js +116 -0
- package/build/__tests__/behavioral/StoreFixture.test.d.ts +23 -0
- package/build/__tests__/behavioral/StoreFixture.test.js +156 -0
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +9 -0
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +71 -0
- package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +45 -0
- package/build/__tests__/behavioral/faking/FakeDecorator.test.js +418 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +23 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +27 -0
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +8 -0
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +93 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +8 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +56 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +14 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +141 -0
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +6 -0
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +42 -0
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +19 -0
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +140 -0
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +24 -0
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +174 -0
- package/build/__tests__/behavioral/faking/UpdatePerson.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/UpdatePerson.test.js +32 -0
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +35 -0
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +321 -0
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +48 -0
- package/build/__tests__/behavioral/faking/WhoAmI.test.d.ts +19 -0
- package/build/__tests__/behavioral/faking/WhoAmI.test.js +103 -0
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +10 -0
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +76 -0
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +37 -0
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +266 -0
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +14 -0
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +113 -0
- package/build/__tests__/behavioral/views/CheckingPermissions.test.d.ts +24 -0
- package/build/__tests__/behavioral/views/CheckingPermissions.test.js +162 -0
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +12 -0
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +55 -0
- package/build/__tests__/behavioral/views/Routing.test.d.ts +31 -0
- package/build/__tests__/behavioral/views/Routing.test.js +141 -0
- package/build/__tests__/behavioral/views/TestingScope.test.d.ts +9 -0
- package/build/__tests__/behavioral/views/TestingScope.test.js +67 -0
- package/build/__tests__/behavioral/views/ViewFixture.test.d.ts +102 -0
- package/build/__tests__/behavioral/views/ViewFixture.test.js +652 -0
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +11 -0
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +55 -0
- package/build/__tests__/support/AbstractFakeDecoratorTest.d.ts +5 -0
- package/build/__tests__/support/AbstractFakeDecoratorTest.js +27 -0
- package/build/__tests__/support/EventFaker.d.ts +5 -0
- package/build/__tests__/support/EventFaker.js +36 -0
- package/build/__tests__/support/FakeThemeManager.d.ts +8 -0
- package/build/__tests__/support/FakeThemeManager.js +40 -0
- package/build/__tests__/test.types.d.ts +2 -0
- package/build/__tests__/test.types.js +2 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.d.ts +5 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.js +9 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +51 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +33 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/src/.spruce/settings.json +6 -0
- package/build/__tests__/testDirsAndFiles/skill/build/.spruce/views/views.js +18 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +11 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +7 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +19 -0
- package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +31 -0
- package/build/__tests__/testDirsAndFiles/skill/package.json +5 -0
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/settings.json +6 -0
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.d.ts +7 -0
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.js +16 -0
- package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +11 -0
- package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +31 -0
- package/build/esm/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +53 -0
- package/build/esm/__tests__/behavioral/DatabaseFixture.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/DatabaseFixture.test.js +48 -0
- package/build/esm/__tests__/behavioral/DbResetsAsExpected.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/DbResetsAsExpected.test.js +28 -0
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +15 -0
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +125 -0
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +40 -0
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +23 -0
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +76 -0
- package/build/esm/__tests__/behavioral/DummyStore.d.ts +55 -0
- package/build/esm/__tests__/behavioral/DummyStore.js +43 -0
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.d.ts +12 -0
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +147 -0
- package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/FixtureFactory.test.js +61 -0
- package/build/esm/__tests__/behavioral/LocationFixture.test.d.ts +15 -0
- package/build/esm/__tests__/behavioral/LocationFixture.test.js +153 -0
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +12 -0
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +110 -0
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +38 -0
- package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +19 -0
- package/build/esm/__tests__/behavioral/MercuryFixture.test.js +209 -0
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.d.ts +31 -0
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +387 -0
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +18 -0
- package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +22 -0
- package/build/esm/__tests__/behavioral/PersonFixture.test.js +231 -0
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +11 -0
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +112 -0
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +80 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +51 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +59 -0
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +10 -0
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +139 -0
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +57 -0
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +6 -0
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +48 -0
- package/build/esm/__tests__/behavioral/RoleFixture.test.d.ts +15 -0
- package/build/esm/__tests__/behavioral/RoleFixture.test.js +143 -0
- package/build/esm/__tests__/behavioral/SeedingData.test.d.ts +24 -0
- package/build/esm/__tests__/behavioral/SeedingData.test.js +314 -0
- package/build/esm/__tests__/behavioral/SkillFixture.test.d.ts +13 -0
- package/build/esm/__tests__/behavioral/SkillFixture.test.js +139 -0
- package/build/esm/__tests__/behavioral/StoreFixture.test.d.ts +23 -0
- package/build/esm/__tests__/behavioral/StoreFixture.test.js +164 -0
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +9 -0
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +87 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +45 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +479 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +28 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +32 -0
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +82 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +70 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +14 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +165 -0
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +6 -0
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +55 -0
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +19 -0
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +175 -0
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +24 -0
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +214 -0
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +38 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +35 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +360 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +31 -0
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.d.ts +19 -0
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +140 -0
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +10 -0
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +94 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +37 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +322 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +14 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +134 -0
- package/build/esm/__tests__/behavioral/views/CheckingPermissions.test.d.ts +24 -0
- package/build/esm/__tests__/behavioral/views/CheckingPermissions.test.js +200 -0
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +12 -0
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +69 -0
- package/build/esm/__tests__/behavioral/views/Routing.test.d.ts +31 -0
- package/build/esm/__tests__/behavioral/views/Routing.test.js +169 -0
- package/build/esm/__tests__/behavioral/views/TestingScope.test.d.ts +9 -0
- package/build/esm/__tests__/behavioral/views/TestingScope.test.js +84 -0
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.d.ts +102 -0
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.js +731 -0
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +11 -0
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +63 -0
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.d.ts +5 -0
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +34 -0
- package/build/esm/__tests__/support/EventFaker.d.ts +5 -0
- package/build/esm/__tests__/support/EventFaker.js +45 -0
- package/build/esm/__tests__/support/FakeThemeManager.d.ts +8 -0
- package/build/esm/__tests__/support/FakeThemeManager.js +37 -0
- package/build/esm/__tests__/test.types.d.ts +2 -0
- package/build/esm/__tests__/test.types.js +1 -0
- package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +51 -0
- package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +41 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +7 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +27 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +25 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +25 -0
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/tests/fixtures/ViewFixture.d.ts +1 -0
- package/build/esm/tests/fixtures/ViewFixture.js +4 -1
- package/build/esm/tests/routers/TestRouter.d.ts +3 -0
- package/build/esm/tests/routers/TestRouter.js +6 -0
- package/build/esm/utilities/vcDisk.utility.js +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -1
- package/build/tests/fixtures/ViewFixture.d.ts +1 -0
- package/build/tests/fixtures/ViewFixture.js +4 -1
- package/build/tests/routers/TestRouter.d.ts +3 -0
- package/build/tests/routers/TestRouter.js +6 -0
- package/build/utilities/vcDisk.utility.js +1 -0
- package/package.json +19 -19
|
@@ -0,0 +1,731 @@
|
|
|
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, ActiveRecordListViewController, AuthenticatorImpl, buildForm, formAssert, SwipeViewControllerImpl, vcAssert, } 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';
|
|
20
|
+
import { errorAssert } 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 TestScope from '../../../tests/fixtures/TestScope.js';
|
|
27
|
+
import ViewFixture from '../../../tests/fixtures/ViewFixture.js';
|
|
28
|
+
import EventFaker from '../../support/EventFaker.js';
|
|
29
|
+
import FakeThemeManager from '../../support/FakeThemeManager.js';
|
|
30
|
+
const DEMO_NUMBER_FORMATTED = formatPhoneNumber(DEMO_NUMBER !== null && DEMO_NUMBER !== void 0 ? DEMO_NUMBER : '');
|
|
31
|
+
let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
|
32
|
+
static beforeEach() {
|
|
33
|
+
const _super = Object.create(null, {
|
|
34
|
+
beforeEach: { get: () => super.beforeEach }
|
|
35
|
+
});
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
yield _super.beforeEach.call(this);
|
|
38
|
+
this.fixture = this.Fixture('view', {
|
|
39
|
+
controllerMap: {
|
|
40
|
+
scope: ScopeSvc,
|
|
41
|
+
client: ClientSvc,
|
|
42
|
+
scopedByOrg: ScopedByOrgSvc,
|
|
43
|
+
scopedByLocation: ScopedByLocationSvc,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
this.fixtureNoOptions = this.Fixture('view');
|
|
47
|
+
this.eventFaker = new EventFaker();
|
|
48
|
+
yield this.eventFaker.fakeRegisterSkill();
|
|
49
|
+
yield this.eventFaker.fakeUnregisterSkill();
|
|
50
|
+
yield this.eventFaker.fakeRegisterProxyToken();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
static canLogin() {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const auth = AuthenticatorImpl.getInstance();
|
|
56
|
+
assert.isFalsy(auth.getPerson());
|
|
57
|
+
const { person } = yield this.fixtureNoOptions.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
|
58
|
+
const loggedIn = auth.getPerson();
|
|
59
|
+
assert.isTruthy(loggedIn);
|
|
60
|
+
assert.isEqualDeep(loggedIn, person);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
static loginFallsBackToDemoNumber() {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const { person } = yield this.fixtureNoOptions.loginAsDemoPerson();
|
|
66
|
+
assert.isEqual(person.phone, DEMO_NUMBER_FORMATTED);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
static canSetHeartwoodRoot() {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const fixture = this.Fixture('view', {
|
|
72
|
+
controllerMap: {
|
|
73
|
+
'heartwood.root': true,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
const factory = fixture.getFactory();
|
|
77
|
+
//@ts-ignore
|
|
78
|
+
assert.isTrue(factory.controllerMap['heartwood.root']);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
static fixturesShouldShareConnectToApiReferences() {
|
|
82
|
+
const fixture1 = this.fixtureNoOptions;
|
|
83
|
+
const fixture2 = this.fixtureNoOptions;
|
|
84
|
+
//@ts-ignore
|
|
85
|
+
assert.isEqual(fixture1.connectToApi, fixture2.connectToApi);
|
|
86
|
+
}
|
|
87
|
+
static canPassThroughPersonFixture() {
|
|
88
|
+
const personFixture = this.Fixture('person');
|
|
89
|
+
const viewFixture = this.Fixture('view', { people: personFixture });
|
|
90
|
+
//@ts-ignore
|
|
91
|
+
assert.isEqual(viewFixture.people, personFixture);
|
|
92
|
+
}
|
|
93
|
+
static feedsInScope() {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const { vc, fixture } = this.Scope();
|
|
96
|
+
assert.isNull(vc.loadOptions);
|
|
97
|
+
yield fixture.load(vc, {});
|
|
98
|
+
assert.isTruthy(vc.loadOptions);
|
|
99
|
+
assert.isTruthy(vc.loadOptions.scope);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
static scopeCanGetAndSetOrganization() {
|
|
103
|
+
var _a;
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
const { vc, fixture } = this.Scope();
|
|
106
|
+
yield fixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
|
107
|
+
yield fixture.load(vc);
|
|
108
|
+
const scope = (_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope;
|
|
109
|
+
assert.isTruthy(scope);
|
|
110
|
+
let org = yield scope.getCurrentOrganization();
|
|
111
|
+
assert.isNull(org);
|
|
112
|
+
const created = yield this.organizations.seedDemoOrganization({
|
|
113
|
+
name: 'Scope org',
|
|
114
|
+
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
|
115
|
+
});
|
|
116
|
+
scope.setCurrentOrganization(created.id);
|
|
117
|
+
org = yield scope.getCurrentOrganization();
|
|
118
|
+
assert.isEqualDeep(org, created);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
static scopeGetsLastOrgByDefault() {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
const orgs = this.organizations;
|
|
124
|
+
yield orgs.seedDemoOrganization({
|
|
125
|
+
name: 'Scope org',
|
|
126
|
+
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
|
127
|
+
});
|
|
128
|
+
yield orgs.seedDemoOrganization({
|
|
129
|
+
name: 'Scope org',
|
|
130
|
+
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
|
131
|
+
});
|
|
132
|
+
const expected = yield orgs.seedDemoOrganization({
|
|
133
|
+
name: 'Scope org',
|
|
134
|
+
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
|
135
|
+
});
|
|
136
|
+
const viewFixture = this.fixtureNoOptions;
|
|
137
|
+
yield viewFixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
|
138
|
+
const current = yield viewFixture.getScope().getCurrentOrganization();
|
|
139
|
+
assert.isEqualDeep(current, expected);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
static scopeGetsLastLocationByDefault() {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
const org = yield this.organizations.seedDemoOrganization({
|
|
145
|
+
name: 'Scope org',
|
|
146
|
+
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
|
147
|
+
});
|
|
148
|
+
yield this.locations.seedDemoLocation({
|
|
149
|
+
organizationId: org.id,
|
|
150
|
+
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
|
151
|
+
});
|
|
152
|
+
yield this.locations.seedDemoLocation({
|
|
153
|
+
organizationId: org.id,
|
|
154
|
+
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
|
155
|
+
});
|
|
156
|
+
yield this.locations.seedDemoLocation({
|
|
157
|
+
organizationId: org.id,
|
|
158
|
+
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
|
159
|
+
});
|
|
160
|
+
const viewFixture = this.fixtureNoOptions;
|
|
161
|
+
yield viewFixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
|
162
|
+
const current = yield viewFixture.getScope().getCurrentLocation();
|
|
163
|
+
const { client } = yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
|
164
|
+
const [{ locations }] = yield client.emitAndFlattenResponses('list-locations::v2020_12_25', {
|
|
165
|
+
target: {
|
|
166
|
+
organizationId: org.id,
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
const expected = locations[0];
|
|
170
|
+
assert.isEqualDeep(current, expected);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
static scopeCanGetAndSetLocation() {
|
|
174
|
+
var _a;
|
|
175
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
|
177
|
+
const { vc, fixture } = this.Scope();
|
|
178
|
+
yield fixture.load(vc);
|
|
179
|
+
const scope = (_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope;
|
|
180
|
+
assert.isTruthy(scope);
|
|
181
|
+
let location = yield scope.getCurrentLocation();
|
|
182
|
+
assert.isNull(location);
|
|
183
|
+
const created = yield this.Fixture('location').seedDemoLocation({
|
|
184
|
+
name: 'Scope org',
|
|
185
|
+
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
|
186
|
+
});
|
|
187
|
+
scope.setCurrentLocation(created.id);
|
|
188
|
+
location = yield scope.getCurrentLocation();
|
|
189
|
+
assert.isEqualDeep(location, created);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
static sharesPersonFixture() {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
const { fixture } = this.Scope();
|
|
195
|
+
assert.isEqual(
|
|
196
|
+
//@ts-ignore
|
|
197
|
+
fixture.people,
|
|
198
|
+
//@ts-ignore
|
|
199
|
+
fixture.orgs.people);
|
|
200
|
+
assert.isEqual(
|
|
201
|
+
//@ts-ignore
|
|
202
|
+
fixture.people,
|
|
203
|
+
//@ts-ignore
|
|
204
|
+
fixture.locations.people);
|
|
205
|
+
assert.isEqual(
|
|
206
|
+
//@ts-ignore
|
|
207
|
+
fixture.orgs,
|
|
208
|
+
//@ts-ignore
|
|
209
|
+
fixture.locations.orgs);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
static canSetScopeForCurrentOrganizationAcrossViewFixtures() {
|
|
213
|
+
var _a;
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
const org = yield this.organizations.seedDemoOrganization({
|
|
216
|
+
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
|
217
|
+
name: 'My new org!',
|
|
218
|
+
});
|
|
219
|
+
this.fixtureNoOptions.getScope().setCurrentOrganization(org.id);
|
|
220
|
+
const { vc, fixture } = this.Scope();
|
|
221
|
+
yield fixture.load(vc);
|
|
222
|
+
const current = yield ((_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope.getCurrentOrganization());
|
|
223
|
+
assert.isEqualDeep(current, org);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
static scopeShouldBeResetEachRun() {
|
|
227
|
+
var _a;
|
|
228
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
229
|
+
const { vc, fixture } = this.Scope();
|
|
230
|
+
yield fixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
|
231
|
+
yield fixture.load(vc);
|
|
232
|
+
const current = yield ((_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope.getCurrentOrganization());
|
|
233
|
+
assert.isNull(current);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
static fixturesShareVcFactory() {
|
|
237
|
+
const options = {
|
|
238
|
+
controllerMap: {
|
|
239
|
+
'heartwood.root': true,
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
const fixture1 = this.Fixture('view', options);
|
|
243
|
+
const fixture2 = this.Fixture('view', options);
|
|
244
|
+
assert.isEqual(fixture1.getFactory(), fixture2.getFactory());
|
|
245
|
+
}
|
|
246
|
+
static mixesInControllerMapWithLocalViews() {
|
|
247
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
+
yield this.bootAndRegisterSkillFromTestDir('skill');
|
|
249
|
+
const fixture = this.Fixture('view', {
|
|
250
|
+
controllerMap: {
|
|
251
|
+
'new.view': FakeSkillViewController,
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
const factory = fixture.getFactory();
|
|
255
|
+
//@ts-ignore
|
|
256
|
+
factory.Controller('views.book', {});
|
|
257
|
+
//@ts-ignore
|
|
258
|
+
factory.Controller('new.view', {});
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
static fixturesContinueToMixinViewControllers() {
|
|
262
|
+
this.Fixture('view', {
|
|
263
|
+
controllerMap: {
|
|
264
|
+
'new.view': FakeSkillViewController,
|
|
265
|
+
},
|
|
266
|
+
}).getFactory();
|
|
267
|
+
const fixture = this.Fixture('view', {
|
|
268
|
+
controllerMap: {
|
|
269
|
+
'new.view2': FakeSkillViewController,
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
//@ts-ignore
|
|
273
|
+
fixture.getFactory().Controller('new.view2');
|
|
274
|
+
}
|
|
275
|
+
static fixtureAttachesRenderCount() {
|
|
276
|
+
const vc = this.MockVc();
|
|
277
|
+
vcAssert.assertTriggerRenderCount(vc, 0);
|
|
278
|
+
vc.triggerRender();
|
|
279
|
+
vcAssert.assertTriggerRenderCount(vc, 1);
|
|
280
|
+
}
|
|
281
|
+
static fixturePatchesAlertToThrow() {
|
|
282
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
283
|
+
const vc = this.MockVc();
|
|
284
|
+
//@ts-ignore
|
|
285
|
+
assert.isFunction(vc._originalAlert);
|
|
286
|
+
//@ts-ignore
|
|
287
|
+
yield assert.doesThrowAsync(() => vc.alert());
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
static fixturePatchesRenderInDialogToThrow() {
|
|
291
|
+
const vc = this.MockVc();
|
|
292
|
+
//@ts-ignore
|
|
293
|
+
assert.isFunction(vc._originalRenderInDialog);
|
|
294
|
+
//@ts-ignore
|
|
295
|
+
assert.doesThrow(() => vc.renderInDialog({}));
|
|
296
|
+
}
|
|
297
|
+
static testRouterThrowsOnRedirect() {
|
|
298
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
299
|
+
const router = this.views.getRouter();
|
|
300
|
+
yield assert.doesThrowAsync(() => router.redirect('heartwood.root'));
|
|
301
|
+
yield vcAssert.assertActionRedirects({
|
|
302
|
+
action: () => router.redirect('heartwood.root'),
|
|
303
|
+
router,
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
static canGetAuthenticatorInstance() {
|
|
308
|
+
const viewFixture = this.Fixture('view', {
|
|
309
|
+
controllerMap: {
|
|
310
|
+
card: FakeSkillViewController,
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
assert.isFunction(viewFixture.getAuthenticator);
|
|
314
|
+
assert.isEqual(viewFixture.getAuthenticator(), AuthenticatorImpl.getInstance());
|
|
315
|
+
}
|
|
316
|
+
static activeRecordThrowsByDefault() {
|
|
317
|
+
//@ts-ignore
|
|
318
|
+
assert.isTrue(ActiveRecordListViewController.shouldThrowOnResponseError);
|
|
319
|
+
ActiveRecordListViewController.setShouldThrowOnResponseError(false);
|
|
320
|
+
}
|
|
321
|
+
static activeRecordThrowReset() {
|
|
322
|
+
//@ts-ignore
|
|
323
|
+
assert.isTrue(ActiveRecordListViewController.shouldThrowOnResponseError);
|
|
324
|
+
}
|
|
325
|
+
static patchesFormsToThrow() {
|
|
326
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
327
|
+
const viewFixture = this.Fixture('view', {
|
|
328
|
+
controllerMap: {},
|
|
329
|
+
});
|
|
330
|
+
const formVc = viewFixture.Controller('form', buildForm({
|
|
331
|
+
id: 'test',
|
|
332
|
+
schema: { id: 'test', fields: {} },
|
|
333
|
+
sections: [],
|
|
334
|
+
}));
|
|
335
|
+
yield assert.doesThrowAsync(() => formVc.submit());
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
static loggingInWithViewFixtureSetsProxyTokenForSkill() {
|
|
339
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
340
|
+
const { client, token, generator } = yield this.loginAndGetProxy();
|
|
341
|
+
assert.isTruthy(token);
|
|
342
|
+
assert.isTruthy(client.getProxyToken());
|
|
343
|
+
assert.isEqual(token, client.getProxyToken());
|
|
344
|
+
const token2 = yield (generator === null || generator === void 0 ? void 0 : generator());
|
|
345
|
+
assert.isEqual(token, token2);
|
|
346
|
+
const results = yield client.emit('whoami::v2020_12_25');
|
|
347
|
+
eventResponseUtil.getFirstResponseOrThrow(results);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
static proxyGeneratorIsResetWhenDifferentPersonLogsIn() {
|
|
351
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
+
const { token } = yield this.loginAndGetProxy();
|
|
353
|
+
const { token: token2 } = yield this.loginAndGetProxy(DEMO_NUMBER_VIEW_FIXTURE_2);
|
|
354
|
+
assert.isNotEqual(token, token2);
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
static sameProxyAcrossFixturesWithSameNumber() {
|
|
358
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
359
|
+
const { token } = yield this.loginAndGetProxy();
|
|
360
|
+
const { token: token2 } = yield this.loginAndGetProxy();
|
|
361
|
+
assert.isEqual(token, token2);
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
static generatorResetEachTest() {
|
|
365
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
366
|
+
//@ts-ignore
|
|
367
|
+
assert.isEqualDeep(ViewFixture.loggedInPersonProxyTokens, {});
|
|
368
|
+
const generator = this.getProxyGenerator();
|
|
369
|
+
assert.isFalsy(generator);
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
static loggingInAsViewSetsClientForViewControllers() {
|
|
373
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
374
|
+
const client = yield this.loginAsDemoPerson();
|
|
375
|
+
const vc = this.fixture.Controller('client', {});
|
|
376
|
+
const client2 = yield vc.connect();
|
|
377
|
+
assert.isEqual(client, client2);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
static viewClientIsResetAfterEachTest() {
|
|
381
|
+
//@ts-ignore
|
|
382
|
+
assert.isFalsy(ViewFixture.viewClient);
|
|
383
|
+
}
|
|
384
|
+
static generatorIsNotVulnerableToRaceConditions() {
|
|
385
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
386
|
+
const client = yield this.loginAsDemoPerson();
|
|
387
|
+
const generator = this.fixture.getProxyTokenGenerator();
|
|
388
|
+
assert.isTruthy(generator);
|
|
389
|
+
let hitCount = 0;
|
|
390
|
+
yield client.on('register-proxy-token::v2020_12_25', () => {
|
|
391
|
+
hitCount++;
|
|
392
|
+
return {
|
|
393
|
+
token: 'aoeu',
|
|
394
|
+
};
|
|
395
|
+
});
|
|
396
|
+
yield Promise.all([
|
|
397
|
+
generator(),
|
|
398
|
+
generator(),
|
|
399
|
+
generator(),
|
|
400
|
+
generator(),
|
|
401
|
+
generator(),
|
|
402
|
+
generator(),
|
|
403
|
+
generator(),
|
|
404
|
+
generator(),
|
|
405
|
+
generator(),
|
|
406
|
+
]);
|
|
407
|
+
assert.isEqual(hitCount, 1);
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
static patchesConfirmToThrow() {
|
|
411
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
412
|
+
const vc = this.MockVc();
|
|
413
|
+
//@ts-ignore
|
|
414
|
+
yield assert.doesThrowAsync(() => vc.confirm());
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
static setsSwipeVcJumpToSlideDuration() {
|
|
418
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
419
|
+
assert.isEqual(SwipeViewControllerImpl.swipeDelay, 0);
|
|
420
|
+
SwipeViewControllerImpl.swipeDelay = 100;
|
|
421
|
+
yield ViewFixture.beforeEach();
|
|
422
|
+
assert.isEqual(SwipeViewControllerImpl.swipeDelay, 0);
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
static canSetScope() {
|
|
426
|
+
const scope = new TestScope({
|
|
427
|
+
organizationFixture: this.organizations,
|
|
428
|
+
locationFixture: this.locations,
|
|
429
|
+
});
|
|
430
|
+
this.fixture.setScope(scope);
|
|
431
|
+
assert.isEqual(this.fixture.getScope(), scope);
|
|
432
|
+
}
|
|
433
|
+
static loadingAScopedToOrgVcWithoutASeededOrgThrows() {
|
|
434
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
435
|
+
const vc = this.ScopedByOrgVc();
|
|
436
|
+
const err = yield assert.doesThrowAsync(() => this.fixture.load(vc));
|
|
437
|
+
errorAssert.assertError(err, 'SCOPE_REQUIREMENTS_NOT_MET');
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
static loadingAScopedToLocationVcWithoutASeededLocationThrows() {
|
|
441
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
442
|
+
const vc = this.ScopedByLocationVc();
|
|
443
|
+
const err = yield assert.doesThrowAsync(() => this.fixture.load(vc));
|
|
444
|
+
errorAssert.assertError(err, 'SCOPE_REQUIREMENTS_NOT_MET');
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
static loadingWithOrgScopeAndSeededOrg() {
|
|
448
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
449
|
+
const vc = this.ScopedByOrgVc();
|
|
450
|
+
yield this.fixture.load(vc);
|
|
451
|
+
vc.getScope = () => ['employed', 'organization'];
|
|
452
|
+
yield this.fixture.load(vc);
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
static loadingWithLocationScopeAndSeededLocation() {
|
|
456
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
457
|
+
const vc = this.ScopedByLocationVc();
|
|
458
|
+
yield this.fixture.load(vc);
|
|
459
|
+
vc.getScope = () => ['employed', 'location'];
|
|
460
|
+
yield this.fixture.load(vc);
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
static setsFactoryToFormAssert() {
|
|
464
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
465
|
+
this.fixture.getFactory();
|
|
466
|
+
//@ts-ignore
|
|
467
|
+
assert.isEqual(formAssert.views, this.fixture.getFactory());
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
static canSetMercuryClient() {
|
|
471
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
472
|
+
const client = yield this.mercury.connectToApi({ shouldReUseClient: false });
|
|
473
|
+
this.fixture.setClient(client);
|
|
474
|
+
//@ts-ignore
|
|
475
|
+
assert.isEqual(ViewFixture.viewClient, client);
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
static loadOptionsComeWithFakeThemeManager() {
|
|
479
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
480
|
+
const options = this.buildLoadOptions();
|
|
481
|
+
assert.isTrue(options.themes instanceof FakeThemeManager);
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
static sameFakeThemeEachTime() {
|
|
485
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
486
|
+
const options1 = this.buildLoadOptions();
|
|
487
|
+
const options2 = this.buildLoadOptions();
|
|
488
|
+
assert.isEqual(options1.themes, options2.themes);
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
static sameThemesOnFixture() {
|
|
492
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
493
|
+
assert.isEqual(this.fixture.getThemes(), this.buildLoadOptions().themes);
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
static buildLoadOptions() {
|
|
497
|
+
return this.router.buildLoadOptions();
|
|
498
|
+
}
|
|
499
|
+
static ScopedByOrgVc() {
|
|
500
|
+
return this.fixture.Controller('scopedByOrg', {});
|
|
501
|
+
}
|
|
502
|
+
static ScopedByLocationVc() {
|
|
503
|
+
return this.fixture.Controller('scopedByLocation', {});
|
|
504
|
+
}
|
|
505
|
+
static loginAsDemoPerson() {
|
|
506
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
507
|
+
const { client } = yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE_CLIENT_2);
|
|
508
|
+
return client;
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
static loginAndGetProxy(phone) {
|
|
512
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
513
|
+
const { client } = yield this.fixtureNoOptions.loginAsDemoPerson(phone !== null && phone !== void 0 ? phone : DEMO_NUMBER_VIEW_FIXTURE);
|
|
514
|
+
const generator = this.getProxyGenerator();
|
|
515
|
+
const token = yield (generator === null || generator === void 0 ? void 0 : generator());
|
|
516
|
+
return { client, token, generator };
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
static getProxyGenerator() {
|
|
520
|
+
const decorator = ClientProxyDecorator.getInstance();
|
|
521
|
+
const generator = decorator.getProxyTokenGenerator();
|
|
522
|
+
return generator;
|
|
523
|
+
}
|
|
524
|
+
static Scope() {
|
|
525
|
+
const factory = this.fixture.getFactory();
|
|
526
|
+
const vc = factory.Controller('scope', {});
|
|
527
|
+
return { vc, fixture: this.fixture };
|
|
528
|
+
}
|
|
529
|
+
static MockVc() {
|
|
530
|
+
const viewFixture = this.Fixture('view', {
|
|
531
|
+
controllerMap: {
|
|
532
|
+
card: FakeSkillViewController,
|
|
533
|
+
},
|
|
534
|
+
});
|
|
535
|
+
const factory = viewFixture.getFactory();
|
|
536
|
+
const vc = factory.Controller('card', {
|
|
537
|
+
header: { title: 'hey' },
|
|
538
|
+
});
|
|
539
|
+
return vc;
|
|
540
|
+
}
|
|
541
|
+
static get router() {
|
|
542
|
+
return this.fixture.getRouter();
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
__decorate([
|
|
546
|
+
test()
|
|
547
|
+
], ViewFixtureTest, "canLogin", null);
|
|
548
|
+
__decorate([
|
|
549
|
+
test()
|
|
550
|
+
], ViewFixtureTest, "loginFallsBackToDemoNumber", null);
|
|
551
|
+
__decorate([
|
|
552
|
+
test()
|
|
553
|
+
], ViewFixtureTest, "canSetHeartwoodRoot", null);
|
|
554
|
+
__decorate([
|
|
555
|
+
test()
|
|
556
|
+
], ViewFixtureTest, "fixturesShouldShareConnectToApiReferences", null);
|
|
557
|
+
__decorate([
|
|
558
|
+
test()
|
|
559
|
+
], ViewFixtureTest, "canPassThroughPersonFixture", null);
|
|
560
|
+
__decorate([
|
|
561
|
+
test()
|
|
562
|
+
], ViewFixtureTest, "feedsInScope", null);
|
|
563
|
+
__decorate([
|
|
564
|
+
test()
|
|
565
|
+
], ViewFixtureTest, "scopeCanGetAndSetOrganization", null);
|
|
566
|
+
__decorate([
|
|
567
|
+
test()
|
|
568
|
+
], ViewFixtureTest, "scopeGetsLastOrgByDefault", null);
|
|
569
|
+
__decorate([
|
|
570
|
+
test()
|
|
571
|
+
], ViewFixtureTest, "scopeGetsLastLocationByDefault", null);
|
|
572
|
+
__decorate([
|
|
573
|
+
test()
|
|
574
|
+
], ViewFixtureTest, "scopeCanGetAndSetLocation", null);
|
|
575
|
+
__decorate([
|
|
576
|
+
test()
|
|
577
|
+
], ViewFixtureTest, "sharesPersonFixture", null);
|
|
578
|
+
__decorate([
|
|
579
|
+
test()
|
|
580
|
+
], ViewFixtureTest, "canSetScopeForCurrentOrganizationAcrossViewFixtures", null);
|
|
581
|
+
__decorate([
|
|
582
|
+
test()
|
|
583
|
+
], ViewFixtureTest, "scopeShouldBeResetEachRun", null);
|
|
584
|
+
__decorate([
|
|
585
|
+
test()
|
|
586
|
+
], ViewFixtureTest, "fixturesShareVcFactory", null);
|
|
587
|
+
__decorate([
|
|
588
|
+
test()
|
|
589
|
+
], ViewFixtureTest, "mixesInControllerMapWithLocalViews", null);
|
|
590
|
+
__decorate([
|
|
591
|
+
test()
|
|
592
|
+
], ViewFixtureTest, "fixturesContinueToMixinViewControllers", null);
|
|
593
|
+
__decorate([
|
|
594
|
+
test()
|
|
595
|
+
], ViewFixtureTest, "fixtureAttachesRenderCount", null);
|
|
596
|
+
__decorate([
|
|
597
|
+
test()
|
|
598
|
+
], ViewFixtureTest, "fixturePatchesAlertToThrow", null);
|
|
599
|
+
__decorate([
|
|
600
|
+
test()
|
|
601
|
+
], ViewFixtureTest, "fixturePatchesRenderInDialogToThrow", null);
|
|
602
|
+
__decorate([
|
|
603
|
+
test()
|
|
604
|
+
], ViewFixtureTest, "testRouterThrowsOnRedirect", null);
|
|
605
|
+
__decorate([
|
|
606
|
+
test()
|
|
607
|
+
], ViewFixtureTest, "canGetAuthenticatorInstance", null);
|
|
608
|
+
__decorate([
|
|
609
|
+
test()
|
|
610
|
+
], ViewFixtureTest, "activeRecordThrowsByDefault", null);
|
|
611
|
+
__decorate([
|
|
612
|
+
test()
|
|
613
|
+
], ViewFixtureTest, "activeRecordThrowReset", null);
|
|
614
|
+
__decorate([
|
|
615
|
+
test.skip()
|
|
616
|
+
], ViewFixtureTest, "patchesFormsToThrow", null);
|
|
617
|
+
__decorate([
|
|
618
|
+
test()
|
|
619
|
+
], ViewFixtureTest, "loggingInWithViewFixtureSetsProxyTokenForSkill", null);
|
|
620
|
+
__decorate([
|
|
621
|
+
test()
|
|
622
|
+
], ViewFixtureTest, "proxyGeneratorIsResetWhenDifferentPersonLogsIn", null);
|
|
623
|
+
__decorate([
|
|
624
|
+
test()
|
|
625
|
+
], ViewFixtureTest, "sameProxyAcrossFixturesWithSameNumber", null);
|
|
626
|
+
__decorate([
|
|
627
|
+
test()
|
|
628
|
+
], ViewFixtureTest, "generatorResetEachTest", null);
|
|
629
|
+
__decorate([
|
|
630
|
+
test()
|
|
631
|
+
], ViewFixtureTest, "loggingInAsViewSetsClientForViewControllers", null);
|
|
632
|
+
__decorate([
|
|
633
|
+
test()
|
|
634
|
+
], ViewFixtureTest, "viewClientIsResetAfterEachTest", null);
|
|
635
|
+
__decorate([
|
|
636
|
+
test()
|
|
637
|
+
], ViewFixtureTest, "generatorIsNotVulnerableToRaceConditions", null);
|
|
638
|
+
__decorate([
|
|
639
|
+
test()
|
|
640
|
+
], ViewFixtureTest, "patchesConfirmToThrow", null);
|
|
641
|
+
__decorate([
|
|
642
|
+
test()
|
|
643
|
+
], ViewFixtureTest, "setsSwipeVcJumpToSlideDuration", null);
|
|
644
|
+
__decorate([
|
|
645
|
+
test()
|
|
646
|
+
], ViewFixtureTest, "canSetScope", null);
|
|
647
|
+
__decorate([
|
|
648
|
+
test()
|
|
649
|
+
], ViewFixtureTest, "loadingAScopedToOrgVcWithoutASeededOrgThrows", null);
|
|
650
|
+
__decorate([
|
|
651
|
+
test()
|
|
652
|
+
], ViewFixtureTest, "loadingAScopedToLocationVcWithoutASeededLocationThrows", null);
|
|
653
|
+
__decorate([
|
|
654
|
+
test(),
|
|
655
|
+
seed('organizations', 1)
|
|
656
|
+
], ViewFixtureTest, "loadingWithOrgScopeAndSeededOrg", null);
|
|
657
|
+
__decorate([
|
|
658
|
+
test(),
|
|
659
|
+
seed('locations', 1)
|
|
660
|
+
], ViewFixtureTest, "loadingWithLocationScopeAndSeededLocation", null);
|
|
661
|
+
__decorate([
|
|
662
|
+
test()
|
|
663
|
+
], ViewFixtureTest, "setsFactoryToFormAssert", null);
|
|
664
|
+
__decorate([
|
|
665
|
+
test()
|
|
666
|
+
], ViewFixtureTest, "canSetMercuryClient", null);
|
|
667
|
+
__decorate([
|
|
668
|
+
test()
|
|
669
|
+
], ViewFixtureTest, "loadOptionsComeWithFakeThemeManager", null);
|
|
670
|
+
__decorate([
|
|
671
|
+
test()
|
|
672
|
+
], ViewFixtureTest, "sameFakeThemeEachTime", null);
|
|
673
|
+
__decorate([
|
|
674
|
+
test()
|
|
675
|
+
], ViewFixtureTest, "sameThemesOnFixture", null);
|
|
676
|
+
ViewFixtureTest = __decorate([
|
|
677
|
+
fake.login(DEMO_NUMBER_FORMATTED)
|
|
678
|
+
], ViewFixtureTest);
|
|
679
|
+
export default ViewFixtureTest;
|
|
680
|
+
class ScopeSvc extends AbstractSkillViewController {
|
|
681
|
+
constructor() {
|
|
682
|
+
super(...arguments);
|
|
683
|
+
this.loadOptions = null;
|
|
684
|
+
}
|
|
685
|
+
load(options) {
|
|
686
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
687
|
+
this.loadOptions = options;
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
render() {
|
|
691
|
+
return {
|
|
692
|
+
layouts: [],
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
class ScopedByOrgSvc extends AbstractSkillViewController {
|
|
697
|
+
constructor() {
|
|
698
|
+
super(...arguments);
|
|
699
|
+
this.getScope = () => ['organization'];
|
|
700
|
+
}
|
|
701
|
+
render() {
|
|
702
|
+
return {
|
|
703
|
+
layouts: [],
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
class ScopedByLocationSvc extends AbstractSkillViewController {
|
|
708
|
+
constructor() {
|
|
709
|
+
super(...arguments);
|
|
710
|
+
this.getScope = () => ['location'];
|
|
711
|
+
}
|
|
712
|
+
render() {
|
|
713
|
+
return {
|
|
714
|
+
layouts: [],
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
class ClientSvc extends AbstractSkillViewController {
|
|
719
|
+
constructor() {
|
|
720
|
+
super(...arguments);
|
|
721
|
+
this.loadOptions = null;
|
|
722
|
+
}
|
|
723
|
+
connect() {
|
|
724
|
+
return this.connectToApi();
|
|
725
|
+
}
|
|
726
|
+
render() {
|
|
727
|
+
return {
|
|
728
|
+
layouts: [],
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
}
|