@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,61 @@
|
|
|
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 { errorAssert } from '@sprucelabs/test-utils';
|
|
18
|
+
import FixtureFactory from '../../tests/fixtures/FixtureFactory.js';
|
|
19
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
|
20
|
+
import OrganizationFixture from '../../tests/fixtures/OrganizationFixture.js';
|
|
21
|
+
import PersonFixture from '../../tests/fixtures/PersonFixture.js';
|
|
22
|
+
import SkillFixture from '../../tests/fixtures/SkillFixture.js';
|
|
23
|
+
export default class FixtureFactoryTest extends AbstractSpruceTest {
|
|
24
|
+
static throwsWithBadFixture() {
|
|
25
|
+
//@ts-ignore
|
|
26
|
+
const err = assert.doesThrow(() => this.Fixture().Fixture('taco'));
|
|
27
|
+
errorAssert.assertError(err, 'INVALID_FIXTURE', {
|
|
28
|
+
suppliedName: 'taco',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
static getsFixture(name, Class) {
|
|
32
|
+
//@ts-ignore
|
|
33
|
+
const fixture = this.Fixture().Fixture(name);
|
|
34
|
+
assert.isTrue(fixture instanceof Class);
|
|
35
|
+
}
|
|
36
|
+
static Fixture() {
|
|
37
|
+
return new FixtureFactory({ cwd: this.cwd });
|
|
38
|
+
}
|
|
39
|
+
static destroyDisconnectsClient() {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const { client } = yield this.Fixture()
|
|
42
|
+
.Fixture('person')
|
|
43
|
+
.loginAsDemoPerson();
|
|
44
|
+
assert.isTrue(client.isConnected());
|
|
45
|
+
yield FixtureFactory.destroy();
|
|
46
|
+
assert.isFalse(client.isConnected());
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
__decorate([
|
|
51
|
+
test()
|
|
52
|
+
], FixtureFactoryTest, "throwsWithBadFixture", null);
|
|
53
|
+
__decorate([
|
|
54
|
+
test('person fixture', 'person', PersonFixture),
|
|
55
|
+
test('mercury fixture', 'mercury', MercuryFixture),
|
|
56
|
+
test('org fixture', 'organization', OrganizationFixture),
|
|
57
|
+
test('skill fixture', 'skill', SkillFixture)
|
|
58
|
+
], FixtureFactoryTest, "getsFixture", null);
|
|
59
|
+
__decorate([
|
|
60
|
+
test()
|
|
61
|
+
], FixtureFactoryTest, "destroyDisconnectsClient", null);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
export default class LocationFixtureTest extends AbstractSpruceFixtureTest {
|
|
3
|
+
protected static beforeEach(): Promise<void>;
|
|
4
|
+
protected static canCreateWithSpecificOrg(): Promise<void>;
|
|
5
|
+
protected static canCreatLocationWithNoParams(): Promise<void>;
|
|
6
|
+
protected static isNotPartOfLocationToStart(): Promise<void>;
|
|
7
|
+
protected static canAddPersonToLocation(): Promise<void>;
|
|
8
|
+
protected static throwsWhenTryingToRemovePersonWithBadIds(): Promise<void>;
|
|
9
|
+
protected static canRemoveRole(): Promise<void>;
|
|
10
|
+
private static isPersonPartOfLocation;
|
|
11
|
+
protected static seedLocationAndAddPerson(): Promise<{
|
|
12
|
+
location: import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/mercury-types").SpruceSchemas.Spruce.v2020_07_22.LocationSchema, false, import("@sprucelabs/schema").SchemaOptionalFieldNames<import("@sprucelabs/mercury-types").SpruceSchemas.Spruce.v2020_07_22.LocationSchema>, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/mercury-types").SpruceSchemas.Spruce.v2020_07_22.LocationSchema, false>>;
|
|
13
|
+
person: import("@sprucelabs/mercury-types").SpruceSchemas.Spruce.v2020_07_22.Person;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
var LocationFixtureTest_1;
|
|
17
|
+
import { test, assert } from '@sprucelabs/test';
|
|
18
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
|
19
|
+
import { DEMO_NUMBER_LOCATION_FIXTURE, DEMO_NUMBER_LOCATION_FIXTURE_OUTSIDER, } from '../../tests/constants.js';
|
|
20
|
+
import fake from '../../tests/decorators/fake.js';
|
|
21
|
+
let LocationFixtureTest = LocationFixtureTest_1 = class LocationFixtureTest extends AbstractSpruceFixtureTest {
|
|
22
|
+
static beforeEach() {
|
|
23
|
+
const _super = Object.create(null, {
|
|
24
|
+
beforeEach: { get: () => super.beforeEach }
|
|
25
|
+
});
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
yield _super.beforeEach.call(this);
|
|
28
|
+
yield this.seeder.resetAccount();
|
|
29
|
+
yield this.seeder.resetAccount(DEMO_NUMBER_LOCATION_FIXTURE_OUTSIDER);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
static canCreateWithSpecificOrg() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const org = yield this.organizations.seedDemoOrganization({
|
|
35
|
+
name: 'Location fixture org',
|
|
36
|
+
});
|
|
37
|
+
const location = yield this.locations.seedDemoLocation({
|
|
38
|
+
name: 'Location fixture location',
|
|
39
|
+
organizationId: org.id,
|
|
40
|
+
});
|
|
41
|
+
assert.isEqual(org.id, location.organizationId);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
static canCreatLocationWithNoParams() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const location = yield this.locations.seedDemoLocation({});
|
|
47
|
+
assert.isTruthy(location);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
static isNotPartOfLocationToStart() {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const location = yield this.locations.seedDemoLocation({
|
|
53
|
+
name: 'Location fixture location',
|
|
54
|
+
});
|
|
55
|
+
const { person } = yield this.people.loginAsDemoPerson(DEMO_NUMBER_LOCATION_FIXTURE_OUTSIDER);
|
|
56
|
+
const isHired = yield this.locations.isPartOfLocation({
|
|
57
|
+
personId: person.id,
|
|
58
|
+
locationId: location.id,
|
|
59
|
+
phone: DEMO_NUMBER_LOCATION_FIXTURE,
|
|
60
|
+
});
|
|
61
|
+
assert.isFalse(isHired);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
static canAddPersonToLocation() {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const { person, location } = yield this.seedLocationAndAddPerson();
|
|
67
|
+
const isHired = yield LocationFixtureTest_1.isPersonPartOfLocation(person.id, location.id);
|
|
68
|
+
assert.isTrue(isHired);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
static throwsWhenTryingToRemovePersonWithBadIds() {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
yield assert.doesThrowAsync(() => this.locations.removePerson({
|
|
74
|
+
phone: DEMO_NUMBER_LOCATION_FIXTURE,
|
|
75
|
+
personId: 'aoeu',
|
|
76
|
+
locationId: 'aoeu',
|
|
77
|
+
roleBase: 'test',
|
|
78
|
+
organizationId: '234',
|
|
79
|
+
}));
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
static canRemoveRole() {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const { person, location } = yield this.seedLocationAndAddPerson();
|
|
85
|
+
yield this.locations.removePerson({
|
|
86
|
+
phone: DEMO_NUMBER_LOCATION_FIXTURE,
|
|
87
|
+
personId: person.id,
|
|
88
|
+
locationId: location.id,
|
|
89
|
+
organizationId: location.organizationId,
|
|
90
|
+
roleBase: 'guest',
|
|
91
|
+
});
|
|
92
|
+
const isHired = yield this.isPersonPartOfLocation(person.id, location.id);
|
|
93
|
+
assert.isFalse(isHired);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
static isPersonPartOfLocation(personId, locationId) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
return yield this.locations.isPartOfLocation({
|
|
99
|
+
phone: DEMO_NUMBER_LOCATION_FIXTURE,
|
|
100
|
+
personId,
|
|
101
|
+
locationId,
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
static seedLocationAndAddPerson() {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
const org = yield this.organizations.seedDemoOrganization({
|
|
108
|
+
name: 'Location fixture org',
|
|
109
|
+
phone: DEMO_NUMBER_LOCATION_FIXTURE,
|
|
110
|
+
});
|
|
111
|
+
yield this.organizations.seedDemoOrganization({
|
|
112
|
+
name: 'Outside org',
|
|
113
|
+
phone: DEMO_NUMBER_LOCATION_FIXTURE_OUTSIDER,
|
|
114
|
+
});
|
|
115
|
+
const location = yield this.locations.seedDemoLocation({
|
|
116
|
+
name: 'Location fixture location',
|
|
117
|
+
phone: DEMO_NUMBER_LOCATION_FIXTURE,
|
|
118
|
+
organizationId: org.id,
|
|
119
|
+
});
|
|
120
|
+
const { person } = yield this.people.loginAsDemoPerson(DEMO_NUMBER_LOCATION_FIXTURE_OUTSIDER);
|
|
121
|
+
yield this.locations.addPerson({
|
|
122
|
+
personId: person.id,
|
|
123
|
+
organizationId: org.id,
|
|
124
|
+
locationId: location.id,
|
|
125
|
+
roleBase: 'guest',
|
|
126
|
+
phone: DEMO_NUMBER_LOCATION_FIXTURE,
|
|
127
|
+
});
|
|
128
|
+
return { location, person };
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
__decorate([
|
|
133
|
+
test()
|
|
134
|
+
], LocationFixtureTest, "canCreateWithSpecificOrg", null);
|
|
135
|
+
__decorate([
|
|
136
|
+
test()
|
|
137
|
+
], LocationFixtureTest, "canCreatLocationWithNoParams", null);
|
|
138
|
+
__decorate([
|
|
139
|
+
test()
|
|
140
|
+
], LocationFixtureTest, "isNotPartOfLocationToStart", null);
|
|
141
|
+
__decorate([
|
|
142
|
+
test()
|
|
143
|
+
], LocationFixtureTest, "canAddPersonToLocation", null);
|
|
144
|
+
__decorate([
|
|
145
|
+
test()
|
|
146
|
+
], LocationFixtureTest, "throwsWhenTryingToRemovePersonWithBadIds", null);
|
|
147
|
+
__decorate([
|
|
148
|
+
test()
|
|
149
|
+
], LocationFixtureTest, "canRemoveRole", null);
|
|
150
|
+
LocationFixtureTest = LocationFixtureTest_1 = __decorate([
|
|
151
|
+
fake.login(DEMO_NUMBER_LOCATION_FIXTURE)
|
|
152
|
+
], LocationFixtureTest);
|
|
153
|
+
export default LocationFixtureTest;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbstractSpruceFixtureTest } from '../..';
|
|
2
|
+
export default class LoginDecoratorHandlingProxiesForMeTest extends AbstractSpruceFixtureTest {
|
|
3
|
+
private static lastToken?;
|
|
4
|
+
protected static proxyTokenGeneratorReturnsExpectedProxyToken(expected: string): Promise<void>;
|
|
5
|
+
protected static onlyEmitsEventOnce(): Promise<void>;
|
|
6
|
+
protected static tokenSetBackAfterEachTest(): Promise<void>;
|
|
7
|
+
protected static tokenBackToOriginLoggedInPerson(): Promise<void>;
|
|
8
|
+
protected static loggingAnAsDemoPerson2AgainSetsValidProxy(): Promise<void>;
|
|
9
|
+
private static getDecorator;
|
|
10
|
+
private static generateToken;
|
|
11
|
+
private static loginAsSecondPerson;
|
|
12
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
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 { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
|
|
17
|
+
import { test, assert } from '@sprucelabs/test';
|
|
18
|
+
import { AbstractSpruceFixtureTest, login } from '../../index.js';
|
|
19
|
+
import ClientProxyDecorator from '../../ClientProxyDecorator.js';
|
|
20
|
+
import { DEMO_NUMBER_LOGIN_DECORATOR, DEMO_NUMBER_LOGIN_DECORATOR_2, } from '../../tests/constants.js';
|
|
21
|
+
let LoginDecoratorHandlingProxiesForMeTest = class LoginDecoratorHandlingProxiesForMeTest extends AbstractSpruceFixtureTest {
|
|
22
|
+
static proxyTokenGeneratorReturnsExpectedProxyToken(expected) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
yield login.getClient().on('register-proxy-token::v2020_12_25', () => {
|
|
25
|
+
return {
|
|
26
|
+
token: expected,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
const token = yield this.generateToken();
|
|
30
|
+
assert.isEqual(token, expected);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
static onlyEmitsEventOnce() {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
let hitCount = 0;
|
|
36
|
+
yield login.getClient().on('register-proxy-token::v2020_12_25', () => {
|
|
37
|
+
hitCount++;
|
|
38
|
+
return {
|
|
39
|
+
token: 'aoeu',
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
const generator = this.getDecorator().getProxyTokenGenerator();
|
|
43
|
+
yield (generator === null || generator === void 0 ? void 0 : generator());
|
|
44
|
+
assert.isEqual(hitCount, 0);
|
|
45
|
+
yield (generator === null || generator === void 0 ? void 0 : generator());
|
|
46
|
+
yield (generator === null || generator === void 0 ? void 0 : generator());
|
|
47
|
+
assert.isEqual(hitCount, 0);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
static tokenSetBackAfterEachTest() {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
this.lastToken = yield this.generateToken();
|
|
53
|
+
yield this.loginAsSecondPerson();
|
|
54
|
+
const newToken = yield this.generateToken();
|
|
55
|
+
assert.isNotEqual(this.lastToken, newToken);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
static tokenBackToOriginLoggedInPerson() {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const token = yield this.generateToken();
|
|
61
|
+
assert.isEqual(this.lastToken, token);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
static loggingAnAsDemoPerson2AgainSetsValidProxy() {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const { client } = yield this.loginAsSecondPerson();
|
|
67
|
+
const token = yield this.generateToken();
|
|
68
|
+
const results = yield client.emit('whoami::v2020_12_25', {
|
|
69
|
+
source: {
|
|
70
|
+
proxyToken: token,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
eventResponseUtil.getFirstResponseOrThrow(results);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
static getDecorator() {
|
|
77
|
+
return ClientProxyDecorator.getInstance();
|
|
78
|
+
}
|
|
79
|
+
static generateToken() {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const generator = this.getDecorator().getProxyTokenGenerator();
|
|
82
|
+
const token = yield (generator === null || generator === void 0 ? void 0 : generator());
|
|
83
|
+
return token;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
static loginAsSecondPerson() {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
return this.Fixture('view').loginAsDemoPerson(DEMO_NUMBER_LOGIN_DECORATOR_2);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
__decorate([
|
|
93
|
+
test('proxy set to random', `${Math.random() * new Date().getTime()}`)
|
|
94
|
+
], LoginDecoratorHandlingProxiesForMeTest, "proxyTokenGeneratorReturnsExpectedProxyToken", null);
|
|
95
|
+
__decorate([
|
|
96
|
+
test()
|
|
97
|
+
], LoginDecoratorHandlingProxiesForMeTest, "onlyEmitsEventOnce", null);
|
|
98
|
+
__decorate([
|
|
99
|
+
test()
|
|
100
|
+
], LoginDecoratorHandlingProxiesForMeTest, "tokenSetBackAfterEachTest", null);
|
|
101
|
+
__decorate([
|
|
102
|
+
test()
|
|
103
|
+
], LoginDecoratorHandlingProxiesForMeTest, "tokenBackToOriginLoggedInPerson", null);
|
|
104
|
+
__decorate([
|
|
105
|
+
test()
|
|
106
|
+
], LoginDecoratorHandlingProxiesForMeTest, "loggingAnAsDemoPerson2AgainSetsValidProxy", null);
|
|
107
|
+
LoginDecoratorHandlingProxiesForMeTest = __decorate([
|
|
108
|
+
login(DEMO_NUMBER_LOGIN_DECORATOR)
|
|
109
|
+
], LoginDecoratorHandlingProxiesForMeTest);
|
|
110
|
+
export default LoginDecoratorHandlingProxiesForMeTest;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { MercuryTestClient } from '@sprucelabs/mercury-client';
|
|
17
|
+
import { AuthService } from '@sprucelabs/spruce-skill-utils';
|
|
18
|
+
import { assert, test } from '@sprucelabs/test';
|
|
19
|
+
import { AbstractSpruceFixtureTest, login, MercuryFixture } from '../../index.js';
|
|
20
|
+
import { DEMO_NUMBER_HANDLING_EVENTS_LOCALLY } from '../../tests/constants.js';
|
|
21
|
+
let MakingSureLocalEventsAreHandledLocallyTest = class MakingSureLocalEventsAreHandledLocallyTest extends AbstractSpruceFixtureTest {
|
|
22
|
+
static throwsWhenNoListenerSetForLocalEvent() {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
yield this.SkillFromTestDir('skill');
|
|
25
|
+
const skill = yield this.Fixture('skill').seedDemoSkill();
|
|
26
|
+
AuthService.Auth(this.cwd).updateCurrentSkill(skill);
|
|
27
|
+
yield MercuryFixture.beforeEach(this.cwd);
|
|
28
|
+
assert.isEqualDeep(MercuryTestClient.getNamespacesThatMustBeHandledLocally(), [skill.slug]);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
__decorate([
|
|
33
|
+
test()
|
|
34
|
+
], MakingSureLocalEventsAreHandledLocallyTest, "throwsWhenNoListenerSetForLocalEvent", null);
|
|
35
|
+
MakingSureLocalEventsAreHandledLocallyTest = __decorate([
|
|
36
|
+
login(DEMO_NUMBER_HANDLING_EVENTS_LOCALLY)
|
|
37
|
+
], MakingSureLocalEventsAreHandledLocallyTest);
|
|
38
|
+
export default MakingSureLocalEventsAreHandledLocallyTest;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
export default class MercuryFixtureTest extends AbstractSpruceFixtureTest {
|
|
3
|
+
private static fixture;
|
|
4
|
+
protected static beforeEach(): Promise<void>;
|
|
5
|
+
protected static hasDefaultContractByDefault(): Promise<void>;
|
|
6
|
+
protected static canGetMoreThanOneClient(): Promise<void>;
|
|
7
|
+
protected static canCreateMercuryFixture(): Promise<void>;
|
|
8
|
+
protected static returnsConnectedClient(): Promise<void>;
|
|
9
|
+
protected static returnsSameClientOnSecondConnect(): Promise<void>;
|
|
10
|
+
protected static importsContractIfLocalOneIsGenerated(sigs: any[]): Promise<void>;
|
|
11
|
+
protected static beforeEachResetsBackToSavedContract(): Promise<void>;
|
|
12
|
+
protected static typesTestProperly(): Promise<void>;
|
|
13
|
+
protected static canSetDefaultClient(): Promise<void>;
|
|
14
|
+
protected static allClientsGoingForwardUseThatClient(): Promise<void>;
|
|
15
|
+
protected static resetsDefaultClientBeforeEach(): Promise<void>;
|
|
16
|
+
protected static canForceNewClient(): Promise<void>;
|
|
17
|
+
private static connectToApi;
|
|
18
|
+
private static createDirWriteContractFileAndSetCwd;
|
|
19
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
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 { coreEventContracts } from '@sprucelabs/mercury-core-events';
|
|
17
|
+
import { eventContractUtil } from '@sprucelabs/spruce-event-utils';
|
|
18
|
+
import { diskUtil, HASH_SPRUCE_BUILD_DIR } from '@sprucelabs/spruce-skill-utils';
|
|
19
|
+
import { test, assert } from '@sprucelabs/test';
|
|
20
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
|
21
|
+
import FixtureFactory from '../../tests/fixtures/FixtureFactory.js';
|
|
22
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
|
23
|
+
export default class MercuryFixtureTest extends AbstractSpruceFixtureTest {
|
|
24
|
+
static beforeEach() {
|
|
25
|
+
const _super = Object.create(null, {
|
|
26
|
+
beforeEach: { get: () => super.beforeEach }
|
|
27
|
+
});
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
yield _super.beforeEach.call(this);
|
|
30
|
+
this.fixture = this.Fixture('mercury');
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
static hasDefaultContractByDefault() {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const client = yield this.fixture.connectToApi();
|
|
36
|
+
//@ts-ignore
|
|
37
|
+
assert.isTruthy(client.eventContract);
|
|
38
|
+
//@ts-ignore
|
|
39
|
+
assert.isEqual(client.eventContract, coreEventContracts[0]);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
static canGetMoreThanOneClient() {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
yield this.fixture.connectToApi({ shouldReUseClient: false });
|
|
45
|
+
yield this.fixture.connectToApi({ shouldReUseClient: false });
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
static canCreateMercuryFixture() {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
assert.isTruthy(this.fixture);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
static returnsConnectedClient() {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const client = yield this.fixture.connectToApi();
|
|
56
|
+
assert.isTrue(client.isConnected());
|
|
57
|
+
yield client.disconnect();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
static returnsSameClientOnSecondConnect() {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const client = yield this.fixture.connectToApi();
|
|
63
|
+
//@ts-ignore
|
|
64
|
+
client.__monkeyPatch = true;
|
|
65
|
+
const client2 = yield this.fixture.connectToApi();
|
|
66
|
+
//@ts-ignore
|
|
67
|
+
assert.isTrue(client2.__monkeyPatch);
|
|
68
|
+
yield client.disconnect();
|
|
69
|
+
assert.isFalse(client2.isConnected());
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
static importsContractIfLocalOneIsGenerated(sigs) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
this.createDirWriteContractFileAndSetCwd(sigs);
|
|
75
|
+
const client = yield this.connectToApi();
|
|
76
|
+
//@ts-ignore
|
|
77
|
+
assert.isTruthy(client.eventContract);
|
|
78
|
+
assert.doesInclude(
|
|
79
|
+
//@ts-ignore
|
|
80
|
+
client.eventContract.eventSignatures, sigs[0].eventSignatures);
|
|
81
|
+
eventContractUtil.getSignatureByName(
|
|
82
|
+
//@ts-ignore
|
|
83
|
+
client.eventContract, 'add-role::v2020_12_25');
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
static beforeEachResetsBackToSavedContract() {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
this.createDirWriteContractFileAndSetCwd([
|
|
89
|
+
{
|
|
90
|
+
eventSignatures: {
|
|
91
|
+
['new-event']: true,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
]);
|
|
95
|
+
const client = (yield this.connectToApi());
|
|
96
|
+
yield MercuryFixture.beforeEach(this.cwd);
|
|
97
|
+
yield client.on('new-event', () => { });
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
static typesTestProperly() {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
const test = () => {
|
|
103
|
+
return {};
|
|
104
|
+
};
|
|
105
|
+
const value = test();
|
|
106
|
+
assert.isTruthy(value);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
static canSetDefaultClient() {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
assert.isFunction(MercuryFixture.setDefaultClient);
|
|
112
|
+
const client = yield this.connectToApi();
|
|
113
|
+
MercuryFixture.setDefaultClient(client);
|
|
114
|
+
assert.isEqual(MercuryFixture.getDefaultClient(), client);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
static allClientsGoingForwardUseThatClient() {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const client = yield this.connectToApi();
|
|
120
|
+
MercuryFixture.setDefaultClient(client);
|
|
121
|
+
const client2 = yield this.connectToApi();
|
|
122
|
+
assert.isEqual(client, client2);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
static resetsDefaultClientBeforeEach() {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
const client = yield this.connectToApi();
|
|
128
|
+
MercuryFixture.setDefaultClient(client);
|
|
129
|
+
yield MercuryFixture.beforeEach(this.cwd);
|
|
130
|
+
const client2 = yield this.connectToApi();
|
|
131
|
+
assert.isNotEqual(client, client2);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
static canForceNewClient() {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
const client = yield this.connectToApi();
|
|
137
|
+
MercuryFixture.setDefaultClient(client);
|
|
138
|
+
const client2 = yield this.Fixture('mercury').connectToApi({
|
|
139
|
+
shouldReUseClient: false,
|
|
140
|
+
});
|
|
141
|
+
assert.isNotEqual(client, client2);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
static connectToApi(options) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
return yield new FixtureFactory({ cwd: this.cwd })
|
|
147
|
+
.Fixture('mercury')
|
|
148
|
+
.connectToApi(options);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
static createDirWriteContractFileAndSetCwd(sigs) {
|
|
152
|
+
this.cwd = diskUtil.createRandomTempDir();
|
|
153
|
+
const destination = diskUtil.resolvePath(this.cwd, HASH_SPRUCE_BUILD_DIR, 'events/events.contract.js');
|
|
154
|
+
const contents = `exports["default"] = ${JSON.stringify([
|
|
155
|
+
...coreEventContracts,
|
|
156
|
+
...sigs,
|
|
157
|
+
])};`;
|
|
158
|
+
diskUtil.writeFile(destination, contents);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
__decorate([
|
|
162
|
+
test()
|
|
163
|
+
], MercuryFixtureTest, "hasDefaultContractByDefault", null);
|
|
164
|
+
__decorate([
|
|
165
|
+
test()
|
|
166
|
+
], MercuryFixtureTest, "canGetMoreThanOneClient", null);
|
|
167
|
+
__decorate([
|
|
168
|
+
test()
|
|
169
|
+
], MercuryFixtureTest, "canCreateMercuryFixture", null);
|
|
170
|
+
__decorate([
|
|
171
|
+
test()
|
|
172
|
+
], MercuryFixtureTest, "returnsConnectedClient", null);
|
|
173
|
+
__decorate([
|
|
174
|
+
test()
|
|
175
|
+
], MercuryFixtureTest, "returnsSameClientOnSecondConnect", null);
|
|
176
|
+
__decorate([
|
|
177
|
+
test('auto imports signature 1', [
|
|
178
|
+
{
|
|
179
|
+
eventSignatures: {
|
|
180
|
+
['taco-bravo']: true,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
]),
|
|
184
|
+
test('auto imports signature 2', [
|
|
185
|
+
{
|
|
186
|
+
eventSignatures: {
|
|
187
|
+
['taco-bravo2']: true,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
])
|
|
191
|
+
], MercuryFixtureTest, "importsContractIfLocalOneIsGenerated", null);
|
|
192
|
+
__decorate([
|
|
193
|
+
test()
|
|
194
|
+
], MercuryFixtureTest, "beforeEachResetsBackToSavedContract", null);
|
|
195
|
+
__decorate([
|
|
196
|
+
test()
|
|
197
|
+
], MercuryFixtureTest, "typesTestProperly", null);
|
|
198
|
+
__decorate([
|
|
199
|
+
test()
|
|
200
|
+
], MercuryFixtureTest, "canSetDefaultClient", null);
|
|
201
|
+
__decorate([
|
|
202
|
+
test()
|
|
203
|
+
], MercuryFixtureTest, "allClientsGoingForwardUseThatClient", null);
|
|
204
|
+
__decorate([
|
|
205
|
+
test()
|
|
206
|
+
], MercuryFixtureTest, "resetsDefaultClientBeforeEach", null);
|
|
207
|
+
__decorate([
|
|
208
|
+
test()
|
|
209
|
+
], MercuryFixtureTest, "canForceNewClient", null);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
import { RoleBase } from '../../types/fixture.types';
|
|
3
|
+
export default class OrganizationFixtureTest extends AbstractSpruceFixtureTest {
|
|
4
|
+
protected static canCreateOrganizationFixture(): Promise<void>;
|
|
5
|
+
protected static canSeedOrg(): Promise<void>;
|
|
6
|
+
protected static orgFixtureDestroysOrgs(): Promise<void>;
|
|
7
|
+
protected static isNotPartOfOrgtoStart(): Promise<void>;
|
|
8
|
+
protected static updatingBadOrgTHrows(): Promise<void>;
|
|
9
|
+
protected static canUpdateOrg(): Promise<void>;
|
|
10
|
+
protected static canUpdateOrgAddress(): Promise<void>;
|
|
11
|
+
protected static canMakeOrgPublicAndPrivate(): Promise<void>;
|
|
12
|
+
protected static canAddPersonToOrg(base: RoleBase): Promise<void>;
|
|
13
|
+
private static isPersonPartOfOrg;
|
|
14
|
+
protected static isNotInstalledByDefault(): Promise<void>;
|
|
15
|
+
protected static showsAsInstalled(): Promise<void>;
|
|
16
|
+
protected static cantInstallWithBadSkill(): Promise<void>;
|
|
17
|
+
protected static canInstallWithSlug(): Promise<void>;
|
|
18
|
+
protected static canInstallSkillFromAnotherPerson(): Promise<void>;
|
|
19
|
+
protected static canDeleteAllExistingOrgs(): Promise<void>;
|
|
20
|
+
protected static passesThroughAllFieldsToRequest(): Promise<void>;
|
|
21
|
+
protected static canPassPersonFixture(): void;
|
|
22
|
+
protected static canSeedOrgWithNoOptions(): Promise<void>;
|
|
23
|
+
protected static removePersonThrowsWithBadIds(): Promise<void>;
|
|
24
|
+
protected static canRemovePersonFromOrg(roleBase: RoleBase): Promise<void>;
|
|
25
|
+
private static Org;
|
|
26
|
+
private static seedOrgAndHirePerson;
|
|
27
|
+
private static assertSkillIsInstalled;
|
|
28
|
+
private static seedOrgAndSkill;
|
|
29
|
+
private static assertOrgIsPublicValue;
|
|
30
|
+
private static setAndAssertOrgIsPublic;
|
|
31
|
+
}
|