@sprucelabs/spruce-test-fixtures 45.2.7 → 46.0.0
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/decorators/fake.js +7 -1
- 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/decorators/fake.js +7 -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 +11 -11
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import AbstractSpruceTest, { test, assert } from '@sprucelabs/test';
|
|
17
|
+
import fake from '../../../tests/decorators/fake.js';
|
|
18
|
+
let UsingFakesOnIncompatibleClassTest = class UsingFakesOnIncompatibleClassTest extends AbstractSpruceTest {
|
|
19
|
+
static shouldNotCrash() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
assert.isTrue(true);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
test()
|
|
27
|
+
], UsingFakesOnIncompatibleClassTest, "shouldNotCrash", null);
|
|
28
|
+
UsingFakesOnIncompatibleClassTest = __decorate([
|
|
29
|
+
fake.login()
|
|
30
|
+
], UsingFakesOnIncompatibleClassTest);
|
|
31
|
+
export default UsingFakesOnIncompatibleClassTest;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
export default class WhoAmITest extends AbstractSpruceFixtureTest {
|
|
3
|
+
private static auth;
|
|
4
|
+
private static didLoginCount;
|
|
5
|
+
protected static beforeEach(): Promise<void>;
|
|
6
|
+
protected static afterEach(): Promise<void>;
|
|
7
|
+
protected static afterAll(): Promise<void>;
|
|
8
|
+
protected static canWhoAmI(): Promise<void>;
|
|
9
|
+
protected static canWhoAmI2(): Promise<void>;
|
|
10
|
+
protected static canRegisterProxyToken(): Promise<void>;
|
|
11
|
+
protected static canUseProxyToEmitAsOtherPerson(): Promise<void>;
|
|
12
|
+
protected static canUseProxyAsSecondPerson(): Promise<void>;
|
|
13
|
+
private static loginAsOutsider;
|
|
14
|
+
private static emitWhoAmI;
|
|
15
|
+
private static registerOwnerProxy;
|
|
16
|
+
private static get client();
|
|
17
|
+
protected static resolveTestPath(...pathAfterTestDirsAndFiles: string[]): string;
|
|
18
|
+
private static emitRegister;
|
|
19
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { assert, test } from '@sprucelabs/test';
|
|
17
|
+
import { fake } from '../../../index.js';
|
|
18
|
+
import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
|
|
19
|
+
let WhoAmITest = class WhoAmITest extends AbstractSpruceFixtureTest {
|
|
20
|
+
static beforeEach() {
|
|
21
|
+
const _super = Object.create(null, {
|
|
22
|
+
beforeEach: { get: () => super.beforeEach }
|
|
23
|
+
});
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
yield _super.beforeEach.call(this);
|
|
26
|
+
this.cwd = this.resolveTestPath('skill');
|
|
27
|
+
yield this.emitRegister();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
static afterEach() {
|
|
31
|
+
const _super = Object.create(null, {
|
|
32
|
+
afterEach: { get: () => super.afterEach }
|
|
33
|
+
});
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
yield _super.afterEach.call(this);
|
|
36
|
+
yield this.emitRegister();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
static afterAll() {
|
|
40
|
+
const _super = Object.create(null, {
|
|
41
|
+
afterAll: { get: () => super.afterAll }
|
|
42
|
+
});
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
yield _super.afterAll.call(this);
|
|
45
|
+
yield this.emitRegister();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
static canWhoAmI() {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
this.auth = this.views.getAuthenticator();
|
|
51
|
+
yield fake.getClient().emitAndFlattenResponses('whoami::v2020_12_25');
|
|
52
|
+
this.views.getAuthenticator().addEventListener('did-login', () => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
this.didLoginCount++;
|
|
54
|
+
}));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
static canWhoAmI2() {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
assert.isNotEqual(this.views.getAuthenticator(), this.auth);
|
|
60
|
+
yield fake.getClient().emitAndFlattenResponses('whoami::v2020_12_25');
|
|
61
|
+
assert.isEqual(this.didLoginCount, 0);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
static canRegisterProxyToken() {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const proxy = yield this.registerOwnerProxy();
|
|
67
|
+
assert.isTruthy(proxy);
|
|
68
|
+
const proxy2 = yield this.registerOwnerProxy();
|
|
69
|
+
assert.isNotEqual(proxy, proxy2);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
static canUseProxyToEmitAsOtherPerson() {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const { client } = yield this.loginAsOutsider();
|
|
75
|
+
const proxy = yield this.registerOwnerProxy();
|
|
76
|
+
client.setProxyToken(proxy);
|
|
77
|
+
const auth = yield this.emitWhoAmI(client);
|
|
78
|
+
assert.isEqualDeep(auth.person, this.fakedPerson);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
static canUseProxyAsSecondPerson() {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const { client, person } = yield this.loginAsOutsider();
|
|
84
|
+
const proxy = yield client.registerProxyToken();
|
|
85
|
+
this.client.setProxyToken(proxy);
|
|
86
|
+
const auth = yield this.emitWhoAmI();
|
|
87
|
+
assert.isEqualDeep(auth.person, person);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
static loginAsOutsider() {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const { client, person } = yield this.people.loginAsDemoPerson('555-555-1234');
|
|
93
|
+
return { client, person };
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
static emitWhoAmI(client) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const [{ auth }] = yield (client !== null && client !== void 0 ? client : this.client).emitAndFlattenResponses('whoami::v2020_12_25');
|
|
99
|
+
return auth;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
static registerOwnerProxy() {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
return yield this.client.registerProxyToken();
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
static get client() {
|
|
108
|
+
return fake.getClient();
|
|
109
|
+
}
|
|
110
|
+
static resolveTestPath(...pathAfterTestDirsAndFiles) {
|
|
111
|
+
return this.resolvePath(__dirname, '..', '..', 'testDirsAndFiles', ...pathAfterTestDirsAndFiles);
|
|
112
|
+
}
|
|
113
|
+
static emitRegister() {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
yield fake
|
|
116
|
+
.getClient()
|
|
117
|
+
.emitAndFlattenResponses('register-proxy-token::v2020_12_25');
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
WhoAmITest.didLoginCount = 0;
|
|
122
|
+
__decorate([
|
|
123
|
+
test()
|
|
124
|
+
], WhoAmITest, "canWhoAmI", null);
|
|
125
|
+
__decorate([
|
|
126
|
+
test()
|
|
127
|
+
], WhoAmITest, "canWhoAmI2", null);
|
|
128
|
+
__decorate([
|
|
129
|
+
test()
|
|
130
|
+
], WhoAmITest, "canRegisterProxyToken", null);
|
|
131
|
+
__decorate([
|
|
132
|
+
test()
|
|
133
|
+
], WhoAmITest, "canUseProxyToEmitAsOtherPerson", null);
|
|
134
|
+
__decorate([
|
|
135
|
+
test()
|
|
136
|
+
], WhoAmITest, "canUseProxyAsSecondPerson", null);
|
|
137
|
+
WhoAmITest = __decorate([
|
|
138
|
+
fake.login()
|
|
139
|
+
], WhoAmITest);
|
|
140
|
+
export default WhoAmITest;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
export default class SpyingMapUtilTest extends AbstractSpruceFixtureTest {
|
|
3
|
+
protected static beforeEach(): Promise<void>;
|
|
4
|
+
protected static canCreateSpyingMapUtil(): Promise<void>;
|
|
5
|
+
protected static dropsIntoViewFixture(): Promise<void>;
|
|
6
|
+
protected static dropsSpyIntoVc(): Promise<void>;
|
|
7
|
+
protected static redirectingIsTracked(): Promise<void>;
|
|
8
|
+
protected static resetsLastOpenNavBetweenTests(): Promise<void>;
|
|
9
|
+
private static get maps();
|
|
10
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { CardViewControllerImpl } from '@sprucelabs/heartwood-view-controllers';
|
|
17
|
+
import { test, assert } from '@sprucelabs/test';
|
|
18
|
+
import { generateId } from '@sprucelabs/test-utils';
|
|
19
|
+
import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
|
|
20
|
+
import spyMapUtil from '../../../utilities/SpyMapUtil.js';
|
|
21
|
+
class SpyCard extends CardViewControllerImpl {
|
|
22
|
+
getMaps() {
|
|
23
|
+
return this.maps;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export default class SpyingMapUtilTest extends AbstractSpruceFixtureTest {
|
|
27
|
+
static beforeEach() {
|
|
28
|
+
const _super = Object.create(null, {
|
|
29
|
+
beforeEach: { get: () => super.beforeEach }
|
|
30
|
+
});
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
yield _super.beforeEach.call(this);
|
|
33
|
+
this.views = this.Fixture('view', {
|
|
34
|
+
controllerMap: {
|
|
35
|
+
spy: SpyCard,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
static canCreateSpyingMapUtil() {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
assert.isTruthy(spyMapUtil);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
static dropsIntoViewFixture() {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
assert.isEqual(this.maps, spyMapUtil);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
static dropsSpyIntoVc() {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const vc = this.views.Controller('spy', {});
|
|
53
|
+
assert.isEqual(vc.getMaps(), this.maps);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
static redirectingIsTracked() {
|
|
57
|
+
var _a;
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const address = {
|
|
60
|
+
city: generateId(),
|
|
61
|
+
country: generateId(),
|
|
62
|
+
province: generateId(),
|
|
63
|
+
street1: generateId(),
|
|
64
|
+
street2: generateId(),
|
|
65
|
+
zip: generateId(),
|
|
66
|
+
};
|
|
67
|
+
this.maps.openNavigation({ to: address });
|
|
68
|
+
assert.isEqualDeep((_a = this.maps.lastOpenNavigationOptions) === null || _a === void 0 ? void 0 : _a.to, address);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
static resetsLastOpenNavBetweenTests() {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
assert.isFalsy(this.maps.lastOpenNavigationOptions);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
static get maps() {
|
|
77
|
+
return this.views.getMaps();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
__decorate([
|
|
81
|
+
test()
|
|
82
|
+
], SpyingMapUtilTest, "canCreateSpyingMapUtil", null);
|
|
83
|
+
__decorate([
|
|
84
|
+
test()
|
|
85
|
+
], SpyingMapUtilTest, "dropsIntoViewFixture", null);
|
|
86
|
+
__decorate([
|
|
87
|
+
test()
|
|
88
|
+
], SpyingMapUtilTest, "dropsSpyIntoVc", null);
|
|
89
|
+
__decorate([
|
|
90
|
+
test()
|
|
91
|
+
], SpyingMapUtilTest, "redirectingIsTracked", null);
|
|
92
|
+
__decorate([
|
|
93
|
+
test()
|
|
94
|
+
], SpyingMapUtilTest, "resetsLastOpenNavBetweenTests", null);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
import { DummyStore } from '../DummyStore';
|
|
3
|
+
export default class UsingDecoratorsTest extends AbstractSpruceFixtureTest {
|
|
4
|
+
private static lastClient;
|
|
5
|
+
private static goodStore;
|
|
6
|
+
protected static beforeEach(): Promise<void>;
|
|
7
|
+
protected static afterAll(): Promise<void>;
|
|
8
|
+
protected static loginSetsDefaultClient(): Promise<void>;
|
|
9
|
+
protected static retainsClientBetweenTests(): Promise<void>;
|
|
10
|
+
protected static canSeedThreeOrgs(): Promise<void>;
|
|
11
|
+
protected static canSeedFiveOrgs(): Promise<void>;
|
|
12
|
+
protected static canSeedTwoLocations(): Promise<void>;
|
|
13
|
+
protected static seededLocationsArePublic(): Promise<void>;
|
|
14
|
+
protected static canSeedTenLocations(): Promise<void>;
|
|
15
|
+
protected static locationUsesLatestOrg(): Promise<void>;
|
|
16
|
+
protected static canSeedStores(): Promise<void>;
|
|
17
|
+
protected static logsInViewAuthenticator(): void;
|
|
18
|
+
protected static passesThroughArgs(one: number, two: number, three: number): void;
|
|
19
|
+
protected static passesThroughArgs2(one: any): void;
|
|
20
|
+
protected static seedsAddToBeforeEach(): Promise<void>;
|
|
21
|
+
protected static seedsAddToBeforeEachButNotLastRun(): Promise<void>;
|
|
22
|
+
protected static canGetClientOffLogin(): Promise<void>;
|
|
23
|
+
protected static storeGetsVariablesPassed(): Promise<void>;
|
|
24
|
+
protected static storeGetsVariablesPassed2(): Promise<void>;
|
|
25
|
+
protected static canSeedPeople(baseCounts: Record<string, number>): Promise<void>;
|
|
26
|
+
private static assertExpectedSeededPeople;
|
|
27
|
+
protected static canSeedMorePeople(baseCounts: Record<string, number>): Promise<void>;
|
|
28
|
+
private static assertCountOrgs;
|
|
29
|
+
private static assertCountLocations;
|
|
30
|
+
private static assertCountGoods;
|
|
31
|
+
private static assertTotalPeopleByRole;
|
|
32
|
+
}
|
|
33
|
+
declare module '@sprucelabs/data-stores/build/types/stores.types' {
|
|
34
|
+
interface StoreMap {
|
|
35
|
+
dummies: DummyStore;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,322 @@
|
|
|
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 { AuthenticatorImpl } from '@sprucelabs/heartwood-view-controllers';
|
|
17
|
+
import { MercuryClientFactory } from '@sprucelabs/mercury-client';
|
|
18
|
+
import { test, assert } from '@sprucelabs/test';
|
|
19
|
+
import { MercuryFixture, StoreFixture } from '../../../index.js';
|
|
20
|
+
import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest.js';
|
|
21
|
+
import { DEMO_NUMBER_DECORATORS } from '../../../tests/constants.js';
|
|
22
|
+
import login from '../../../tests/decorators/login.js';
|
|
23
|
+
import seed from '../../../tests/decorators/seed.js';
|
|
24
|
+
// eslint-disable-next-line spruce/prohibit-import-from-build-folder
|
|
25
|
+
import GoodStore from '../../testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js';
|
|
26
|
+
import { DummyStore } from '../DummyStore.js';
|
|
27
|
+
let UsingDecoratorsTest = class UsingDecoratorsTest extends AbstractSpruceFixtureTest {
|
|
28
|
+
static beforeEach() {
|
|
29
|
+
const _super = Object.create(null, {
|
|
30
|
+
beforeEach: { get: () => super.beforeEach }
|
|
31
|
+
});
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
assert.isTrue(MercuryClientFactory.isInTestMode());
|
|
34
|
+
this.goodStore = yield this.Fixture('store').Store('good');
|
|
35
|
+
yield this.assertCountGoods(5);
|
|
36
|
+
yield _super.beforeEach.call(this);
|
|
37
|
+
const auth = AuthenticatorImpl.getInstance();
|
|
38
|
+
assert.isTruthy(auth.getSessionToken());
|
|
39
|
+
const client = login.getClient();
|
|
40
|
+
const person = login.getPerson();
|
|
41
|
+
//@ts-ignore
|
|
42
|
+
assert.isEqualDeep(person, client.auth.person);
|
|
43
|
+
assert.isTruthy(client);
|
|
44
|
+
assert.isTrue(client.isConnected());
|
|
45
|
+
assert.isTrue(client.getIsTestClient());
|
|
46
|
+
this.lastClient = client;
|
|
47
|
+
//@ts-ignore
|
|
48
|
+
assert.isEqualDeep(auth.getPerson(), client.auth.person);
|
|
49
|
+
//@ts-ignore
|
|
50
|
+
assert.isEqualDeep(auth.getSessionToken(), client.auth.token);
|
|
51
|
+
this.goodStore = yield this.Fixture('store').Store('good');
|
|
52
|
+
yield this.assertCountGoods(5);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
static afterAll() {
|
|
56
|
+
const _super = Object.create(null, {
|
|
57
|
+
afterAll: { get: () => super.afterAll }
|
|
58
|
+
});
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
yield _super.afterAll.call(this);
|
|
61
|
+
const client = MercuryFixture.getDefaultClient();
|
|
62
|
+
assert.isFalsy(client);
|
|
63
|
+
assert.isFalse(this.lastClient.isConnected());
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
static loginSetsDefaultClient() {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const client = MercuryFixture.getDefaultClient();
|
|
69
|
+
assert.isTruthy(client);
|
|
70
|
+
assert.isTrue(client.isConnected());
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
static retainsClientBetweenTests() {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const client = MercuryFixture.getDefaultClient();
|
|
76
|
+
assert.isTruthy(client);
|
|
77
|
+
assert.isEqual(this.lastClient, client);
|
|
78
|
+
assert.isTrue(client.isConnected());
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
static canSeedThreeOrgs() {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
yield this.assertCountOrgs(3);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
static canSeedFiveOrgs() {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
yield this.assertCountOrgs(5);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
static canSeedTwoLocations() {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
yield this.assertCountLocations(3);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
static seededLocationsArePublic() {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const locations = yield this.locations.listLocations();
|
|
99
|
+
for (const location of locations) {
|
|
100
|
+
assert.isTrue(location.isPublic);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
static canSeedTenLocations() {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
yield this.assertCountLocations(10);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
static locationUsesLatestOrg() {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
yield this.assertCountLocations(10);
|
|
112
|
+
yield this.assertCountOrgs(10);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
static canSeedStores() {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
assert.isTrue(DummyStore.wasSeedInvoked);
|
|
118
|
+
assert.isEqualDeep(DummyStore.seedOptions, {
|
|
119
|
+
totalToSeed: 10,
|
|
120
|
+
TestClass: this,
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
static logsInViewAuthenticator() {
|
|
125
|
+
assert.isTruthy(AuthenticatorImpl.getInstance().getSessionToken());
|
|
126
|
+
}
|
|
127
|
+
static passesThroughArgs(one, two, three) {
|
|
128
|
+
assert.isEqual(one, 1);
|
|
129
|
+
assert.isEqual(two, 1);
|
|
130
|
+
assert.isEqual(three, 1);
|
|
131
|
+
}
|
|
132
|
+
static passesThroughArgs2(one) {
|
|
133
|
+
assert.isEqualDeep(one, { hello: 'world' });
|
|
134
|
+
}
|
|
135
|
+
static seedsAddToBeforeEach() {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
yield this.assertCountGoods(10);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
static seedsAddToBeforeEachButNotLastRun() {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
yield this.assertCountGoods(6);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
static canGetClientOffLogin() {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
assert.isFunction(login.getClient);
|
|
148
|
+
assert.isEqual(login.getClient(), MercuryFixture.getDefaultClient());
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
static storeGetsVariablesPassed() {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
assert.isEqualDeep(GoodStore.seedParams, ['hello', 'world']);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
static storeGetsVariablesPassed2() {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
assert.isEqualDeep(GoodStore.seedParams, ['goodbye', 'people']);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
static canSeedPeople(baseCounts) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
yield this.assertExpectedSeededPeople(baseCounts);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
static assertExpectedSeededPeople(baseCounts) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
const bases = Object.keys(baseCounts);
|
|
169
|
+
for (const base of bases) {
|
|
170
|
+
const count = baseCounts[base];
|
|
171
|
+
yield this.assertTotalPeopleByRole(base, count);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
static canSeedMorePeople(baseCounts) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
yield this.assertExpectedSeededPeople(baseCounts);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
static assertCountOrgs(expected) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const organizations = yield this.organizations.listOrganizations();
|
|
183
|
+
assert.isLength(organizations, expected);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
static assertCountLocations(expected) {
|
|
187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
const org = yield this.views.getScope().getCurrentOrganization();
|
|
189
|
+
assert.isTruthy(org);
|
|
190
|
+
const organizationId = org.id;
|
|
191
|
+
const locations = yield this.locations.listLocations(organizationId);
|
|
192
|
+
assert.isLength(locations, expected);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
static assertCountGoods(expected) {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
const goodStore = yield this.stores.Store('good');
|
|
198
|
+
const count = yield goodStore.count({});
|
|
199
|
+
assert.isEqual(count, expected);
|
|
200
|
+
const localCount = yield this.goodStore.count({});
|
|
201
|
+
assert.isEqual(localCount, expected, 'The store built in beforeEach is pointing at stale database.');
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
static assertTotalPeopleByRole(roleBase, total) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
const org = yield this.organizations.getNewestOrganization();
|
|
207
|
+
assert.isTruthy(org);
|
|
208
|
+
const teammates = yield this.people.listPeople({
|
|
209
|
+
organizationId: org.id,
|
|
210
|
+
roleBases: [roleBase],
|
|
211
|
+
});
|
|
212
|
+
assert.isLength(teammates, total);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
__decorate([
|
|
217
|
+
seed('good', 5),
|
|
218
|
+
seed('dummies', 10)
|
|
219
|
+
], UsingDecoratorsTest, "beforeEach", null);
|
|
220
|
+
__decorate([
|
|
221
|
+
test()
|
|
222
|
+
], UsingDecoratorsTest, "loginSetsDefaultClient", null);
|
|
223
|
+
__decorate([
|
|
224
|
+
test()
|
|
225
|
+
], UsingDecoratorsTest, "retainsClientBetweenTests", null);
|
|
226
|
+
__decorate([
|
|
227
|
+
test(),
|
|
228
|
+
seed('organizations', 3)
|
|
229
|
+
], UsingDecoratorsTest, "canSeedThreeOrgs", null);
|
|
230
|
+
__decorate([
|
|
231
|
+
test(),
|
|
232
|
+
seed('organizations', 5)
|
|
233
|
+
], UsingDecoratorsTest, "canSeedFiveOrgs", null);
|
|
234
|
+
__decorate([
|
|
235
|
+
test(),
|
|
236
|
+
seed('locations', 3)
|
|
237
|
+
], UsingDecoratorsTest, "canSeedTwoLocations", null);
|
|
238
|
+
__decorate([
|
|
239
|
+
test(),
|
|
240
|
+
seed('locations', 3)
|
|
241
|
+
], UsingDecoratorsTest, "seededLocationsArePublic", null);
|
|
242
|
+
__decorate([
|
|
243
|
+
test(),
|
|
244
|
+
seed('locations', 10)
|
|
245
|
+
], UsingDecoratorsTest, "canSeedTenLocations", null);
|
|
246
|
+
__decorate([
|
|
247
|
+
test(),
|
|
248
|
+
seed('organizations', 10),
|
|
249
|
+
seed('locations', 10)
|
|
250
|
+
], UsingDecoratorsTest, "locationUsesLatestOrg", null);
|
|
251
|
+
__decorate([
|
|
252
|
+
test(),
|
|
253
|
+
seed('dummies', 10)
|
|
254
|
+
], UsingDecoratorsTest, "canSeedStores", null);
|
|
255
|
+
__decorate([
|
|
256
|
+
test()
|
|
257
|
+
], UsingDecoratorsTest, "logsInViewAuthenticator", null);
|
|
258
|
+
__decorate([
|
|
259
|
+
test('passes through args 1', 1, 1, 1),
|
|
260
|
+
seed('dummies', 3)
|
|
261
|
+
], UsingDecoratorsTest, "passesThroughArgs", null);
|
|
262
|
+
__decorate([
|
|
263
|
+
test('passes through args 2', { hello: 'world' }),
|
|
264
|
+
seed('dummies', 3)
|
|
265
|
+
], UsingDecoratorsTest, "passesThroughArgs2", null);
|
|
266
|
+
__decorate([
|
|
267
|
+
test(),
|
|
268
|
+
seed('good', 5)
|
|
269
|
+
], UsingDecoratorsTest, "seedsAddToBeforeEach", null);
|
|
270
|
+
__decorate([
|
|
271
|
+
test(),
|
|
272
|
+
seed('good', 1)
|
|
273
|
+
], UsingDecoratorsTest, "seedsAddToBeforeEachButNotLastRun", null);
|
|
274
|
+
__decorate([
|
|
275
|
+
test()
|
|
276
|
+
], UsingDecoratorsTest, "canGetClientOffLogin", null);
|
|
277
|
+
__decorate([
|
|
278
|
+
test(),
|
|
279
|
+
seed('good', 1, 'hello', 'world')
|
|
280
|
+
], UsingDecoratorsTest, "storeGetsVariablesPassed", null);
|
|
281
|
+
__decorate([
|
|
282
|
+
test(),
|
|
283
|
+
seed('good', 1, 'goodbye', 'people')
|
|
284
|
+
], UsingDecoratorsTest, "storeGetsVariablesPassed2", null);
|
|
285
|
+
__decorate([
|
|
286
|
+
test('can seed people', {
|
|
287
|
+
guest: 2,
|
|
288
|
+
teammate: 2,
|
|
289
|
+
groupManager: 2,
|
|
290
|
+
manager: 2,
|
|
291
|
+
owner: 3,
|
|
292
|
+
}),
|
|
293
|
+
seed('organizations', 1),
|
|
294
|
+
seed('locations', 1),
|
|
295
|
+
seed('teammates', 2),
|
|
296
|
+
seed('guests', 2),
|
|
297
|
+
seed('groupManagers', 2),
|
|
298
|
+
seed('managers', 2),
|
|
299
|
+
seed('owners', 2)
|
|
300
|
+
], UsingDecoratorsTest, "canSeedPeople", null);
|
|
301
|
+
__decorate([
|
|
302
|
+
test('can seed more people', {
|
|
303
|
+
guest: 5,
|
|
304
|
+
teammate: 5,
|
|
305
|
+
groupManager: 3,
|
|
306
|
+
manager: 4,
|
|
307
|
+
owner: 6,
|
|
308
|
+
}),
|
|
309
|
+
seed('organizations', 1),
|
|
310
|
+
seed('locations', 1),
|
|
311
|
+
seed('teammates', 5),
|
|
312
|
+
seed('guests', 5),
|
|
313
|
+
seed('groupManagers', 3),
|
|
314
|
+
seed('managers', 4),
|
|
315
|
+
seed('owners', 5)
|
|
316
|
+
], UsingDecoratorsTest, "canSeedMorePeople", null);
|
|
317
|
+
UsingDecoratorsTest = __decorate([
|
|
318
|
+
login(DEMO_NUMBER_DECORATORS)
|
|
319
|
+
], UsingDecoratorsTest);
|
|
320
|
+
export default UsingDecoratorsTest;
|
|
321
|
+
StoreFixture.setStore('dummies', DummyStore);
|
|
322
|
+
StoreFixture.setStore('good', GoodStore);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
export default class UsingDecoratorsToInstallSkills extends AbstractSpruceFixtureTest {
|
|
3
|
+
private static skill;
|
|
4
|
+
protected static beforeEach(): Promise<void>;
|
|
5
|
+
protected static throwsWhenMissingNamespaces(): void;
|
|
6
|
+
protected static returnsDecorator(): void;
|
|
7
|
+
protected static callsOriginalTestMethod(): Promise<void>;
|
|
8
|
+
protected static passesThroughOriginalArgs(args: any): Promise<void>;
|
|
9
|
+
protected static throwsWithoutSeedingOrg(): Promise<void>;
|
|
10
|
+
protected static throwsWhenInstallingBadSkill(): Promise<void>;
|
|
11
|
+
protected static doesNotEmitDidInstall(): Promise<void>;
|
|
12
|
+
private static executeDecorator;
|
|
13
|
+
private static getDecorator;
|
|
14
|
+
}
|