@sprucelabs/spruce-test-fixtures 45.2.9 → 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/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 +5 -5
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ResettingLocalEventListeningBeforeSeedingTest = void 0;
|
|
10
|
+
const test_1 = require("@sprucelabs/test");
|
|
11
|
+
const __1 = require("../..");
|
|
12
|
+
const constants_1 = require("../../tests/constants");
|
|
13
|
+
let ResettingLocalEventListeningBeforeSeedingTest = class ResettingLocalEventListeningBeforeSeedingTest extends __1.AbstractSpruceFixtureTest {
|
|
14
|
+
static async beforeEach() {
|
|
15
|
+
await super.beforeEach();
|
|
16
|
+
}
|
|
17
|
+
static async testClientIsResetBeforeSeeding() {
|
|
18
|
+
await __1.login.getClient().on('create-organization::v2020_12_25', () => {
|
|
19
|
+
this.hitCount++;
|
|
20
|
+
return {
|
|
21
|
+
organization: {},
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
static async hitCountShouldBeZero() {
|
|
26
|
+
test_1.assert.isEqual(this.hitCount, 0);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
ResettingLocalEventListeningBeforeSeedingTest.hitCount = 0;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, __1.seed)('organizations', 1)
|
|
32
|
+
], ResettingLocalEventListeningBeforeSeedingTest, "beforeEach", null);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, test_1.test)()
|
|
35
|
+
], ResettingLocalEventListeningBeforeSeedingTest, "testClientIsResetBeforeSeeding", null);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, test_1.test)()
|
|
38
|
+
], ResettingLocalEventListeningBeforeSeedingTest, "hitCountShouldBeZero", null);
|
|
39
|
+
ResettingLocalEventListeningBeforeSeedingTest = __decorate([
|
|
40
|
+
(0, __1.login)(constants_1.DEMO_NUMBER_TEST_CLIENT_RECENT)
|
|
41
|
+
], ResettingLocalEventListeningBeforeSeedingTest);
|
|
42
|
+
exports.ResettingLocalEventListeningBeforeSeedingTest = ResettingLocalEventListeningBeforeSeedingTest;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
export default class RetainsContractWhenLoggingInUsingDecorator extends AbstractSpruceFixtureTest {
|
|
3
|
+
private static client;
|
|
4
|
+
protected static beforeEach(): Promise<void>;
|
|
5
|
+
protected static clientStillHasContract(): Promise<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const test_1 = require("@sprucelabs/test");
|
|
13
|
+
const __1 = require("../..");
|
|
14
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
|
15
|
+
const constants_1 = require("../../tests/constants");
|
|
16
|
+
// eslint-disable-next-line spruce/prohibit-import-from-build-folder
|
|
17
|
+
const Good_store_1 = __importDefault(require("../testDirsAndFiles/one-good-store-skill/build/stores/Good.store"));
|
|
18
|
+
let RetainsContractWhenLoggingInUsingDecorator = class RetainsContractWhenLoggingInUsingDecorator extends AbstractSpruceFixtureTest_1.default {
|
|
19
|
+
static async beforeEach() {
|
|
20
|
+
await super.beforeEach();
|
|
21
|
+
this.client = __1.login.getClient();
|
|
22
|
+
}
|
|
23
|
+
static async clientStillHasContract() {
|
|
24
|
+
await this.client.on('whoami::v2020_12_25', () => ({
|
|
25
|
+
auth: {},
|
|
26
|
+
type: 'authenticated',
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, test_1.test)()
|
|
32
|
+
], RetainsContractWhenLoggingInUsingDecorator, "clientStillHasContract", null);
|
|
33
|
+
RetainsContractWhenLoggingInUsingDecorator = __decorate([
|
|
34
|
+
(0, __1.login)(constants_1.DEMO_NUMBER_ACCOUNT_RESET)
|
|
35
|
+
], RetainsContractWhenLoggingInUsingDecorator);
|
|
36
|
+
exports.default = RetainsContractWhenLoggingInUsingDecorator;
|
|
37
|
+
__1.StoreFixture.setStore('good', Good_store_1.default);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
export default class RoleFixtureTest extends AbstractSpruceFixtureTest {
|
|
3
|
+
private static fixture;
|
|
4
|
+
private static client;
|
|
5
|
+
protected static beforeEach(): Promise<void>;
|
|
6
|
+
protected static hasRoleFixture(): void;
|
|
7
|
+
protected static cantListRolesWithoutOrg(): Promise<void>;
|
|
8
|
+
protected static listsValidRoles(): Promise<void>;
|
|
9
|
+
protected static listsWorkingRolesByDefault(): Promise<void>;
|
|
10
|
+
protected static listMetaRolesWithOptions(): Promise<void>;
|
|
11
|
+
protected static canPassOwnOrg(): Promise<void>;
|
|
12
|
+
private static getNewestOrg;
|
|
13
|
+
private static assertListedRolesMatchExpected;
|
|
14
|
+
private static listRoles;
|
|
15
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
|
13
|
+
const test_1 = require("@sprucelabs/test");
|
|
14
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
15
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
|
16
|
+
const constants_1 = require("../../tests/constants");
|
|
17
|
+
const fake_1 = __importDefault(require("../../tests/decorators/fake"));
|
|
18
|
+
const seed_1 = __importDefault(require("../../tests/decorators/seed"));
|
|
19
|
+
let RoleFixtureTest = class RoleFixtureTest extends AbstractSpruceFixtureTest_1.default {
|
|
20
|
+
static async beforeEach() {
|
|
21
|
+
await super.beforeEach();
|
|
22
|
+
this.fixture = this.Fixture('role');
|
|
23
|
+
this.client = fake_1.default.getClient();
|
|
24
|
+
}
|
|
25
|
+
static hasRoleFixture() {
|
|
26
|
+
test_1.assert.isTruthy(this.fixture);
|
|
27
|
+
}
|
|
28
|
+
static async cantListRolesWithoutOrg() {
|
|
29
|
+
const err = await test_1.assert.doesThrowAsync(() => this.fixture.listRoles());
|
|
30
|
+
test_utils_1.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
31
|
+
parameters: ['organizationId'],
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
static async listsValidRoles() {
|
|
35
|
+
const roles = await this.fixture.listRoles();
|
|
36
|
+
test_1.assert.isArray(roles);
|
|
37
|
+
test_1.assert.isAbove(roles.length, 0);
|
|
38
|
+
for (const role of roles) {
|
|
39
|
+
const results = await this.client.emit('get-role::v2020_12_25', {
|
|
40
|
+
target: {
|
|
41
|
+
roleId: role.id,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
static async listsWorkingRolesByDefault() {
|
|
48
|
+
const allRoles = await this.listRoles();
|
|
49
|
+
const expectedRoles = allRoles.filter((role) => role.base !== 'anonymous' && role.base !== 'loggedIn');
|
|
50
|
+
await this.assertListedRolesMatchExpected(expectedRoles);
|
|
51
|
+
}
|
|
52
|
+
static async listMetaRolesWithOptions() {
|
|
53
|
+
const allRoles = await this.listRoles();
|
|
54
|
+
await this.assertListedRolesMatchExpected(allRoles, {
|
|
55
|
+
shouldIncludeMetaRoles: true,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
static async canPassOwnOrg() {
|
|
59
|
+
const orgs = await this.organizations.listOrganizations();
|
|
60
|
+
const org = orgs[2];
|
|
61
|
+
const roles = await this.fixture.listRoles({ organizationId: org.id });
|
|
62
|
+
test_1.assert.isEqual(roles[0].organizationId, org.id);
|
|
63
|
+
}
|
|
64
|
+
static async getNewestOrg() {
|
|
65
|
+
const org = await this.organizations.getNewestOrganization();
|
|
66
|
+
test_1.assert.isTruthy(org, `You gotta @seed('organizations',1) to continue.`);
|
|
67
|
+
return org;
|
|
68
|
+
}
|
|
69
|
+
static async assertListedRolesMatchExpected(expectedRoles, options) {
|
|
70
|
+
const roles = await this.fixture.listRoles(options);
|
|
71
|
+
function sort(a, b) {
|
|
72
|
+
return a.name > b.name ? 1 : -1;
|
|
73
|
+
}
|
|
74
|
+
roles.sort(sort);
|
|
75
|
+
expectedRoles.sort(sort);
|
|
76
|
+
test_1.assert.isEqualDeep(roles, expectedRoles);
|
|
77
|
+
}
|
|
78
|
+
static async listRoles() {
|
|
79
|
+
const org = await this.getNewestOrg();
|
|
80
|
+
const roleResults = await this.client.emit('list-roles::v2020_12_25', {
|
|
81
|
+
target: {
|
|
82
|
+
organizationId: org.id,
|
|
83
|
+
},
|
|
84
|
+
payload: {
|
|
85
|
+
shouldIncludePrivateRoles: true,
|
|
86
|
+
shouldIncludeMetaRoles: true,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
const { roles: allRoles } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(roleResults);
|
|
90
|
+
return allRoles;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, test_1.test)()
|
|
95
|
+
], RoleFixtureTest, "hasRoleFixture", null);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, test_1.test)()
|
|
98
|
+
], RoleFixtureTest, "cantListRolesWithoutOrg", null);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, test_1.test)(),
|
|
101
|
+
(0, seed_1.default)('organizations', 1)
|
|
102
|
+
], RoleFixtureTest, "listsValidRoles", null);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, test_1.test)(),
|
|
105
|
+
(0, seed_1.default)('organizations', 1)
|
|
106
|
+
], RoleFixtureTest, "listsWorkingRolesByDefault", null);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, test_1.test)(),
|
|
109
|
+
(0, seed_1.default)('organizations', 1)
|
|
110
|
+
], RoleFixtureTest, "listMetaRolesWithOptions", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, test_1.test)(),
|
|
113
|
+
(0, seed_1.default)('organizations', 3)
|
|
114
|
+
], RoleFixtureTest, "canPassOwnOrg", null);
|
|
115
|
+
RoleFixtureTest = __decorate([
|
|
116
|
+
fake_1.default.login(constants_1.DEMO_NUMBER_ROLE_FIXTURE)
|
|
117
|
+
], RoleFixtureTest);
|
|
118
|
+
exports.default = RoleFixtureTest;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
export default class SeedingDataTest extends AbstractSpruceFixtureTest {
|
|
3
|
+
private static fixture;
|
|
4
|
+
private static client;
|
|
5
|
+
protected static beforeEach(): Promise<void>;
|
|
6
|
+
protected static hasSeedFixture(): void;
|
|
7
|
+
protected static canSeedManyOrgs(): Promise<void>;
|
|
8
|
+
protected static actuallyCreatesOrgs(): Promise<void>;
|
|
9
|
+
protected static canSeedLocations(): Promise<void>;
|
|
10
|
+
protected static seedingOrgsCreatesOrganization(): Promise<void>;
|
|
11
|
+
protected static canPassOrgToLocationSeeder(): Promise<void>;
|
|
12
|
+
protected static throwsWhenSeedingWithoutCount(): Promise<void>;
|
|
13
|
+
protected static actuallyCreatesLocations(): Promise<void>;
|
|
14
|
+
protected static needsStartingPhoneWhenSeedingPeople(options: any): Promise<void>;
|
|
15
|
+
protected static returnsSeededGuests(options: any, expectedCount: number, base: string): Promise<void>;
|
|
16
|
+
protected static setsFirstPersonsNumberToTheStartingPhone(phone: string): Promise<void>;
|
|
17
|
+
protected static canSeedMultipleRolesAtOnce(): Promise<void>;
|
|
18
|
+
protected static seededPeopleHaveNames(): Promise<void>;
|
|
19
|
+
protected static peopleAllHaveUniqueNames(): Promise<void>;
|
|
20
|
+
protected static namesAreOnlyAssignedIfNotYetAssigned(): Promise<void>;
|
|
21
|
+
private static listPeople;
|
|
22
|
+
private static seedLocations;
|
|
23
|
+
private static assertOnlyOneOrgExists;
|
|
24
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
9
|
+
var t = {};
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
13
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
14
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
15
|
+
t[p[i]] = s[p[i]];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
24
|
+
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
|
25
|
+
const test_1 = require("@sprucelabs/test");
|
|
26
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
27
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
|
28
|
+
const constants_1 = require("../../tests/constants");
|
|
29
|
+
const fake_1 = __importDefault(require("../../tests/decorators/fake"));
|
|
30
|
+
const sorter = (a, b) => (a.id > b.id ? 1 : -1);
|
|
31
|
+
let SeedingDataTest = class SeedingDataTest extends AbstractSpruceFixtureTest_1.default {
|
|
32
|
+
static async beforeEach() {
|
|
33
|
+
await super.beforeEach();
|
|
34
|
+
this.client = fake_1.default.getClient();
|
|
35
|
+
this.fixture = this.Fixture('seed');
|
|
36
|
+
await this.fixture.resetAccount(constants_1.DEMO_NUMBER_SEED_FIXTURE);
|
|
37
|
+
}
|
|
38
|
+
static hasSeedFixture() {
|
|
39
|
+
test_1.assert.isTruthy(this.fixture);
|
|
40
|
+
}
|
|
41
|
+
static async canSeedManyOrgs() {
|
|
42
|
+
const organizations = await this.fixture.seedOrganizations({
|
|
43
|
+
totalOrganizations: 5,
|
|
44
|
+
});
|
|
45
|
+
test_1.assert.isLength(organizations, 5);
|
|
46
|
+
}
|
|
47
|
+
static async actuallyCreatesOrgs() {
|
|
48
|
+
const organizations = await this.fixture.seedOrganizations({
|
|
49
|
+
totalOrganizations: 3,
|
|
50
|
+
});
|
|
51
|
+
const results = await this.client.emit('list-organizations::v2020_12_25', {
|
|
52
|
+
payload: {
|
|
53
|
+
shouldOnlyShowMine: true,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
const { organizations: matched } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
57
|
+
test_1.assert.isLength(matched, 3);
|
|
58
|
+
test_1.assert.isLength(organizations, 3);
|
|
59
|
+
for (const org of organizations) {
|
|
60
|
+
const results = await this.client.emit('get-organization::v2020_12_25', {
|
|
61
|
+
target: {
|
|
62
|
+
organizationId: org.id,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
static async canSeedLocations() {
|
|
69
|
+
const { locations } = await this.fixture.seedAccount({
|
|
70
|
+
totalLocations: 5,
|
|
71
|
+
});
|
|
72
|
+
test_1.assert.isLength(locations, 5);
|
|
73
|
+
}
|
|
74
|
+
static async seedingOrgsCreatesOrganization() {
|
|
75
|
+
const { locations } = await this.fixture.seedAccount({
|
|
76
|
+
totalLocations: 3,
|
|
77
|
+
});
|
|
78
|
+
test_1.assert.isLength(locations, 3);
|
|
79
|
+
await this.assertOnlyOneOrgExists();
|
|
80
|
+
}
|
|
81
|
+
static async canPassOrgToLocationSeeder() {
|
|
82
|
+
const org = await this.organizations.seedDemoOrganization();
|
|
83
|
+
await this.fixture.seedAccount({
|
|
84
|
+
totalLocations: 3,
|
|
85
|
+
organizationId: org.id,
|
|
86
|
+
});
|
|
87
|
+
await this.assertOnlyOneOrgExists();
|
|
88
|
+
}
|
|
89
|
+
static async throwsWhenSeedingWithoutCount() {
|
|
90
|
+
//@ts-ignore
|
|
91
|
+
const err = await test_1.assert.doesThrowAsync(() => this.fixture.seedAccount({}));
|
|
92
|
+
test_utils_1.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
93
|
+
parameters: ['totalLocations'],
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
static async actuallyCreatesLocations() {
|
|
97
|
+
const { organization, locations } = await this.seedLocations();
|
|
98
|
+
const results = await this.client.emit('list-locations::v2020_12_25', {
|
|
99
|
+
target: {
|
|
100
|
+
organizationId: organization.id,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
const { locations: matches } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
104
|
+
test_1.assert.isLength(matches, 3);
|
|
105
|
+
for (const location of locations) {
|
|
106
|
+
const results = await this.client.emit('get-location::v2020_12_25', {
|
|
107
|
+
target: {
|
|
108
|
+
locationId: location.id,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
static async needsStartingPhoneWhenSeedingPeople(options) {
|
|
115
|
+
const err = await test_1.assert.doesThrowAsync(() => this.seedLocations(Object.assign({}, options)));
|
|
116
|
+
test_utils_1.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
117
|
+
parameters: ['startingPhone'],
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
static async returnsSeededGuests(options, expectedCount, base) {
|
|
121
|
+
var _a;
|
|
122
|
+
const _b = await this.seedLocations(Object.assign({ totalLocations: 1, startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE }, options)), { locations } = _b, rest = __rest(_b, ["locations"]);
|
|
123
|
+
const withoutOwner = await this.listPeople(locations[0], base);
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
125
|
+
const withoutOwnerCleaned = withoutOwner.map((_a) => {
|
|
126
|
+
var { roleIds } = _a, rest = __rest(_a, ["roleIds"]);
|
|
127
|
+
return rest;
|
|
128
|
+
});
|
|
129
|
+
//@ts-ignore
|
|
130
|
+
const people = (_a = rest[base + 's']) !== null && _a !== void 0 ? _a : [];
|
|
131
|
+
people.sort(sorter);
|
|
132
|
+
withoutOwnerCleaned.sort(sorter);
|
|
133
|
+
test_1.assert.isLength(withoutOwner, expectedCount);
|
|
134
|
+
test_1.assert.isEqualDeep(people, withoutOwnerCleaned);
|
|
135
|
+
}
|
|
136
|
+
static async setsFirstPersonsNumberToTheStartingPhone(phone) {
|
|
137
|
+
const { guests } = await this.seedLocations({
|
|
138
|
+
totalLocations: 1,
|
|
139
|
+
totalGuests: 1,
|
|
140
|
+
startingPhone: phone,
|
|
141
|
+
});
|
|
142
|
+
test_1.assert.isEqual(guests[0].phone, (0, schema_1.formatPhoneNumber)(phone));
|
|
143
|
+
}
|
|
144
|
+
static async canSeedMultipleRolesAtOnce() {
|
|
145
|
+
const { locations } = await this.seedLocations({
|
|
146
|
+
startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
147
|
+
totalLocations: 1,
|
|
148
|
+
totalGuests: 3,
|
|
149
|
+
totalManagers: 2,
|
|
150
|
+
});
|
|
151
|
+
const people = await this.listPeople(locations[0], ['guest', 'manager']);
|
|
152
|
+
test_1.assert.isLength(people, 5);
|
|
153
|
+
}
|
|
154
|
+
static async seededPeopleHaveNames() {
|
|
155
|
+
const { teammates } = await this.seedLocations({
|
|
156
|
+
startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
157
|
+
totalLocations: 1,
|
|
158
|
+
totalTeammates: 2,
|
|
159
|
+
});
|
|
160
|
+
test_1.assert.isTruthy(teammates[0].firstName);
|
|
161
|
+
}
|
|
162
|
+
static async peopleAllHaveUniqueNames() {
|
|
163
|
+
const { teammates } = await this.seedLocations({
|
|
164
|
+
startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
165
|
+
totalLocations: 1,
|
|
166
|
+
totalTeammates: 2,
|
|
167
|
+
});
|
|
168
|
+
const names = teammates.map((t) => t.casualName);
|
|
169
|
+
const unique = [...new Set(names)];
|
|
170
|
+
test_1.assert.isLength(unique, names.length);
|
|
171
|
+
}
|
|
172
|
+
static async namesAreOnlyAssignedIfNotYetAssigned() {
|
|
173
|
+
const { client } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE);
|
|
174
|
+
const firstName = `Test person:: ${Math.random()}`;
|
|
175
|
+
const lastName = `${Math.random()}`;
|
|
176
|
+
await client.emitAndFlattenResponses('update-person::v2020_12_25', {
|
|
177
|
+
payload: {
|
|
178
|
+
firstName,
|
|
179
|
+
lastName,
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
const { teammates } = await this.seedLocations({
|
|
183
|
+
startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
184
|
+
totalLocations: 1,
|
|
185
|
+
totalTeammates: 1,
|
|
186
|
+
});
|
|
187
|
+
const [tm1] = teammates;
|
|
188
|
+
test_1.assert.isEqual(tm1.casualName, firstName + ' ' + lastName[0] + '.');
|
|
189
|
+
}
|
|
190
|
+
static async listPeople(location, base) {
|
|
191
|
+
const people = await this.people.listPeople({
|
|
192
|
+
locationId: location.id,
|
|
193
|
+
organizationId: location.organizationId,
|
|
194
|
+
roleBases: Array.isArray(base) ? base : [base],
|
|
195
|
+
shouldIncludePrivateFields: true,
|
|
196
|
+
});
|
|
197
|
+
const withoutOwner = people.filter((p) => p.id !== fake_1.default.getPerson().id);
|
|
198
|
+
return withoutOwner;
|
|
199
|
+
}
|
|
200
|
+
static async seedLocations(options) {
|
|
201
|
+
const org = await this.organizations.seedDemoOrganization();
|
|
202
|
+
const results = await this.fixture.seedAccount(Object.assign({ totalLocations: 3, organizationId: org.id }, options));
|
|
203
|
+
return Object.assign({ organization: org }, results);
|
|
204
|
+
}
|
|
205
|
+
static async assertOnlyOneOrgExists() {
|
|
206
|
+
const results = await this.client.emit('list-organizations::v2020_12_25', {
|
|
207
|
+
payload: {
|
|
208
|
+
shouldOnlyShowMine: true,
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
const { organizations } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
212
|
+
test_1.assert.isLength(organizations, 1);
|
|
213
|
+
test_1.assert.isObject(organizations[0].address);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
__decorate([
|
|
217
|
+
(0, test_1.test)()
|
|
218
|
+
], SeedingDataTest, "hasSeedFixture", null);
|
|
219
|
+
__decorate([
|
|
220
|
+
(0, test_1.test)()
|
|
221
|
+
], SeedingDataTest, "canSeedManyOrgs", null);
|
|
222
|
+
__decorate([
|
|
223
|
+
(0, test_1.test)()
|
|
224
|
+
], SeedingDataTest, "actuallyCreatesOrgs", null);
|
|
225
|
+
__decorate([
|
|
226
|
+
(0, test_1.test)()
|
|
227
|
+
], SeedingDataTest, "canSeedLocations", null);
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, test_1.test)()
|
|
230
|
+
], SeedingDataTest, "seedingOrgsCreatesOrganization", null);
|
|
231
|
+
__decorate([
|
|
232
|
+
(0, test_1.test)()
|
|
233
|
+
], SeedingDataTest, "canPassOrgToLocationSeeder", null);
|
|
234
|
+
__decorate([
|
|
235
|
+
(0, test_1.test)()
|
|
236
|
+
], SeedingDataTest, "throwsWhenSeedingWithoutCount", null);
|
|
237
|
+
__decorate([
|
|
238
|
+
(0, test_1.test)()
|
|
239
|
+
], SeedingDataTest, "actuallyCreatesLocations", null);
|
|
240
|
+
__decorate([
|
|
241
|
+
(0, test_1.test)('missing starting phone with totalGuests', { totalGuests: 10 }),
|
|
242
|
+
(0, test_1.test)('missing starting phone with totalTeammates', { totalTeammates: 10 })
|
|
243
|
+
], SeedingDataTest, "needsStartingPhoneWhenSeedingPeople", null);
|
|
244
|
+
__decorate([
|
|
245
|
+
(0, test_1.test)('can seed 3 guests', { totalGuests: 3 }, 3, 'guest'),
|
|
246
|
+
(0, test_1.test)('can seed 5 guests', { totalGuests: 5 }, 5, 'guest'),
|
|
247
|
+
(0, test_1.test)('can seed 2 teammates', { totalTeammates: 2 }, 2, 'teammate'),
|
|
248
|
+
(0, test_1.test)('can seed 3 managers', { totalManagers: 3 }, 3, 'manager'),
|
|
249
|
+
(0, test_1.test)('can seed 3 groupManager', { totalGroupManagers: 3 }, 3, 'groupManager'),
|
|
250
|
+
(0, test_1.test)('can seed 1 owners', { totalOwners: 1 }, 1, 'owner')
|
|
251
|
+
], SeedingDataTest, "returnsSeededGuests", null);
|
|
252
|
+
__decorate([
|
|
253
|
+
(0, test_1.test)('seeds with starting phone 1', constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE),
|
|
254
|
+
(0, test_1.test)('seeds with starting phone 2', constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE_ALT)
|
|
255
|
+
], SeedingDataTest, "setsFirstPersonsNumberToTheStartingPhone", null);
|
|
256
|
+
__decorate([
|
|
257
|
+
(0, test_1.test)()
|
|
258
|
+
], SeedingDataTest, "canSeedMultipleRolesAtOnce", null);
|
|
259
|
+
__decorate([
|
|
260
|
+
(0, test_1.test)()
|
|
261
|
+
], SeedingDataTest, "seededPeopleHaveNames", null);
|
|
262
|
+
__decorate([
|
|
263
|
+
(0, test_1.test)()
|
|
264
|
+
], SeedingDataTest, "peopleAllHaveUniqueNames", null);
|
|
265
|
+
__decorate([
|
|
266
|
+
(0, test_1.test)()
|
|
267
|
+
], SeedingDataTest, "namesAreOnlyAssignedIfNotYetAssigned", null);
|
|
268
|
+
SeedingDataTest = __decorate([
|
|
269
|
+
fake_1.default.login(constants_1.DEMO_NUMBER_SEED_FIXTURE)
|
|
270
|
+
], SeedingDataTest);
|
|
271
|
+
exports.default = SeedingDataTest;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
export default class SkillFixtureTest extends AbstractSpruceFixtureTest {
|
|
3
|
+
private static fixture;
|
|
4
|
+
protected static beforeEach(): Promise<void>;
|
|
5
|
+
protected static canCreateSkillFixture(): Promise<void>;
|
|
6
|
+
protected static canSeedSkill(): Promise<void>;
|
|
7
|
+
protected static cleansUpSkillsAndNotCrashWithMultileDestroys(): Promise<void>;
|
|
8
|
+
protected static cantLoginAsCurrentSkillIfSkillNotConfigured(): Promise<void>;
|
|
9
|
+
protected static cantLoginAsCurrentSkillIfSkillNotConfiguredWithApiKey(): Promise<void>;
|
|
10
|
+
protected static canLoginAsCurrentSkill(): Promise<void>;
|
|
11
|
+
protected static shouldUnRegisterDemoSkills(): Promise<void>;
|
|
12
|
+
protected static canPassThroughPersonFixture(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
|
13
|
+
const test_1 = require("@sprucelabs/test");
|
|
14
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
15
|
+
const __1 = require("../..");
|
|
16
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
|
17
|
+
const constants_1 = require("../../tests/constants");
|
|
18
|
+
let SkillFixtureTest = class SkillFixtureTest extends AbstractSpruceFixtureTest_1.default {
|
|
19
|
+
static async beforeEach() {
|
|
20
|
+
await super.beforeEach();
|
|
21
|
+
this.fixture = this.Fixture('skill');
|
|
22
|
+
delete process.env.SKILL_ID;
|
|
23
|
+
delete process.env.SKILL_API_KEY;
|
|
24
|
+
}
|
|
25
|
+
static async canCreateSkillFixture() {
|
|
26
|
+
test_1.assert.isTruthy(this.fixture);
|
|
27
|
+
}
|
|
28
|
+
static async canSeedSkill() {
|
|
29
|
+
const skill = await this.fixture.seedDemoSkill({
|
|
30
|
+
name: 'skill1',
|
|
31
|
+
});
|
|
32
|
+
test_1.assert.isTruthy(skill);
|
|
33
|
+
test_1.assert.isEqual(skill.name, 'skill1');
|
|
34
|
+
}
|
|
35
|
+
static async cleansUpSkillsAndNotCrashWithMultileDestroys() {
|
|
36
|
+
const skill = await this.fixture.seedDemoSkill({
|
|
37
|
+
name: 'skill1',
|
|
38
|
+
});
|
|
39
|
+
await this.fixture.destroy();
|
|
40
|
+
await this.fixture.destroy();
|
|
41
|
+
const client = await this.Fixture('mercury').connectToApi();
|
|
42
|
+
const results = await client.emit('get-skill::v2020_12_25', {
|
|
43
|
+
target: {
|
|
44
|
+
skillId: skill.id,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
spruce_event_utils_1.eventAssertUtil.assertErrorFromResponse(results, 'INVALID_TARGET');
|
|
48
|
+
}
|
|
49
|
+
static async cantLoginAsCurrentSkillIfSkillNotConfigured() {
|
|
50
|
+
const err = await test_1.assert.doesThrowAsync(() => this.fixture.loginAsCurrentSkill());
|
|
51
|
+
test_utils_1.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
52
|
+
parameters: ['env.SKILL_ID', 'env.SKILL_API_KEY'],
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
static async cantLoginAsCurrentSkillIfSkillNotConfiguredWithApiKey() {
|
|
56
|
+
process.env.SKILL_ID = '123';
|
|
57
|
+
const err = await test_1.assert.doesThrowAsync(() => this.fixture.loginAsCurrentSkill());
|
|
58
|
+
test_utils_1.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
59
|
+
parameters: ['env.SKILL_API_KEY'],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
static async canLoginAsCurrentSkill() {
|
|
63
|
+
const { skill: demoSkill } = await this.fixture.loginAsDemoSkill({
|
|
64
|
+
name: 'Demo me!',
|
|
65
|
+
});
|
|
66
|
+
process.env.SKILL_ID = demoSkill.id;
|
|
67
|
+
process.env.SKILL_API_KEY = demoSkill.apiKey;
|
|
68
|
+
const { skill, client } = await this.fixture.loginAsCurrentSkill();
|
|
69
|
+
test_1.assert.isTruthy(skill);
|
|
70
|
+
test_1.assert.isTruthy(client);
|
|
71
|
+
test_1.assert.isEqual(skill.id, demoSkill.id);
|
|
72
|
+
test_1.assert.isEqual(skill.apiKey, demoSkill.apiKey);
|
|
73
|
+
}
|
|
74
|
+
static async shouldUnRegisterDemoSkills() {
|
|
75
|
+
const { client } = await this.fixture.loginAsDemoSkill({
|
|
76
|
+
name: 'Demo me!',
|
|
77
|
+
});
|
|
78
|
+
await this.fixture.destroy();
|
|
79
|
+
const results = await client.emit('whoami::v2020_12_25');
|
|
80
|
+
test_1.assert.doesThrow(() => spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results));
|
|
81
|
+
}
|
|
82
|
+
static canPassThroughPersonFixture() {
|
|
83
|
+
const personFixture = this.Fixture('person');
|
|
84
|
+
const fixture = this.Fixture('skill', { personFixture });
|
|
85
|
+
//@ts-ignore
|
|
86
|
+
test_1.assert.isEqual(fixture.personFixture, personFixture);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, test_1.test)()
|
|
91
|
+
], SkillFixtureTest, "canCreateSkillFixture", null);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, test_1.test)()
|
|
94
|
+
], SkillFixtureTest, "canSeedSkill", null);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, test_1.test)()
|
|
97
|
+
], SkillFixtureTest, "cleansUpSkillsAndNotCrashWithMultileDestroys", null);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, test_1.test)()
|
|
100
|
+
], SkillFixtureTest, "cantLoginAsCurrentSkillIfSkillNotConfigured", null);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, test_1.test)()
|
|
103
|
+
], SkillFixtureTest, "cantLoginAsCurrentSkillIfSkillNotConfiguredWithApiKey", null);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, test_1.test)()
|
|
106
|
+
], SkillFixtureTest, "canLoginAsCurrentSkill", null);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, test_1.test)()
|
|
109
|
+
], SkillFixtureTest, "shouldUnRegisterDemoSkills", null);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, test_1.test)()
|
|
112
|
+
], SkillFixtureTest, "canPassThroughPersonFixture", null);
|
|
113
|
+
SkillFixtureTest = __decorate([
|
|
114
|
+
(0, __1.login)(constants_1.DEMO_NUMBER_SKILL_FIXTURE)
|
|
115
|
+
], SkillFixtureTest);
|
|
116
|
+
exports.default = SkillFixtureTest;
|