@sprucelabs/spruce-test-fixtures 62.2.24 → 62.2.26
Sign up to get free protection for your applications and to get access to all the features.
- package/build/esm/index.d.ts +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/tests/fixtures/ViewFixture.d.ts +1 -1
- package/build/esm/tests/routers/TestRouter.d.ts +1 -1
- package/build/esm/tests/routers/TestRouter.js +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/tests/fixtures/ViewFixture.d.ts +1 -1
- package/build/tests/routers/TestRouter.d.ts +1 -1
- package/build/tests/routers/TestRouter.js +1 -1
- package/package.json +19 -19
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -112
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -34
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -26
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -69
- package/build/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
- package/build/__tests__/behavioral/FakingEventResponses.test.js +0 -126
- package/build/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
- package/build/__tests__/behavioral/FixtureFactory.test.js +0 -79
- package/build/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
- package/build/__tests__/behavioral/LocationFixture.test.js +0 -144
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -95
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -35
- package/build/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
- package/build/__tests__/behavioral/MercuryFixture.test.js +0 -187
- package/build/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
- package/build/__tests__/behavioral/OrganizationFixture.test.js +0 -333
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -21
- package/build/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
- package/build/__tests__/behavioral/PersonFixture.test.js +0 -225
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -95
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -67
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -44
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -55
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -137
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -54
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -40
- package/build/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
- package/build/__tests__/behavioral/RoleFixture.test.js +0 -118
- package/build/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
- package/build/__tests__/behavioral/SkillFixture.test.js +0 -118
- package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
- package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -41
- package/build/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
- package/build/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -59
- package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
- package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -34
- package/build/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
- package/build/__tests__/behavioral/databases/DummyStore.js +0 -36
- package/build/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
- package/build/__tests__/behavioral/databases/StoreFixture.test.js +0 -156
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -73
- package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
- package/build/__tests__/behavioral/faking/FakeDecorator.test.js +0 -421
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -23
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -27
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -93
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -56
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -141
- package/build/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
- package/build/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -35
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -42
- package/build/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
- package/build/__tests__/behavioral/faking/FakingLocations.test.js +0 -45
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -140
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -174
- package/build/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
- package/build/__tests__/behavioral/faking/UpdatePerson.test.js +0 -32
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -321
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -48
- package/build/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
- package/build/__tests__/behavioral/faking/WhoAmI.test.js +0 -105
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -76
- package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
- package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -272
- package/build/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
- package/build/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -35
- package/build/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
- package/build/__tests__/behavioral/seeding/SeedingData.test.js +0 -271
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -266
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -117
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -55
- package/build/__tests__/behavioral/views/Routing.test.d.ts +0 -36
- package/build/__tests__/behavioral/views/Routing.test.js +0 -177
- package/build/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
- package/build/__tests__/behavioral/views/TestingScope.test.js +0 -197
- package/build/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
- package/build/__tests__/behavioral/views/ViewPlugins.test.js +0 -83
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -55
- package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
- package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -761
- package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
- package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -29
- package/build/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
- package/build/__tests__/support/AbstractFakeDecoratorTest.js +0 -27
- package/build/__tests__/support/EventFaker.d.ts +0 -5
- package/build/__tests__/support/EventFaker.js +0 -36
- package/build/__tests__/support/RandomViewPlugin.d.ts +0 -2
- package/build/__tests__/support/RandomViewPlugin.js +0 -5
- package/build/__tests__/support/RandomViewPlugin2.d.ts +0 -2
- package/build/__tests__/support/RandomViewPlugin2.js +0 -5
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.d.ts +0 -5
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.js +0 -9
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -33
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/src/.spruce/settings.json +0 -6
- package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.d.ts +0 -6
- package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.js +0 -11
- package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.d.ts +0 -6
- package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.js +0 -11
- package/build/__tests__/testDirsAndFiles/skill/build/.spruce/views/views.js +0 -18
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -11
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -19
- package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
- package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -31
- package/build/__tests__/testDirsAndFiles/skill/package.json +0 -5
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/settings.json +0 -6
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.d.ts +0 -7
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.js +0 -17
- package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
- package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -11
- package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
- package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -31
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -128
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -40
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -23
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -80
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +0 -148
- package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
- package/build/esm/__tests__/behavioral/FixtureFactory.test.js +0 -61
- package/build/esm/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
- package/build/esm/__tests__/behavioral/LocationFixture.test.js +0 -173
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -113
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -41
- package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
- package/build/esm/__tests__/behavioral/MercuryFixture.test.js +0 -223
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +0 -389
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -18
- package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
- package/build/esm/__tests__/behavioral/PersonFixture.test.js +0 -232
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -112
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -84
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -55
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -72
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -146
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -66
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -51
- package/build/esm/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
- package/build/esm/__tests__/behavioral/RoleFixture.test.js +0 -143
- package/build/esm/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
- package/build/esm/__tests__/behavioral/SkillFixture.test.js +0 -141
- package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
- package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -53
- package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
- package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -48
- package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -28
- package/build/esm/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
- package/build/esm/__tests__/behavioral/databases/DummyStore.js +0 -43
- package/build/esm/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
- package/build/esm/__tests__/behavioral/databases/StoreFixture.test.js +0 -164
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -89
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +0 -482
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -28
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -32
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -82
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -70
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -165
- package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -43
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -55
- package/build/esm/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
- package/build/esm/__tests__/behavioral/faking/FakingLocations.test.js +0 -55
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -175
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -214
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +0 -38
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -360
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -31
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +0 -142
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -94
- package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
- package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -324
- package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -43
- package/build/esm/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
- package/build/esm/__tests__/behavioral/seeding/SeedingData.test.js +0 -314
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -322
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -138
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -70
- package/build/esm/__tests__/behavioral/views/Routing.test.d.ts +0 -36
- package/build/esm/__tests__/behavioral/views/Routing.test.js +0 -212
- package/build/esm/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
- package/build/esm/__tests__/behavioral/views/TestingScope.test.js +0 -238
- package/build/esm/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
- package/build/esm/__tests__/behavioral/views/ViewPlugins.test.js +0 -103
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -64
- package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
- package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -856
- package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -39
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +0 -34
- package/build/esm/__tests__/support/EventFaker.d.ts +0 -5
- package/build/esm/__tests__/support/EventFaker.js +0 -45
- package/build/esm/__tests__/support/RandomViewPlugin.d.ts +0 -2
- package/build/esm/__tests__/support/RandomViewPlugin.js +0 -2
- package/build/esm/__tests__/support/RandomViewPlugin2.d.ts +0 -2
- package/build/esm/__tests__/support/RandomViewPlugin2.js +0 -2
- package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
- package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -41
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -9
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -28
- package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
- package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -26
- package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
- package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -9
- package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
- package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -26
- /package/build/{__tests__/support → esm/tests}/FakeThemeManager.d.ts +0 -0
- /package/build/esm/{__tests__/support → tests}/FakeThemeManager.js +0 -0
- /package/build/{esm/__tests__/support → tests}/FakeThemeManager.d.ts +0 -0
- /package/build/{__tests__/support → tests}/FakeThemeManager.js +0 -0
@@ -1,389 +0,0 @@
|
|
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 { randomInt } from 'crypto';
|
17
|
-
import { eventAssertUtil } from '@sprucelabs/spruce-event-utils';
|
18
|
-
import { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
|
19
|
-
import { test, assert } from '@sprucelabs/test-utils';
|
20
|
-
import { errorAssert, generateId } from '@sprucelabs/test-utils';
|
21
|
-
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
22
|
-
import { DEMO_NUMBER, DEMO_NUMBER_HIRING, DEMO_NUMBER_INSTALLING_SKILLS, DEMO_NUMBER_ORGANIZATION_FIXTURE, } from '../../tests/constants.js';
|
23
|
-
import fake from '../../tests/decorators/fake.js';
|
24
|
-
let OrganizationFixtureTest = class OrganizationFixtureTest extends AbstractSpruceFixtureTest {
|
25
|
-
static canCreateOrganizationFixture() {
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
27
|
-
assert.isTruthy(this.organizations);
|
28
|
-
});
|
29
|
-
}
|
30
|
-
static canSeedOrg() {
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
32
|
-
const org = yield this.organizations.seedDemoOrganization({
|
33
|
-
name: 'my org',
|
34
|
-
});
|
35
|
-
assert.isTruthy(org);
|
36
|
-
assert.isEqual(org.name, 'my org');
|
37
|
-
});
|
38
|
-
}
|
39
|
-
static orgFixtureDestroysOrgs() {
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
41
|
-
const org = yield this.Org();
|
42
|
-
yield this.organizations.destroy();
|
43
|
-
yield this.organizations.destroy();
|
44
|
-
const client = yield this.mercury.connectToApi();
|
45
|
-
const results = yield client.emit('get-organization::v2020_12_25', {
|
46
|
-
target: {
|
47
|
-
organizationId: org.id,
|
48
|
-
},
|
49
|
-
});
|
50
|
-
eventAssertUtil.assertErrorFromResponse(results, 'INVALID_TARGET');
|
51
|
-
});
|
52
|
-
}
|
53
|
-
static isNotPartOfOrgtoStart() {
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
55
|
-
const org = yield this.Org();
|
56
|
-
const { person } = yield this.people.loginAsDemoPerson(DEMO_NUMBER_HIRING);
|
57
|
-
const isHired = yield this.organizations.isPartOfOrg({
|
58
|
-
personId: person.id,
|
59
|
-
organizationId: org.id,
|
60
|
-
phone: DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
61
|
-
});
|
62
|
-
assert.isFalse(isHired);
|
63
|
-
});
|
64
|
-
}
|
65
|
-
static updatingBadOrgTHrows() {
|
66
|
-
return __awaiter(this, void 0, void 0, function* () {
|
67
|
-
yield assert.doesThrowAsync(() => this.organizations.updateOrganization('aoeu', {}));
|
68
|
-
});
|
69
|
-
}
|
70
|
-
static canUpdateOrg() {
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
72
|
-
const org = yield this.organizations.seedDemoOrganization({
|
73
|
-
name: 'my org',
|
74
|
-
phone: DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
75
|
-
});
|
76
|
-
const name = generateId();
|
77
|
-
yield this.organizations.updateOrganization(org.id, {
|
78
|
-
name,
|
79
|
-
phone: DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
80
|
-
});
|
81
|
-
const updated = yield this.organizations.getOrganizationById(org.id);
|
82
|
-
assert.isEqual(updated.name, name);
|
83
|
-
});
|
84
|
-
}
|
85
|
-
static canUpdateOrgAddress() {
|
86
|
-
return __awaiter(this, void 0, void 0, function* () {
|
87
|
-
const org = yield this.organizations.seedDemoOrganization({
|
88
|
-
name: 'my org',
|
89
|
-
phone: DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
90
|
-
});
|
91
|
-
let address = {
|
92
|
-
city: generateId(),
|
93
|
-
country: generateId(),
|
94
|
-
province: generateId(),
|
95
|
-
street1: generateId(),
|
96
|
-
zip: randomInt(44444).toString(),
|
97
|
-
};
|
98
|
-
yield this.organizations.updateOrganization(org.id, {
|
99
|
-
address,
|
100
|
-
phone: DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
101
|
-
});
|
102
|
-
const updated = yield this.organizations.getOrganizationById(org.id);
|
103
|
-
assert.isEqualDeep(updated.address, address);
|
104
|
-
});
|
105
|
-
}
|
106
|
-
static canMakeOrgPublicAndPrivate() {
|
107
|
-
return __awaiter(this, void 0, void 0, function* () {
|
108
|
-
const org = yield this.organizations.seedDemoOrganization({
|
109
|
-
name: 'my org',
|
110
|
-
phone: DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
111
|
-
});
|
112
|
-
yield this.assertOrgIsPublicValue(org.id, false);
|
113
|
-
yield this.setAndAssertOrgIsPublic(org.id, true);
|
114
|
-
yield this.setAndAssertOrgIsPublic(org.id, false);
|
115
|
-
});
|
116
|
-
}
|
117
|
-
static canAddPersonToOrg(base) {
|
118
|
-
return __awaiter(this, void 0, void 0, function* () {
|
119
|
-
const { person, org } = yield this.seedOrgAndHirePerson(base);
|
120
|
-
const isHired = yield this.isPersonPartOfOrg(person.id, org.id);
|
121
|
-
assert.isTrue(isHired);
|
122
|
-
const roles = yield this.roles.listRoles({
|
123
|
-
organizationId: org.id,
|
124
|
-
personId: person.id,
|
125
|
-
phone: DEMO_NUMBER_HIRING,
|
126
|
-
});
|
127
|
-
assert.isLength(roles, 1);
|
128
|
-
assert.isEqual(roles[0].base, base);
|
129
|
-
});
|
130
|
-
}
|
131
|
-
static isPersonPartOfOrg(personId, orgId) {
|
132
|
-
return __awaiter(this, void 0, void 0, function* () {
|
133
|
-
return yield this.organizations.isPartOfOrg({
|
134
|
-
personId,
|
135
|
-
organizationId: orgId,
|
136
|
-
});
|
137
|
-
});
|
138
|
-
}
|
139
|
-
static isNotInstalledByDefault() {
|
140
|
-
return __awaiter(this, void 0, void 0, function* () {
|
141
|
-
const { skill, org } = yield this.seedOrgAndSkill();
|
142
|
-
const isInstalled = yield this.organizations.isSkillInstalled(skill.id, org.id);
|
143
|
-
assert.isFalse(isInstalled);
|
144
|
-
});
|
145
|
-
}
|
146
|
-
static showsAsInstalled() {
|
147
|
-
return __awaiter(this, void 0, void 0, function* () {
|
148
|
-
const { skill, org } = yield this.seedOrgAndSkill();
|
149
|
-
yield this.organizations.installSkill(skill.id, org.id);
|
150
|
-
yield this.assertSkillIsInstalled(skill.id, org.id);
|
151
|
-
});
|
152
|
-
}
|
153
|
-
static cantInstallWithBadSkill() {
|
154
|
-
return __awaiter(this, void 0, void 0, function* () {
|
155
|
-
const { org } = yield this.seedOrgAndSkill();
|
156
|
-
const err = yield assert.doesThrowAsync(() => this.organizations.installSkillsByNamespace({
|
157
|
-
organizationId: org.id,
|
158
|
-
namespaces: ['aoeuaoeu'],
|
159
|
-
}));
|
160
|
-
errorAssert.assertError(err, 'INVALID_NAMESPACES', {
|
161
|
-
namespaces: ['aoeuaoeu'],
|
162
|
-
});
|
163
|
-
});
|
164
|
-
}
|
165
|
-
static canInstallWithSlug() {
|
166
|
-
return __awaiter(this, void 0, void 0, function* () {
|
167
|
-
const { skill, org } = yield this.seedOrgAndSkill();
|
168
|
-
yield this.organizations.installSkillsByNamespace({
|
169
|
-
organizationId: org.id,
|
170
|
-
namespaces: [skill.slug],
|
171
|
-
});
|
172
|
-
yield this.assertSkillIsInstalled(skill.id, org.id);
|
173
|
-
});
|
174
|
-
}
|
175
|
-
static canInstallSkillFromAnotherPerson() {
|
176
|
-
return __awaiter(this, void 0, void 0, function* () {
|
177
|
-
const { skill, org } = yield this.seedOrgAndSkill();
|
178
|
-
const skill2 = yield this.skills.seedDemoSkill({
|
179
|
-
name: 'testing testy 2',
|
180
|
-
creatorPhone: DEMO_NUMBER_INSTALLING_SKILLS,
|
181
|
-
});
|
182
|
-
yield this.organizations.installSkillsByNamespace({
|
183
|
-
organizationId: org.id,
|
184
|
-
namespaces: [skill.slug, skill2.slug],
|
185
|
-
});
|
186
|
-
yield this.assertSkillIsInstalled(skill.id, org.id);
|
187
|
-
yield this.assertSkillIsInstalled(skill2.id, org.id);
|
188
|
-
});
|
189
|
-
}
|
190
|
-
static canDeleteAllExistingOrgs() {
|
191
|
-
return __awaiter(this, void 0, void 0, function* () {
|
192
|
-
const firstFixture = this.Fixture('organization');
|
193
|
-
yield firstFixture.seedDemoOrganization({
|
194
|
-
name: 'org 1',
|
195
|
-
phone: DEMO_NUMBER_INSTALLING_SKILLS,
|
196
|
-
});
|
197
|
-
yield firstFixture.seedDemoOrganization({
|
198
|
-
name: 'org 2',
|
199
|
-
phone: DEMO_NUMBER_INSTALLING_SKILLS,
|
200
|
-
});
|
201
|
-
const secondFixture = this.Fixture('organization');
|
202
|
-
yield secondFixture.deleteAllOrganizations(DEMO_NUMBER_INSTALLING_SKILLS);
|
203
|
-
const { client } = yield this.Fixture('person').loginAsDemoPerson(DEMO_NUMBER_INSTALLING_SKILLS);
|
204
|
-
const results = yield client.emit('list-organizations::v2020_12_25', {
|
205
|
-
payload: {
|
206
|
-
shouldOnlyShowMine: true,
|
207
|
-
},
|
208
|
-
});
|
209
|
-
const { organizations } = eventResponseUtil.getFirstResponseOrThrow(results);
|
210
|
-
assert.isLength(organizations, 0);
|
211
|
-
//@ts-ignore
|
212
|
-
firstFixture.destroy = () => { };
|
213
|
-
//@ts-ignore
|
214
|
-
secondFixture.destroy = () => { };
|
215
|
-
});
|
216
|
-
}
|
217
|
-
static passesThroughAllFieldsToRequest() {
|
218
|
-
return __awaiter(this, void 0, void 0, function* () {
|
219
|
-
yield assert.doesThrowAsync(() => this.Fixture('organization').seedDemoOrganization({
|
220
|
-
//@ts-ignore
|
221
|
-
waka: 'tacas',
|
222
|
-
}));
|
223
|
-
});
|
224
|
-
}
|
225
|
-
static canPassPersonFixture() {
|
226
|
-
const personFixture = this.Fixture('person');
|
227
|
-
const orgFixture = this.Fixture('organization', {
|
228
|
-
people: personFixture,
|
229
|
-
});
|
230
|
-
//@ts-ignore
|
231
|
-
assert.isEqual(orgFixture.people, personFixture);
|
232
|
-
}
|
233
|
-
static canSeedOrgWithNoOptions() {
|
234
|
-
return __awaiter(this, void 0, void 0, function* () {
|
235
|
-
const org = yield this.Fixture('organization').seedDemoOrganization();
|
236
|
-
assert.isTruthy(org);
|
237
|
-
});
|
238
|
-
}
|
239
|
-
static removePersonThrowsWithBadIds() {
|
240
|
-
return __awaiter(this, void 0, void 0, function* () {
|
241
|
-
yield assert.doesThrowAsync(() => this.organizations.removePerson({
|
242
|
-
phone: DEMO_NUMBER_HIRING,
|
243
|
-
roleBase: 'guest',
|
244
|
-
organizationId: 'aoeu',
|
245
|
-
personId: 'aoeu',
|
246
|
-
}));
|
247
|
-
});
|
248
|
-
}
|
249
|
-
static canRemovePersonFromOrg(roleBase) {
|
250
|
-
return __awaiter(this, void 0, void 0, function* () {
|
251
|
-
const { person, org } = yield this.seedOrgAndHirePerson(roleBase);
|
252
|
-
yield this.organizations.removePerson({
|
253
|
-
phone: DEMO_NUMBER_HIRING,
|
254
|
-
roleBase,
|
255
|
-
organizationId: org.id,
|
256
|
-
personId: person.id,
|
257
|
-
});
|
258
|
-
const isHired = yield this.isPersonPartOfOrg(person.id, org.id);
|
259
|
-
assert.isFalse(isHired);
|
260
|
-
});
|
261
|
-
}
|
262
|
-
static Org() {
|
263
|
-
return __awaiter(this, void 0, void 0, function* () {
|
264
|
-
return yield this.organizations.seedDemoOrganization({
|
265
|
-
name: 'my org',
|
266
|
-
phone: DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
267
|
-
});
|
268
|
-
});
|
269
|
-
}
|
270
|
-
static seedOrgAndHirePerson(base) {
|
271
|
-
return __awaiter(this, void 0, void 0, function* () {
|
272
|
-
const org = yield this.organizations.seedDemoOrganization({
|
273
|
-
name: 'my org',
|
274
|
-
phone: DEMO_NUMBER_HIRING,
|
275
|
-
});
|
276
|
-
const { person } = yield this.people.loginAsDemoPerson(DEMO_NUMBER);
|
277
|
-
yield this.organizations.addPerson({
|
278
|
-
personId: person.id,
|
279
|
-
organizationId: org.id,
|
280
|
-
roleBase: base,
|
281
|
-
phone: DEMO_NUMBER_HIRING,
|
282
|
-
});
|
283
|
-
return { person, org };
|
284
|
-
});
|
285
|
-
}
|
286
|
-
static assertSkillIsInstalled(skillId, orgId) {
|
287
|
-
return __awaiter(this, void 0, void 0, function* () {
|
288
|
-
const isInstalled = yield this.organizations.isSkillInstalled(skillId, orgId);
|
289
|
-
assert.isTrue(isInstalled);
|
290
|
-
});
|
291
|
-
}
|
292
|
-
static seedOrgAndSkill() {
|
293
|
-
return __awaiter(this, void 0, void 0, function* () {
|
294
|
-
const skill = yield this.skills.seedDemoSkill({
|
295
|
-
name: 'testing testy',
|
296
|
-
});
|
297
|
-
const org = yield this.organizations.seedDemoOrganization({
|
298
|
-
name: 'my org',
|
299
|
-
});
|
300
|
-
return { skill, org };
|
301
|
-
});
|
302
|
-
}
|
303
|
-
static assertOrgIsPublicValue(orgId, expected) {
|
304
|
-
return __awaiter(this, void 0, void 0, function* () {
|
305
|
-
const org = yield this.organizations.getOrganizationById(orgId);
|
306
|
-
if (expected) {
|
307
|
-
assert.isTrue(org.isPublic);
|
308
|
-
}
|
309
|
-
else {
|
310
|
-
assert.isFalsy(org.isPublic);
|
311
|
-
}
|
312
|
-
});
|
313
|
-
}
|
314
|
-
static setAndAssertOrgIsPublic(orgId, isPublic) {
|
315
|
-
return __awaiter(this, void 0, void 0, function* () {
|
316
|
-
yield this.organizations.updateOrganization(orgId, {
|
317
|
-
isPublic,
|
318
|
-
phone: DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
319
|
-
});
|
320
|
-
yield this.assertOrgIsPublicValue(orgId, isPublic);
|
321
|
-
});
|
322
|
-
}
|
323
|
-
};
|
324
|
-
__decorate([
|
325
|
-
test()
|
326
|
-
], OrganizationFixtureTest, "canCreateOrganizationFixture", null);
|
327
|
-
__decorate([
|
328
|
-
test()
|
329
|
-
], OrganizationFixtureTest, "canSeedOrg", null);
|
330
|
-
__decorate([
|
331
|
-
test()
|
332
|
-
], OrganizationFixtureTest, "orgFixtureDestroysOrgs", null);
|
333
|
-
__decorate([
|
334
|
-
test()
|
335
|
-
], OrganizationFixtureTest, "isNotPartOfOrgtoStart", null);
|
336
|
-
__decorate([
|
337
|
-
test()
|
338
|
-
], OrganizationFixtureTest, "updatingBadOrgTHrows", null);
|
339
|
-
__decorate([
|
340
|
-
test()
|
341
|
-
], OrganizationFixtureTest, "canUpdateOrg", null);
|
342
|
-
__decorate([
|
343
|
-
test()
|
344
|
-
], OrganizationFixtureTest, "canUpdateOrgAddress", null);
|
345
|
-
__decorate([
|
346
|
-
test()
|
347
|
-
], OrganizationFixtureTest, "canMakeOrgPublicAndPrivate", null);
|
348
|
-
__decorate([
|
349
|
-
test('can add as guest', 'guest'),
|
350
|
-
test('can add as teammate', 'teammate')
|
351
|
-
], OrganizationFixtureTest, "canAddPersonToOrg", null);
|
352
|
-
__decorate([
|
353
|
-
test()
|
354
|
-
], OrganizationFixtureTest, "isNotInstalledByDefault", null);
|
355
|
-
__decorate([
|
356
|
-
test()
|
357
|
-
], OrganizationFixtureTest, "showsAsInstalled", null);
|
358
|
-
__decorate([
|
359
|
-
test()
|
360
|
-
], OrganizationFixtureTest, "cantInstallWithBadSkill", null);
|
361
|
-
__decorate([
|
362
|
-
test()
|
363
|
-
], OrganizationFixtureTest, "canInstallWithSlug", null);
|
364
|
-
__decorate([
|
365
|
-
test()
|
366
|
-
], OrganizationFixtureTest, "canInstallSkillFromAnotherPerson", null);
|
367
|
-
__decorate([
|
368
|
-
test()
|
369
|
-
], OrganizationFixtureTest, "canDeleteAllExistingOrgs", null);
|
370
|
-
__decorate([
|
371
|
-
test()
|
372
|
-
], OrganizationFixtureTest, "passesThroughAllFieldsToRequest", null);
|
373
|
-
__decorate([
|
374
|
-
test()
|
375
|
-
], OrganizationFixtureTest, "canPassPersonFixture", null);
|
376
|
-
__decorate([
|
377
|
-
test()
|
378
|
-
], OrganizationFixtureTest, "canSeedOrgWithNoOptions", null);
|
379
|
-
__decorate([
|
380
|
-
test()
|
381
|
-
], OrganizationFixtureTest, "removePersonThrowsWithBadIds", null);
|
382
|
-
__decorate([
|
383
|
-
test('can remove guest', 'guest'),
|
384
|
-
test('can remove teammate', 'teammate')
|
385
|
-
], OrganizationFixtureTest, "canRemovePersonFromOrg", null);
|
386
|
-
OrganizationFixtureTest = __decorate([
|
387
|
-
fake.login()
|
388
|
-
], OrganizationFixtureTest);
|
389
|
-
export default OrganizationFixtureTest;
|
@@ -1,18 +0,0 @@
|
|
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
|
-
import { testLog } from '@sprucelabs/spruce-skill-utils';
|
8
|
-
import { assert, test } from '@sprucelabs/test-utils';
|
9
|
-
import { AbstractSpruceFixtureTest } from '../../index.js';
|
10
|
-
export default class PatchingConsoleErrorToErrorStreamTest extends AbstractSpruceFixtureTest {
|
11
|
-
static patchesConsoleError() {
|
12
|
-
assert.isEqual(console.error, testLog.error);
|
13
|
-
console.error('Should write to console');
|
14
|
-
}
|
15
|
-
}
|
16
|
-
__decorate([
|
17
|
-
test()
|
18
|
-
], PatchingConsoleErrorToErrorStreamTest, "patchesConsoleError", null);
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import AbstractSpruceTest from '@sprucelabs/test-utils';
|
2
|
-
export default class PersonFixtureTest extends AbstractSpruceTest {
|
3
|
-
private static fixture;
|
4
|
-
protected static beforeEach(): Promise<void>;
|
5
|
-
private static Fixture;
|
6
|
-
protected static canCreatePersonFixture(): Promise<void>;
|
7
|
-
protected static throwsWhenNoDummyNumberSetInEnv(): Promise<void>;
|
8
|
-
protected static canLoginAsPerson(): Promise<void>;
|
9
|
-
protected static canLoginAsPersonWithEnv(): Promise<void>;
|
10
|
-
protected static canLoginWith2Numbers(): Promise<void>;
|
11
|
-
protected static loggingInWithoutNumberReturnsSameClientEveryTime(): Promise<void>;
|
12
|
-
protected static staysLoggedInAsThisPerson(): Promise<void>;
|
13
|
-
protected static canOverrideDefaultClient(): Promise<void>;
|
14
|
-
protected static honorsDefaultClientEvenWithoutDemoPhoneSet(): Promise<void>;
|
15
|
-
protected static listPeoplePassesThroughVars(expectedTarget: any, expectedPayload?: {
|
16
|
-
personIds: string[];
|
17
|
-
roleBases: string[];
|
18
|
-
roleIds: string[];
|
19
|
-
shouldIncludePrivateFields: boolean;
|
20
|
-
}): Promise<void>;
|
21
|
-
protected static listPeopleReturnsPeople(expectedPeople: any): Promise<void>;
|
22
|
-
}
|
@@ -1,232 +0,0 @@
|
|
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 { MercuryClientFactory, MercuryTestClient, } from '@sprucelabs/mercury-client';
|
17
|
-
import { formatPhoneNumber } from '@sprucelabs/schema';
|
18
|
-
import AbstractSpruceTest, { test, assert } from '@sprucelabs/test-utils';
|
19
|
-
import { errorAssert } from '@sprucelabs/test-utils';
|
20
|
-
import dotenv from 'dotenv';
|
21
|
-
import { MercuryFixture } from '../../index.js';
|
22
|
-
import { DEMO_NUMBER_SECOND_LOGIN, DEMO_NUMBER, DEMO_NUMBER_PERSON_FIXTURE, } from '../../tests/constants.js';
|
23
|
-
import FixtureFactory from '../../tests/fixtures/FixtureFactory.js';
|
24
|
-
dotenv.config();
|
25
|
-
MercuryFixture.setShouldRequireLocalListeners(false);
|
26
|
-
export default class PersonFixtureTest extends AbstractSpruceTest {
|
27
|
-
static beforeEach() {
|
28
|
-
const _super = Object.create(null, {
|
29
|
-
beforeEach: { get: () => super.beforeEach }
|
30
|
-
});
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
32
|
-
yield _super.beforeEach.call(this);
|
33
|
-
this.fixture = this.Fixture();
|
34
|
-
MercuryTestClient.reset();
|
35
|
-
});
|
36
|
-
}
|
37
|
-
static Fixture() {
|
38
|
-
return new FixtureFactory({ cwd: this.cwd }).Fixture('person');
|
39
|
-
}
|
40
|
-
static canCreatePersonFixture() {
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
42
|
-
assert.isTruthy(this.fixture);
|
43
|
-
});
|
44
|
-
}
|
45
|
-
static throwsWhenNoDummyNumberSetInEnv() {
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
47
|
-
delete process.env.DEMO_NUMBER;
|
48
|
-
const err = yield assert.doesThrowAsync(() => this.fixture.loginAsDemoPerson());
|
49
|
-
errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
50
|
-
parameters: ['env.DEMO_NUMBER'],
|
51
|
-
});
|
52
|
-
});
|
53
|
-
}
|
54
|
-
static canLoginAsPerson() {
|
55
|
-
return __awaiter(this, void 0, void 0, function* () {
|
56
|
-
const { person, client } = yield this.fixture.loginAsDemoPerson(DEMO_NUMBER);
|
57
|
-
assert.isTruthy(person);
|
58
|
-
assert.isTruthy(client);
|
59
|
-
yield client.disconnect();
|
60
|
-
});
|
61
|
-
}
|
62
|
-
static canLoginAsPersonWithEnv() {
|
63
|
-
return __awaiter(this, void 0, void 0, function* () {
|
64
|
-
process.env.DEMO_NUMBER = DEMO_NUMBER;
|
65
|
-
const { person, client } = yield this.fixture.loginAsDemoPerson();
|
66
|
-
assert.isTruthy(person);
|
67
|
-
assert.isEqual(person.phone, formatPhoneNumber(DEMO_NUMBER));
|
68
|
-
assert.isTruthy(client);
|
69
|
-
yield client.disconnect();
|
70
|
-
});
|
71
|
-
}
|
72
|
-
static canLoginWith2Numbers() {
|
73
|
-
return __awaiter(this, void 0, void 0, function* () {
|
74
|
-
const { person } = yield this.fixture.loginAsDemoPerson();
|
75
|
-
const { person: person2 } = yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_SECOND_LOGIN);
|
76
|
-
assert.isEqual(person.phone, formatPhoneNumber(DEMO_NUMBER));
|
77
|
-
assert.isEqual(person2.phone, formatPhoneNumber(DEMO_NUMBER_SECOND_LOGIN));
|
78
|
-
});
|
79
|
-
}
|
80
|
-
static loggingInWithoutNumberReturnsSameClientEveryTime() {
|
81
|
-
return __awaiter(this, void 0, void 0, function* () {
|
82
|
-
const { client } = yield this.fixture.loginAsDemoPerson();
|
83
|
-
const { client: client1 } = yield this.fixture.loginAsDemoPerson();
|
84
|
-
assert.isEqual(client, client1);
|
85
|
-
});
|
86
|
-
}
|
87
|
-
static staysLoggedInAsThisPerson() {
|
88
|
-
return __awaiter(this, void 0, void 0, function* () {
|
89
|
-
MercuryClientFactory.setIsTestMode(true);
|
90
|
-
const { client } = yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_SECOND_LOGIN);
|
91
|
-
//@ts-ignore
|
92
|
-
client.emit = () => {
|
93
|
-
assert.fail('should reuse client');
|
94
|
-
};
|
95
|
-
const { client: client1 } = yield this.fixture.loginAsDemoPerson();
|
96
|
-
assert.isEqual(client, client1);
|
97
|
-
});
|
98
|
-
}
|
99
|
-
static canOverrideDefaultClient() {
|
100
|
-
return __awaiter(this, void 0, void 0, function* () {
|
101
|
-
const { client } = yield this.fixture.loginAsDemoPerson();
|
102
|
-
MercuryFixture.setDefaultClient(client);
|
103
|
-
const { client: client2 } = yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_SECOND_LOGIN);
|
104
|
-
assert.isNotEqual(client, client2);
|
105
|
-
});
|
106
|
-
}
|
107
|
-
static honorsDefaultClientEvenWithoutDemoPhoneSet() {
|
108
|
-
return __awaiter(this, void 0, void 0, function* () {
|
109
|
-
const phone = process.env.DEMO_NUMBER;
|
110
|
-
delete process.env.DEMO_NUMBER;
|
111
|
-
const { client } = yield this.Fixture().loginAsDemoPerson(phone);
|
112
|
-
MercuryFixture.setDefaultClient(client);
|
113
|
-
const { client: client2 } = yield this.Fixture().loginAsDemoPerson();
|
114
|
-
assert.isEqual(client, client2);
|
115
|
-
});
|
116
|
-
}
|
117
|
-
static listPeoplePassesThroughVars(expectedTarget_1) {
|
118
|
-
return __awaiter(this, arguments, void 0, function* (expectedTarget, expectedPayload = {
|
119
|
-
personIds: ['1234'],
|
120
|
-
roleBases: ['1234'],
|
121
|
-
roleIds: ['1234'],
|
122
|
-
shouldIncludePrivateFields: true,
|
123
|
-
}) {
|
124
|
-
MercuryClientFactory.setIsTestMode(true);
|
125
|
-
assert.isFunction(this.fixture.listPeople);
|
126
|
-
const { client } = yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_PERSON_FIXTURE);
|
127
|
-
let wasHit = true;
|
128
|
-
let passedTarget;
|
129
|
-
let passedPayload;
|
130
|
-
yield client.on('list-people::v2020_12_25', ({ target, payload }) => {
|
131
|
-
passedTarget = target;
|
132
|
-
passedPayload = payload;
|
133
|
-
wasHit = true;
|
134
|
-
return {
|
135
|
-
people: [
|
136
|
-
{
|
137
|
-
id: '1234',
|
138
|
-
casualName: 'tay',
|
139
|
-
dateCreated: 0,
|
140
|
-
},
|
141
|
-
],
|
142
|
-
};
|
143
|
-
});
|
144
|
-
yield this.fixture.listPeople(Object.assign(Object.assign({}, expectedTarget), expectedPayload));
|
145
|
-
assert.isTrue(wasHit);
|
146
|
-
assert.isEqualDeep(passedTarget, expectedTarget);
|
147
|
-
assert.isEqualDeep(passedPayload, expectedPayload);
|
148
|
-
});
|
149
|
-
}
|
150
|
-
static listPeopleReturnsPeople(expectedPeople) {
|
151
|
-
return __awaiter(this, void 0, void 0, function* () {
|
152
|
-
MercuryClientFactory.setIsTestMode(true);
|
153
|
-
const { client } = yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_PERSON_FIXTURE);
|
154
|
-
yield client.on('list-people::v2020_12_25', () => {
|
155
|
-
return {
|
156
|
-
people: expectedPeople,
|
157
|
-
};
|
158
|
-
});
|
159
|
-
const people = yield this.fixture.listPeople({
|
160
|
-
organizationId: '1234',
|
161
|
-
});
|
162
|
-
assert.isEqualDeep(people, expectedPeople);
|
163
|
-
});
|
164
|
-
}
|
165
|
-
}
|
166
|
-
__decorate([
|
167
|
-
test()
|
168
|
-
], PersonFixtureTest, "canCreatePersonFixture", null);
|
169
|
-
__decorate([
|
170
|
-
test()
|
171
|
-
], PersonFixtureTest, "throwsWhenNoDummyNumberSetInEnv", null);
|
172
|
-
__decorate([
|
173
|
-
test()
|
174
|
-
], PersonFixtureTest, "canLoginAsPerson", null);
|
175
|
-
__decorate([
|
176
|
-
test()
|
177
|
-
], PersonFixtureTest, "canLoginAsPersonWithEnv", null);
|
178
|
-
__decorate([
|
179
|
-
test()
|
180
|
-
], PersonFixtureTest, "canLoginWith2Numbers", null);
|
181
|
-
__decorate([
|
182
|
-
test()
|
183
|
-
], PersonFixtureTest, "loggingInWithoutNumberReturnsSameClientEveryTime", null);
|
184
|
-
__decorate([
|
185
|
-
test()
|
186
|
-
], PersonFixtureTest, "staysLoggedInAsThisPerson", null);
|
187
|
-
__decorate([
|
188
|
-
test()
|
189
|
-
], PersonFixtureTest, "canOverrideDefaultClient", null);
|
190
|
-
__decorate([
|
191
|
-
test()
|
192
|
-
], PersonFixtureTest, "honorsDefaultClientEvenWithoutDemoPhoneSet", null);
|
193
|
-
__decorate([
|
194
|
-
test('list people passes target', {
|
195
|
-
organizationId: '1234',
|
196
|
-
locationId: '1234',
|
197
|
-
}),
|
198
|
-
test('list people passes target 2', {
|
199
|
-
organizationId: '5234',
|
200
|
-
locationId: '2666',
|
201
|
-
}),
|
202
|
-
test('list people passes payload 1', {
|
203
|
-
organizationId: '5234',
|
204
|
-
locationId: '2666',
|
205
|
-
}, {
|
206
|
-
personIds: ['56236'],
|
207
|
-
roleBases: ['23452346'],
|
208
|
-
roleIds: ['7567'],
|
209
|
-
shouldIncludePrivateFields: false,
|
210
|
-
})
|
211
|
-
], PersonFixtureTest, "listPeoplePassesThroughVars", null);
|
212
|
-
__decorate([
|
213
|
-
test('returns people 1', [
|
214
|
-
{
|
215
|
-
id: '1234',
|
216
|
-
casualName: 'tay',
|
217
|
-
dateCreated: 0,
|
218
|
-
},
|
219
|
-
]),
|
220
|
-
test('returns people 2', [
|
221
|
-
{
|
222
|
-
id: '234234',
|
223
|
-
casualName: 'tsaoteuh',
|
224
|
-
dateCreated: 230,
|
225
|
-
},
|
226
|
-
{
|
227
|
-
id: '1234',
|
228
|
-
casualName: 'tay',
|
229
|
-
dateCreated: 0,
|
230
|
-
},
|
231
|
-
])
|
232
|
-
], PersonFixtureTest, "listPeopleReturnsPeople", null);
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { AbstractSpruceFixtureTest } from '../..';
|
2
|
-
export default class PhoneNumberIncrementorTest extends AbstractSpruceFixtureTest {
|
3
|
-
protected static canCreatePhoneNumberIncrementor(): Promise<void>;
|
4
|
-
protected static throwsWithMissingOptions(options: any, parameters: string[]): Promise<void>;
|
5
|
-
protected static throwsWithBadNumber(phone: string): Promise<void>;
|
6
|
-
protected static generatesExpectedNumberOfNumbers(total: number): Promise<void>;
|
7
|
-
protected static handlesFormattedNumber(): Promise<void>;
|
8
|
-
protected static generatesExpectedNumbers(expected: string[]): Promise<void>;
|
9
|
-
protected static generateNumbersFromDifferentStartNumber(): Promise<void>;
|
10
|
-
private static generate;
|
11
|
-
}
|