@sprucelabs/spruce-test-fixtures 45.2.7 → 46.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.d.ts +7 -0
- package/build/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +41 -0
- package/build/__tests__/behavioral/DatabaseFixture.test.d.ts +7 -0
- package/build/__tests__/behavioral/DatabaseFixture.test.js +59 -0
- package/build/__tests__/behavioral/DbResetsAsExpected.test.d.ts +5 -0
- package/build/__tests__/behavioral/DbResetsAsExpected.test.js +34 -0
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +15 -0
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +109 -0
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +4 -0
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +34 -0
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +5 -0
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +26 -0
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +8 -0
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +65 -0
- package/build/__tests__/behavioral/DummyStore.d.ts +55 -0
- package/build/__tests__/behavioral/DummyStore.js +36 -0
- package/build/__tests__/behavioral/FakingEventResponses.test.d.ts +12 -0
- package/build/__tests__/behavioral/FakingEventResponses.test.js +125 -0
- package/build/__tests__/behavioral/FixtureFactory.test.d.ts +7 -0
- package/build/__tests__/behavioral/FixtureFactory.test.js +79 -0
- package/build/__tests__/behavioral/LocationFixture.test.d.ts +15 -0
- package/build/__tests__/behavioral/LocationFixture.test.js +128 -0
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +12 -0
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +92 -0
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +4 -0
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +29 -0
- package/build/__tests__/behavioral/MercuryFixture.test.d.ts +19 -0
- package/build/__tests__/behavioral/MercuryFixture.test.js +175 -0
- package/build/__tests__/behavioral/OrganizationFixture.test.d.ts +31 -0
- package/build/__tests__/behavioral/OrganizationFixture.test.js +331 -0
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +4 -0
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +21 -0
- package/build/__tests__/behavioral/PersonFixture.test.d.ts +22 -0
- package/build/__tests__/behavioral/PersonFixture.test.js +224 -0
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +11 -0
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +95 -0
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +8 -0
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +60 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +5 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +37 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +7 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +44 -0
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +10 -0
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +130 -0
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +7 -0
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +42 -0
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +6 -0
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +37 -0
- package/build/__tests__/behavioral/RoleFixture.test.d.ts +15 -0
- package/build/__tests__/behavioral/RoleFixture.test.js +118 -0
- package/build/__tests__/behavioral/SeedingData.test.d.ts +24 -0
- package/build/__tests__/behavioral/SeedingData.test.js +271 -0
- package/build/__tests__/behavioral/SkillFixture.test.d.ts +13 -0
- package/build/__tests__/behavioral/SkillFixture.test.js +116 -0
- package/build/__tests__/behavioral/StoreFixture.test.d.ts +23 -0
- package/build/__tests__/behavioral/StoreFixture.test.js +156 -0
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +9 -0
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +71 -0
- package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +45 -0
- package/build/__tests__/behavioral/faking/FakeDecorator.test.js +418 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +23 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +27 -0
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +8 -0
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +93 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +8 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +56 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +14 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +141 -0
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +6 -0
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +42 -0
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +19 -0
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +140 -0
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +24 -0
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +174 -0
- package/build/__tests__/behavioral/faking/UpdatePerson.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/UpdatePerson.test.js +32 -0
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +35 -0
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +321 -0
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +48 -0
- package/build/__tests__/behavioral/faking/WhoAmI.test.d.ts +19 -0
- package/build/__tests__/behavioral/faking/WhoAmI.test.js +103 -0
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +10 -0
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +76 -0
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +37 -0
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +266 -0
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +14 -0
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +113 -0
- package/build/__tests__/behavioral/views/CheckingPermissions.test.d.ts +24 -0
- package/build/__tests__/behavioral/views/CheckingPermissions.test.js +162 -0
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +12 -0
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +55 -0
- package/build/__tests__/behavioral/views/Routing.test.d.ts +31 -0
- package/build/__tests__/behavioral/views/Routing.test.js +141 -0
- package/build/__tests__/behavioral/views/TestingScope.test.d.ts +9 -0
- package/build/__tests__/behavioral/views/TestingScope.test.js +67 -0
- package/build/__tests__/behavioral/views/ViewFixture.test.d.ts +102 -0
- package/build/__tests__/behavioral/views/ViewFixture.test.js +652 -0
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +11 -0
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +55 -0
- package/build/__tests__/support/AbstractFakeDecoratorTest.d.ts +5 -0
- package/build/__tests__/support/AbstractFakeDecoratorTest.js +27 -0
- package/build/__tests__/support/EventFaker.d.ts +5 -0
- package/build/__tests__/support/EventFaker.js +36 -0
- package/build/__tests__/support/FakeThemeManager.d.ts +8 -0
- package/build/__tests__/support/FakeThemeManager.js +40 -0
- package/build/__tests__/test.types.d.ts +2 -0
- package/build/__tests__/test.types.js +2 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.d.ts +5 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.js +9 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +51 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +33 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/src/.spruce/settings.json +6 -0
- package/build/__tests__/testDirsAndFiles/skill/build/.spruce/views/views.js +18 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +11 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +7 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +19 -0
- package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +31 -0
- package/build/__tests__/testDirsAndFiles/skill/package.json +5 -0
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/settings.json +6 -0
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.d.ts +7 -0
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.js +16 -0
- package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +11 -0
- package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +31 -0
- package/build/esm/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +53 -0
- package/build/esm/__tests__/behavioral/DatabaseFixture.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/DatabaseFixture.test.js +48 -0
- package/build/esm/__tests__/behavioral/DbResetsAsExpected.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/DbResetsAsExpected.test.js +28 -0
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +15 -0
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +125 -0
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +40 -0
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +23 -0
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +76 -0
- package/build/esm/__tests__/behavioral/DummyStore.d.ts +55 -0
- package/build/esm/__tests__/behavioral/DummyStore.js +43 -0
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.d.ts +12 -0
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +147 -0
- package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/FixtureFactory.test.js +61 -0
- package/build/esm/__tests__/behavioral/LocationFixture.test.d.ts +15 -0
- package/build/esm/__tests__/behavioral/LocationFixture.test.js +153 -0
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +12 -0
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +110 -0
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +38 -0
- package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +19 -0
- package/build/esm/__tests__/behavioral/MercuryFixture.test.js +209 -0
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.d.ts +31 -0
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +387 -0
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +18 -0
- package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +22 -0
- package/build/esm/__tests__/behavioral/PersonFixture.test.js +231 -0
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +11 -0
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +112 -0
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +80 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +51 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +59 -0
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +10 -0
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +139 -0
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +57 -0
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +6 -0
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +48 -0
- package/build/esm/__tests__/behavioral/RoleFixture.test.d.ts +15 -0
- package/build/esm/__tests__/behavioral/RoleFixture.test.js +143 -0
- package/build/esm/__tests__/behavioral/SeedingData.test.d.ts +24 -0
- package/build/esm/__tests__/behavioral/SeedingData.test.js +314 -0
- package/build/esm/__tests__/behavioral/SkillFixture.test.d.ts +13 -0
- package/build/esm/__tests__/behavioral/SkillFixture.test.js +139 -0
- package/build/esm/__tests__/behavioral/StoreFixture.test.d.ts +23 -0
- package/build/esm/__tests__/behavioral/StoreFixture.test.js +164 -0
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +9 -0
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +87 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +45 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +479 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +28 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +32 -0
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +82 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +70 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +14 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +165 -0
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +6 -0
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +55 -0
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +19 -0
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +175 -0
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +24 -0
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +214 -0
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +38 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +35 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +360 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +31 -0
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.d.ts +19 -0
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +140 -0
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +10 -0
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +94 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +37 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +322 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +14 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +134 -0
- package/build/esm/__tests__/behavioral/views/CheckingPermissions.test.d.ts +24 -0
- package/build/esm/__tests__/behavioral/views/CheckingPermissions.test.js +200 -0
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +12 -0
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +69 -0
- package/build/esm/__tests__/behavioral/views/Routing.test.d.ts +31 -0
- package/build/esm/__tests__/behavioral/views/Routing.test.js +169 -0
- package/build/esm/__tests__/behavioral/views/TestingScope.test.d.ts +9 -0
- package/build/esm/__tests__/behavioral/views/TestingScope.test.js +84 -0
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.d.ts +102 -0
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.js +731 -0
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +11 -0
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +63 -0
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.d.ts +5 -0
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +34 -0
- package/build/esm/__tests__/support/EventFaker.d.ts +5 -0
- package/build/esm/__tests__/support/EventFaker.js +45 -0
- package/build/esm/__tests__/support/FakeThemeManager.d.ts +8 -0
- package/build/esm/__tests__/support/FakeThemeManager.js +37 -0
- package/build/esm/__tests__/test.types.d.ts +2 -0
- package/build/esm/__tests__/test.types.js +1 -0
- package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +51 -0
- package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +41 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +7 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +27 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +25 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +25 -0
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/tests/decorators/fake.js +7 -1
- package/build/esm/tests/fixtures/ViewFixture.d.ts +1 -0
- package/build/esm/tests/fixtures/ViewFixture.js +4 -1
- package/build/esm/tests/routers/TestRouter.d.ts +3 -0
- package/build/esm/tests/routers/TestRouter.js +6 -0
- package/build/esm/utilities/vcDisk.utility.js +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -1
- package/build/tests/decorators/fake.js +7 -1
- package/build/tests/fixtures/ViewFixture.d.ts +1 -0
- package/build/tests/fixtures/ViewFixture.js +4 -1
- package/build/tests/routers/TestRouter.d.ts +3 -0
- package/build/tests/routers/TestRouter.js +6 -0
- package/build/utilities/vcDisk.utility.js +1 -0
- package/package.json +11 -11
|
@@ -0,0 +1,143 @@
|
|
|
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 { assert, test } from '@sprucelabs/test';
|
|
18
|
+
import { errorAssert } from '@sprucelabs/test-utils';
|
|
19
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
|
20
|
+
import { DEMO_NUMBER_ROLE_FIXTURE } from '../../tests/constants.js';
|
|
21
|
+
import fake from '../../tests/decorators/fake.js';
|
|
22
|
+
import seed from '../../tests/decorators/seed.js';
|
|
23
|
+
let RoleFixtureTest = class RoleFixtureTest 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('role');
|
|
31
|
+
this.client = fake.getClient();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
static hasRoleFixture() {
|
|
35
|
+
assert.isTruthy(this.fixture);
|
|
36
|
+
}
|
|
37
|
+
static cantListRolesWithoutOrg() {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const err = yield assert.doesThrowAsync(() => this.fixture.listRoles());
|
|
40
|
+
errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
41
|
+
parameters: ['organizationId'],
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
static listsValidRoles() {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const roles = yield this.fixture.listRoles();
|
|
48
|
+
assert.isArray(roles);
|
|
49
|
+
assert.isAbove(roles.length, 0);
|
|
50
|
+
for (const role of roles) {
|
|
51
|
+
const results = yield this.client.emit('get-role::v2020_12_25', {
|
|
52
|
+
target: {
|
|
53
|
+
roleId: role.id,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
eventResponseUtil.getFirstResponseOrThrow(results);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
static listsWorkingRolesByDefault() {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const allRoles = yield this.listRoles();
|
|
63
|
+
const expectedRoles = allRoles.filter((role) => role.base !== 'anonymous' && role.base !== 'loggedIn');
|
|
64
|
+
yield this.assertListedRolesMatchExpected(expectedRoles);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
static listMetaRolesWithOptions() {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const allRoles = yield this.listRoles();
|
|
70
|
+
yield this.assertListedRolesMatchExpected(allRoles, {
|
|
71
|
+
shouldIncludeMetaRoles: true,
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
static canPassOwnOrg() {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const orgs = yield this.organizations.listOrganizations();
|
|
78
|
+
const org = orgs[2];
|
|
79
|
+
const roles = yield this.fixture.listRoles({ organizationId: org.id });
|
|
80
|
+
assert.isEqual(roles[0].organizationId, org.id);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
static getNewestOrg() {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const org = yield this.organizations.getNewestOrganization();
|
|
86
|
+
assert.isTruthy(org, `You gotta @seed('organizations',1) to continue.`);
|
|
87
|
+
return org;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
static assertListedRolesMatchExpected(expectedRoles, options) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const roles = yield this.fixture.listRoles(options);
|
|
93
|
+
function sort(a, b) {
|
|
94
|
+
return a.name > b.name ? 1 : -1;
|
|
95
|
+
}
|
|
96
|
+
roles.sort(sort);
|
|
97
|
+
expectedRoles.sort(sort);
|
|
98
|
+
assert.isEqualDeep(roles, expectedRoles);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
static listRoles() {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
const org = yield this.getNewestOrg();
|
|
104
|
+
const roleResults = yield this.client.emit('list-roles::v2020_12_25', {
|
|
105
|
+
target: {
|
|
106
|
+
organizationId: org.id,
|
|
107
|
+
},
|
|
108
|
+
payload: {
|
|
109
|
+
shouldIncludePrivateRoles: true,
|
|
110
|
+
shouldIncludeMetaRoles: true,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
const { roles: allRoles } = eventResponseUtil.getFirstResponseOrThrow(roleResults);
|
|
114
|
+
return allRoles;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
__decorate([
|
|
119
|
+
test()
|
|
120
|
+
], RoleFixtureTest, "hasRoleFixture", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
test()
|
|
123
|
+
], RoleFixtureTest, "cantListRolesWithoutOrg", null);
|
|
124
|
+
__decorate([
|
|
125
|
+
test(),
|
|
126
|
+
seed('organizations', 1)
|
|
127
|
+
], RoleFixtureTest, "listsValidRoles", null);
|
|
128
|
+
__decorate([
|
|
129
|
+
test(),
|
|
130
|
+
seed('organizations', 1)
|
|
131
|
+
], RoleFixtureTest, "listsWorkingRolesByDefault", null);
|
|
132
|
+
__decorate([
|
|
133
|
+
test(),
|
|
134
|
+
seed('organizations', 1)
|
|
135
|
+
], RoleFixtureTest, "listMetaRolesWithOptions", null);
|
|
136
|
+
__decorate([
|
|
137
|
+
test(),
|
|
138
|
+
seed('organizations', 3)
|
|
139
|
+
], RoleFixtureTest, "canPassOwnOrg", null);
|
|
140
|
+
RoleFixtureTest = __decorate([
|
|
141
|
+
fake.login(DEMO_NUMBER_ROLE_FIXTURE)
|
|
142
|
+
], RoleFixtureTest);
|
|
143
|
+
export 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,314 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import { formatPhoneNumber } from '@sprucelabs/schema';
|
|
28
|
+
import { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
|
|
29
|
+
import { assert, test } from '@sprucelabs/test';
|
|
30
|
+
import { errorAssert } from '@sprucelabs/test-utils';
|
|
31
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
|
32
|
+
import { DEMO_NUMBER_SEED_FIXTURE, DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE, DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE_ALT, } from '../../tests/constants.js';
|
|
33
|
+
import fake from '../../tests/decorators/fake.js';
|
|
34
|
+
const sorter = (a, b) => (a.id > b.id ? 1 : -1);
|
|
35
|
+
let SeedingDataTest = class SeedingDataTest extends AbstractSpruceFixtureTest {
|
|
36
|
+
static beforeEach() {
|
|
37
|
+
const _super = Object.create(null, {
|
|
38
|
+
beforeEach: { get: () => super.beforeEach }
|
|
39
|
+
});
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
yield _super.beforeEach.call(this);
|
|
42
|
+
this.client = fake.getClient();
|
|
43
|
+
this.fixture = this.Fixture('seed');
|
|
44
|
+
yield this.fixture.resetAccount(DEMO_NUMBER_SEED_FIXTURE);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
static hasSeedFixture() {
|
|
48
|
+
assert.isTruthy(this.fixture);
|
|
49
|
+
}
|
|
50
|
+
static canSeedManyOrgs() {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const organizations = yield this.fixture.seedOrganizations({
|
|
53
|
+
totalOrganizations: 5,
|
|
54
|
+
});
|
|
55
|
+
assert.isLength(organizations, 5);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
static actuallyCreatesOrgs() {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const organizations = yield this.fixture.seedOrganizations({
|
|
61
|
+
totalOrganizations: 3,
|
|
62
|
+
});
|
|
63
|
+
const results = yield this.client.emit('list-organizations::v2020_12_25', {
|
|
64
|
+
payload: {
|
|
65
|
+
shouldOnlyShowMine: true,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
const { organizations: matched } = eventResponseUtil.getFirstResponseOrThrow(results);
|
|
69
|
+
assert.isLength(matched, 3);
|
|
70
|
+
assert.isLength(organizations, 3);
|
|
71
|
+
for (const org of organizations) {
|
|
72
|
+
const results = yield this.client.emit('get-organization::v2020_12_25', {
|
|
73
|
+
target: {
|
|
74
|
+
organizationId: org.id,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
eventResponseUtil.getFirstResponseOrThrow(results);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
static canSeedLocations() {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const { locations } = yield this.fixture.seedAccount({
|
|
84
|
+
totalLocations: 5,
|
|
85
|
+
});
|
|
86
|
+
assert.isLength(locations, 5);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
static seedingOrgsCreatesOrganization() {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
const { locations } = yield this.fixture.seedAccount({
|
|
92
|
+
totalLocations: 3,
|
|
93
|
+
});
|
|
94
|
+
assert.isLength(locations, 3);
|
|
95
|
+
yield this.assertOnlyOneOrgExists();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
static canPassOrgToLocationSeeder() {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const org = yield this.organizations.seedDemoOrganization();
|
|
101
|
+
yield this.fixture.seedAccount({
|
|
102
|
+
totalLocations: 3,
|
|
103
|
+
organizationId: org.id,
|
|
104
|
+
});
|
|
105
|
+
yield this.assertOnlyOneOrgExists();
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
static throwsWhenSeedingWithoutCount() {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
//@ts-ignore
|
|
111
|
+
const err = yield assert.doesThrowAsync(() => this.fixture.seedAccount({}));
|
|
112
|
+
errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
113
|
+
parameters: ['totalLocations'],
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
static actuallyCreatesLocations() {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const { organization, locations } = yield this.seedLocations();
|
|
120
|
+
const results = yield this.client.emit('list-locations::v2020_12_25', {
|
|
121
|
+
target: {
|
|
122
|
+
organizationId: organization.id,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
const { locations: matches } = eventResponseUtil.getFirstResponseOrThrow(results);
|
|
126
|
+
assert.isLength(matches, 3);
|
|
127
|
+
for (const location of locations) {
|
|
128
|
+
const results = yield this.client.emit('get-location::v2020_12_25', {
|
|
129
|
+
target: {
|
|
130
|
+
locationId: location.id,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
eventResponseUtil.getFirstResponseOrThrow(results);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
static needsStartingPhoneWhenSeedingPeople(options) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
const err = yield assert.doesThrowAsync(() => this.seedLocations(Object.assign({}, options)));
|
|
140
|
+
errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
141
|
+
parameters: ['startingPhone'],
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
static returnsSeededGuests(options, expectedCount, base) {
|
|
146
|
+
var _a;
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
const _b = yield this.seedLocations(Object.assign({ totalLocations: 1, startingPhone: DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE }, options)), { locations } = _b, rest = __rest(_b, ["locations"]);
|
|
149
|
+
const withoutOwner = yield this.listPeople(locations[0], base);
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
151
|
+
const withoutOwnerCleaned = withoutOwner.map((_a) => {
|
|
152
|
+
var { roleIds } = _a, rest = __rest(_a, ["roleIds"]);
|
|
153
|
+
return rest;
|
|
154
|
+
});
|
|
155
|
+
//@ts-ignore
|
|
156
|
+
const people = (_a = rest[base + 's']) !== null && _a !== void 0 ? _a : [];
|
|
157
|
+
people.sort(sorter);
|
|
158
|
+
withoutOwnerCleaned.sort(sorter);
|
|
159
|
+
assert.isLength(withoutOwner, expectedCount);
|
|
160
|
+
assert.isEqualDeep(people, withoutOwnerCleaned);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
static setsFirstPersonsNumberToTheStartingPhone(phone) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
const { guests } = yield this.seedLocations({
|
|
166
|
+
totalLocations: 1,
|
|
167
|
+
totalGuests: 1,
|
|
168
|
+
startingPhone: phone,
|
|
169
|
+
});
|
|
170
|
+
assert.isEqual(guests[0].phone, formatPhoneNumber(phone));
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
static canSeedMultipleRolesAtOnce() {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
const { locations } = yield this.seedLocations({
|
|
176
|
+
startingPhone: DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
177
|
+
totalLocations: 1,
|
|
178
|
+
totalGuests: 3,
|
|
179
|
+
totalManagers: 2,
|
|
180
|
+
});
|
|
181
|
+
const people = yield this.listPeople(locations[0], ['guest', 'manager']);
|
|
182
|
+
assert.isLength(people, 5);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
static seededPeopleHaveNames() {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
const { teammates } = yield this.seedLocations({
|
|
188
|
+
startingPhone: DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
189
|
+
totalLocations: 1,
|
|
190
|
+
totalTeammates: 2,
|
|
191
|
+
});
|
|
192
|
+
assert.isTruthy(teammates[0].firstName);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
static peopleAllHaveUniqueNames() {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
const { teammates } = yield this.seedLocations({
|
|
198
|
+
startingPhone: DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
199
|
+
totalLocations: 1,
|
|
200
|
+
totalTeammates: 2,
|
|
201
|
+
});
|
|
202
|
+
const names = teammates.map((t) => t.casualName);
|
|
203
|
+
const unique = [...new Set(names)];
|
|
204
|
+
assert.isLength(unique, names.length);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
static namesAreOnlyAssignedIfNotYetAssigned() {
|
|
208
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
209
|
+
const { client } = yield this.people.loginAsDemoPerson(DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE);
|
|
210
|
+
const firstName = `Test person:: ${Math.random()}`;
|
|
211
|
+
const lastName = `${Math.random()}`;
|
|
212
|
+
yield client.emitAndFlattenResponses('update-person::v2020_12_25', {
|
|
213
|
+
payload: {
|
|
214
|
+
firstName,
|
|
215
|
+
lastName,
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
const { teammates } = yield this.seedLocations({
|
|
219
|
+
startingPhone: DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
220
|
+
totalLocations: 1,
|
|
221
|
+
totalTeammates: 1,
|
|
222
|
+
});
|
|
223
|
+
const [tm1] = teammates;
|
|
224
|
+
assert.isEqual(tm1.casualName, firstName + ' ' + lastName[0] + '.');
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
static listPeople(location, base) {
|
|
228
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
229
|
+
const people = yield this.people.listPeople({
|
|
230
|
+
locationId: location.id,
|
|
231
|
+
organizationId: location.organizationId,
|
|
232
|
+
roleBases: Array.isArray(base) ? base : [base],
|
|
233
|
+
shouldIncludePrivateFields: true,
|
|
234
|
+
});
|
|
235
|
+
const withoutOwner = people.filter((p) => p.id !== fake.getPerson().id);
|
|
236
|
+
return withoutOwner;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
static seedLocations(options) {
|
|
240
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
241
|
+
const org = yield this.organizations.seedDemoOrganization();
|
|
242
|
+
const results = yield this.fixture.seedAccount(Object.assign({ totalLocations: 3, organizationId: org.id }, options));
|
|
243
|
+
return Object.assign({ organization: org }, results);
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
static assertOnlyOneOrgExists() {
|
|
247
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
+
const results = yield this.client.emit('list-organizations::v2020_12_25', {
|
|
249
|
+
payload: {
|
|
250
|
+
shouldOnlyShowMine: true,
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
const { organizations } = eventResponseUtil.getFirstResponseOrThrow(results);
|
|
254
|
+
assert.isLength(organizations, 1);
|
|
255
|
+
assert.isObject(organizations[0].address);
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
__decorate([
|
|
260
|
+
test()
|
|
261
|
+
], SeedingDataTest, "hasSeedFixture", null);
|
|
262
|
+
__decorate([
|
|
263
|
+
test()
|
|
264
|
+
], SeedingDataTest, "canSeedManyOrgs", null);
|
|
265
|
+
__decorate([
|
|
266
|
+
test()
|
|
267
|
+
], SeedingDataTest, "actuallyCreatesOrgs", null);
|
|
268
|
+
__decorate([
|
|
269
|
+
test()
|
|
270
|
+
], SeedingDataTest, "canSeedLocations", null);
|
|
271
|
+
__decorate([
|
|
272
|
+
test()
|
|
273
|
+
], SeedingDataTest, "seedingOrgsCreatesOrganization", null);
|
|
274
|
+
__decorate([
|
|
275
|
+
test()
|
|
276
|
+
], SeedingDataTest, "canPassOrgToLocationSeeder", null);
|
|
277
|
+
__decorate([
|
|
278
|
+
test()
|
|
279
|
+
], SeedingDataTest, "throwsWhenSeedingWithoutCount", null);
|
|
280
|
+
__decorate([
|
|
281
|
+
test()
|
|
282
|
+
], SeedingDataTest, "actuallyCreatesLocations", null);
|
|
283
|
+
__decorate([
|
|
284
|
+
test('missing starting phone with totalGuests', { totalGuests: 10 }),
|
|
285
|
+
test('missing starting phone with totalTeammates', { totalTeammates: 10 })
|
|
286
|
+
], SeedingDataTest, "needsStartingPhoneWhenSeedingPeople", null);
|
|
287
|
+
__decorate([
|
|
288
|
+
test('can seed 3 guests', { totalGuests: 3 }, 3, 'guest'),
|
|
289
|
+
test('can seed 5 guests', { totalGuests: 5 }, 5, 'guest'),
|
|
290
|
+
test('can seed 2 teammates', { totalTeammates: 2 }, 2, 'teammate'),
|
|
291
|
+
test('can seed 3 managers', { totalManagers: 3 }, 3, 'manager'),
|
|
292
|
+
test('can seed 3 groupManager', { totalGroupManagers: 3 }, 3, 'groupManager'),
|
|
293
|
+
test('can seed 1 owners', { totalOwners: 1 }, 1, 'owner')
|
|
294
|
+
], SeedingDataTest, "returnsSeededGuests", null);
|
|
295
|
+
__decorate([
|
|
296
|
+
test('seeds with starting phone 1', DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE),
|
|
297
|
+
test('seeds with starting phone 2', DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE_ALT)
|
|
298
|
+
], SeedingDataTest, "setsFirstPersonsNumberToTheStartingPhone", null);
|
|
299
|
+
__decorate([
|
|
300
|
+
test()
|
|
301
|
+
], SeedingDataTest, "canSeedMultipleRolesAtOnce", null);
|
|
302
|
+
__decorate([
|
|
303
|
+
test()
|
|
304
|
+
], SeedingDataTest, "seededPeopleHaveNames", null);
|
|
305
|
+
__decorate([
|
|
306
|
+
test()
|
|
307
|
+
], SeedingDataTest, "peopleAllHaveUniqueNames", null);
|
|
308
|
+
__decorate([
|
|
309
|
+
test()
|
|
310
|
+
], SeedingDataTest, "namesAreOnlyAssignedIfNotYetAssigned", null);
|
|
311
|
+
SeedingDataTest = __decorate([
|
|
312
|
+
fake.login(DEMO_NUMBER_SEED_FIXTURE)
|
|
313
|
+
], SeedingDataTest);
|
|
314
|
+
export 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,139 @@
|
|
|
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 { eventAssertUtil, eventResponseUtil, } from '@sprucelabs/spruce-event-utils';
|
|
17
|
+
import { test, assert } from '@sprucelabs/test';
|
|
18
|
+
import { errorAssert } from '@sprucelabs/test-utils';
|
|
19
|
+
import { login } from '../../index.js';
|
|
20
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
|
21
|
+
import { DEMO_NUMBER_SKILL_FIXTURE } from '../../tests/constants.js';
|
|
22
|
+
let SkillFixtureTest = class SkillFixtureTest extends AbstractSpruceFixtureTest {
|
|
23
|
+
static beforeEach() {
|
|
24
|
+
const _super = Object.create(null, {
|
|
25
|
+
beforeEach: { get: () => super.beforeEach }
|
|
26
|
+
});
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
yield _super.beforeEach.call(this);
|
|
29
|
+
this.fixture = this.Fixture('skill');
|
|
30
|
+
delete process.env.SKILL_ID;
|
|
31
|
+
delete process.env.SKILL_API_KEY;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
static canCreateSkillFixture() {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
assert.isTruthy(this.fixture);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
static canSeedSkill() {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const skill = yield this.fixture.seedDemoSkill({
|
|
42
|
+
name: 'skill1',
|
|
43
|
+
});
|
|
44
|
+
assert.isTruthy(skill);
|
|
45
|
+
assert.isEqual(skill.name, 'skill1');
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
static cleansUpSkillsAndNotCrashWithMultileDestroys() {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const skill = yield this.fixture.seedDemoSkill({
|
|
51
|
+
name: 'skill1',
|
|
52
|
+
});
|
|
53
|
+
yield this.fixture.destroy();
|
|
54
|
+
yield this.fixture.destroy();
|
|
55
|
+
const client = yield this.Fixture('mercury').connectToApi();
|
|
56
|
+
const results = yield client.emit('get-skill::v2020_12_25', {
|
|
57
|
+
target: {
|
|
58
|
+
skillId: skill.id,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
eventAssertUtil.assertErrorFromResponse(results, 'INVALID_TARGET');
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
static cantLoginAsCurrentSkillIfSkillNotConfigured() {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const err = yield assert.doesThrowAsync(() => this.fixture.loginAsCurrentSkill());
|
|
67
|
+
errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
68
|
+
parameters: ['env.SKILL_ID', 'env.SKILL_API_KEY'],
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
static cantLoginAsCurrentSkillIfSkillNotConfiguredWithApiKey() {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
process.env.SKILL_ID = '123';
|
|
75
|
+
const err = yield assert.doesThrowAsync(() => this.fixture.loginAsCurrentSkill());
|
|
76
|
+
errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
77
|
+
parameters: ['env.SKILL_API_KEY'],
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
static canLoginAsCurrentSkill() {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const { skill: demoSkill } = yield this.fixture.loginAsDemoSkill({
|
|
84
|
+
name: 'Demo me!',
|
|
85
|
+
});
|
|
86
|
+
process.env.SKILL_ID = demoSkill.id;
|
|
87
|
+
process.env.SKILL_API_KEY = demoSkill.apiKey;
|
|
88
|
+
const { skill, client } = yield this.fixture.loginAsCurrentSkill();
|
|
89
|
+
assert.isTruthy(skill);
|
|
90
|
+
assert.isTruthy(client);
|
|
91
|
+
assert.isEqual(skill.id, demoSkill.id);
|
|
92
|
+
assert.isEqual(skill.apiKey, demoSkill.apiKey);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
static shouldUnRegisterDemoSkills() {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
const { client } = yield this.fixture.loginAsDemoSkill({
|
|
98
|
+
name: 'Demo me!',
|
|
99
|
+
});
|
|
100
|
+
yield this.fixture.destroy();
|
|
101
|
+
const results = yield client.emit('whoami::v2020_12_25');
|
|
102
|
+
assert.doesThrow(() => eventResponseUtil.getFirstResponseOrThrow(results));
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
static canPassThroughPersonFixture() {
|
|
106
|
+
const personFixture = this.Fixture('person');
|
|
107
|
+
const fixture = this.Fixture('skill', { personFixture });
|
|
108
|
+
//@ts-ignore
|
|
109
|
+
assert.isEqual(fixture.personFixture, personFixture);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
__decorate([
|
|
113
|
+
test()
|
|
114
|
+
], SkillFixtureTest, "canCreateSkillFixture", null);
|
|
115
|
+
__decorate([
|
|
116
|
+
test()
|
|
117
|
+
], SkillFixtureTest, "canSeedSkill", null);
|
|
118
|
+
__decorate([
|
|
119
|
+
test()
|
|
120
|
+
], SkillFixtureTest, "cleansUpSkillsAndNotCrashWithMultileDestroys", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
test()
|
|
123
|
+
], SkillFixtureTest, "cantLoginAsCurrentSkillIfSkillNotConfigured", null);
|
|
124
|
+
__decorate([
|
|
125
|
+
test()
|
|
126
|
+
], SkillFixtureTest, "cantLoginAsCurrentSkillIfSkillNotConfiguredWithApiKey", null);
|
|
127
|
+
__decorate([
|
|
128
|
+
test()
|
|
129
|
+
], SkillFixtureTest, "canLoginAsCurrentSkill", null);
|
|
130
|
+
__decorate([
|
|
131
|
+
test()
|
|
132
|
+
], SkillFixtureTest, "shouldUnRegisterDemoSkills", null);
|
|
133
|
+
__decorate([
|
|
134
|
+
test()
|
|
135
|
+
], SkillFixtureTest, "canPassThroughPersonFixture", null);
|
|
136
|
+
SkillFixtureTest = __decorate([
|
|
137
|
+
login(DEMO_NUMBER_SKILL_FIXTURE)
|
|
138
|
+
], SkillFixtureTest);
|
|
139
|
+
export default SkillFixtureTest;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import AbstractSpruceTest from '@sprucelabs/test';
|
|
2
|
+
declare module '@sprucelabs/data-stores/build/types/stores.types' {
|
|
3
|
+
interface StoreMap {
|
|
4
|
+
good: any;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export default class StoreFixtureTest extends AbstractSpruceTest {
|
|
8
|
+
private static originalDestroy;
|
|
9
|
+
private static originalAfterEach;
|
|
10
|
+
protected static beforeAll(): Promise<void>;
|
|
11
|
+
protected static beforeEach(): Promise<void>;
|
|
12
|
+
protected static canGetFixture(): Promise<void>;
|
|
13
|
+
protected static canGetFunctioningStores(): Promise<void>;
|
|
14
|
+
protected static beforeAllCallsBeforeAllOnDatabaseFixture(): Promise<void>;
|
|
15
|
+
protected static beforeEachCallsDestroyOnDatabaseFixture(): Promise<void>;
|
|
16
|
+
protected static afterEachCallsAfterEachOnDatabaseFixture(): Promise<void>;
|
|
17
|
+
protected static storeLoaderUsesNewInstanceOfDbEachRun(): Promise<void>;
|
|
18
|
+
protected static storeFixtureCallsResetOnStoreFactory(): Promise<void>;
|
|
19
|
+
protected static callsBeforeEachOnCursorFaker(): Promise<void>;
|
|
20
|
+
protected static canGetStore(): Promise<void>;
|
|
21
|
+
private static setStoreDirToOneGoodStore;
|
|
22
|
+
private static FixtureFactory;
|
|
23
|
+
}
|