@sprucelabs/spruce-test-fixtures 62.2.23 → 62.2.25
Sign up to get free protection for your applications and to get access to all the features.
- 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/FakeThemeManager.d.ts +0 -8
- package/build/__tests__/support/FakeThemeManager.js +0 -40
- 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/FakeThemeManager.d.ts +0 -8
- package/build/esm/__tests__/support/FakeThemeManager.js +0 -37
- 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
@@ -1,333 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
const crypto_1 = require("crypto");
|
13
|
-
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
14
|
-
const spruce_event_utils_2 = require("@sprucelabs/spruce-event-utils");
|
15
|
-
const test_utils_1 = require("@sprucelabs/test-utils");
|
16
|
-
const test_utils_2 = require("@sprucelabs/test-utils");
|
17
|
-
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
18
|
-
const constants_1 = require("../../tests/constants");
|
19
|
-
const fake_1 = __importDefault(require("../../tests/decorators/fake"));
|
20
|
-
let OrganizationFixtureTest = class OrganizationFixtureTest extends AbstractSpruceFixtureTest_1.default {
|
21
|
-
static async canCreateOrganizationFixture() {
|
22
|
-
test_utils_1.assert.isTruthy(this.organizations);
|
23
|
-
}
|
24
|
-
static async canSeedOrg() {
|
25
|
-
const org = await this.organizations.seedDemoOrganization({
|
26
|
-
name: 'my org',
|
27
|
-
});
|
28
|
-
test_utils_1.assert.isTruthy(org);
|
29
|
-
test_utils_1.assert.isEqual(org.name, 'my org');
|
30
|
-
}
|
31
|
-
static async orgFixtureDestroysOrgs() {
|
32
|
-
const org = await this.Org();
|
33
|
-
await this.organizations.destroy();
|
34
|
-
await this.organizations.destroy();
|
35
|
-
const client = await this.mercury.connectToApi();
|
36
|
-
const results = await client.emit('get-organization::v2020_12_25', {
|
37
|
-
target: {
|
38
|
-
organizationId: org.id,
|
39
|
-
},
|
40
|
-
});
|
41
|
-
spruce_event_utils_1.eventAssertUtil.assertErrorFromResponse(results, 'INVALID_TARGET');
|
42
|
-
}
|
43
|
-
static async isNotPartOfOrgtoStart() {
|
44
|
-
const org = await this.Org();
|
45
|
-
const { person } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER_HIRING);
|
46
|
-
const isHired = await this.organizations.isPartOfOrg({
|
47
|
-
personId: person.id,
|
48
|
-
organizationId: org.id,
|
49
|
-
phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
50
|
-
});
|
51
|
-
test_utils_1.assert.isFalse(isHired);
|
52
|
-
}
|
53
|
-
static async updatingBadOrgTHrows() {
|
54
|
-
await test_utils_1.assert.doesThrowAsync(() => this.organizations.updateOrganization('aoeu', {}));
|
55
|
-
}
|
56
|
-
static async canUpdateOrg() {
|
57
|
-
const org = await this.organizations.seedDemoOrganization({
|
58
|
-
name: 'my org',
|
59
|
-
phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
60
|
-
});
|
61
|
-
const name = (0, test_utils_2.generateId)();
|
62
|
-
await this.organizations.updateOrganization(org.id, {
|
63
|
-
name,
|
64
|
-
phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
65
|
-
});
|
66
|
-
const updated = await this.organizations.getOrganizationById(org.id);
|
67
|
-
test_utils_1.assert.isEqual(updated.name, name);
|
68
|
-
}
|
69
|
-
static async canUpdateOrgAddress() {
|
70
|
-
const org = await this.organizations.seedDemoOrganization({
|
71
|
-
name: 'my org',
|
72
|
-
phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
73
|
-
});
|
74
|
-
let address = {
|
75
|
-
city: (0, test_utils_2.generateId)(),
|
76
|
-
country: (0, test_utils_2.generateId)(),
|
77
|
-
province: (0, test_utils_2.generateId)(),
|
78
|
-
street1: (0, test_utils_2.generateId)(),
|
79
|
-
zip: (0, crypto_1.randomInt)(44444).toString(),
|
80
|
-
};
|
81
|
-
await this.organizations.updateOrganization(org.id, {
|
82
|
-
address,
|
83
|
-
phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
84
|
-
});
|
85
|
-
const updated = await this.organizations.getOrganizationById(org.id);
|
86
|
-
test_utils_1.assert.isEqualDeep(updated.address, address);
|
87
|
-
}
|
88
|
-
static async canMakeOrgPublicAndPrivate() {
|
89
|
-
const org = await this.organizations.seedDemoOrganization({
|
90
|
-
name: 'my org',
|
91
|
-
phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
92
|
-
});
|
93
|
-
await this.assertOrgIsPublicValue(org.id, false);
|
94
|
-
await this.setAndAssertOrgIsPublic(org.id, true);
|
95
|
-
await this.setAndAssertOrgIsPublic(org.id, false);
|
96
|
-
}
|
97
|
-
static async canAddPersonToOrg(base) {
|
98
|
-
const { person, org } = await this.seedOrgAndHirePerson(base);
|
99
|
-
const isHired = await this.isPersonPartOfOrg(person.id, org.id);
|
100
|
-
test_utils_1.assert.isTrue(isHired);
|
101
|
-
const roles = await this.roles.listRoles({
|
102
|
-
organizationId: org.id,
|
103
|
-
personId: person.id,
|
104
|
-
phone: constants_1.DEMO_NUMBER_HIRING,
|
105
|
-
});
|
106
|
-
test_utils_1.assert.isLength(roles, 1);
|
107
|
-
test_utils_1.assert.isEqual(roles[0].base, base);
|
108
|
-
}
|
109
|
-
static async isPersonPartOfOrg(personId, orgId) {
|
110
|
-
return await this.organizations.isPartOfOrg({
|
111
|
-
personId,
|
112
|
-
organizationId: orgId,
|
113
|
-
});
|
114
|
-
}
|
115
|
-
static async isNotInstalledByDefault() {
|
116
|
-
const { skill, org } = await this.seedOrgAndSkill();
|
117
|
-
const isInstalled = await this.organizations.isSkillInstalled(skill.id, org.id);
|
118
|
-
test_utils_1.assert.isFalse(isInstalled);
|
119
|
-
}
|
120
|
-
static async showsAsInstalled() {
|
121
|
-
const { skill, org } = await this.seedOrgAndSkill();
|
122
|
-
await this.organizations.installSkill(skill.id, org.id);
|
123
|
-
await this.assertSkillIsInstalled(skill.id, org.id);
|
124
|
-
}
|
125
|
-
static async cantInstallWithBadSkill() {
|
126
|
-
const { org } = await this.seedOrgAndSkill();
|
127
|
-
const err = await test_utils_1.assert.doesThrowAsync(() => this.organizations.installSkillsByNamespace({
|
128
|
-
organizationId: org.id,
|
129
|
-
namespaces: ['aoeuaoeu'],
|
130
|
-
}));
|
131
|
-
test_utils_2.errorAssert.assertError(err, 'INVALID_NAMESPACES', {
|
132
|
-
namespaces: ['aoeuaoeu'],
|
133
|
-
});
|
134
|
-
}
|
135
|
-
static async canInstallWithSlug() {
|
136
|
-
const { skill, org } = await this.seedOrgAndSkill();
|
137
|
-
await this.organizations.installSkillsByNamespace({
|
138
|
-
organizationId: org.id,
|
139
|
-
namespaces: [skill.slug],
|
140
|
-
});
|
141
|
-
await this.assertSkillIsInstalled(skill.id, org.id);
|
142
|
-
}
|
143
|
-
static async canInstallSkillFromAnotherPerson() {
|
144
|
-
const { skill, org } = await this.seedOrgAndSkill();
|
145
|
-
const skill2 = await this.skills.seedDemoSkill({
|
146
|
-
name: 'testing testy 2',
|
147
|
-
creatorPhone: constants_1.DEMO_NUMBER_INSTALLING_SKILLS,
|
148
|
-
});
|
149
|
-
await this.organizations.installSkillsByNamespace({
|
150
|
-
organizationId: org.id,
|
151
|
-
namespaces: [skill.slug, skill2.slug],
|
152
|
-
});
|
153
|
-
await this.assertSkillIsInstalled(skill.id, org.id);
|
154
|
-
await this.assertSkillIsInstalled(skill2.id, org.id);
|
155
|
-
}
|
156
|
-
static async canDeleteAllExistingOrgs() {
|
157
|
-
const firstFixture = this.Fixture('organization');
|
158
|
-
await firstFixture.seedDemoOrganization({
|
159
|
-
name: 'org 1',
|
160
|
-
phone: constants_1.DEMO_NUMBER_INSTALLING_SKILLS,
|
161
|
-
});
|
162
|
-
await firstFixture.seedDemoOrganization({
|
163
|
-
name: 'org 2',
|
164
|
-
phone: constants_1.DEMO_NUMBER_INSTALLING_SKILLS,
|
165
|
-
});
|
166
|
-
const secondFixture = this.Fixture('organization');
|
167
|
-
await secondFixture.deleteAllOrganizations(constants_1.DEMO_NUMBER_INSTALLING_SKILLS);
|
168
|
-
const { client } = await this.Fixture('person').loginAsDemoPerson(constants_1.DEMO_NUMBER_INSTALLING_SKILLS);
|
169
|
-
const results = await client.emit('list-organizations::v2020_12_25', {
|
170
|
-
payload: {
|
171
|
-
shouldOnlyShowMine: true,
|
172
|
-
},
|
173
|
-
});
|
174
|
-
const { organizations } = spruce_event_utils_2.eventResponseUtil.getFirstResponseOrThrow(results);
|
175
|
-
test_utils_1.assert.isLength(organizations, 0);
|
176
|
-
//@ts-ignore
|
177
|
-
firstFixture.destroy = () => { };
|
178
|
-
//@ts-ignore
|
179
|
-
secondFixture.destroy = () => { };
|
180
|
-
}
|
181
|
-
static async passesThroughAllFieldsToRequest() {
|
182
|
-
await test_utils_1.assert.doesThrowAsync(() => this.Fixture('organization').seedDemoOrganization({
|
183
|
-
//@ts-ignore
|
184
|
-
waka: 'tacas',
|
185
|
-
}));
|
186
|
-
}
|
187
|
-
static canPassPersonFixture() {
|
188
|
-
const personFixture = this.Fixture('person');
|
189
|
-
const orgFixture = this.Fixture('organization', {
|
190
|
-
people: personFixture,
|
191
|
-
});
|
192
|
-
//@ts-ignore
|
193
|
-
test_utils_1.assert.isEqual(orgFixture.people, personFixture);
|
194
|
-
}
|
195
|
-
static async canSeedOrgWithNoOptions() {
|
196
|
-
const org = await this.Fixture('organization').seedDemoOrganization();
|
197
|
-
test_utils_1.assert.isTruthy(org);
|
198
|
-
}
|
199
|
-
static async removePersonThrowsWithBadIds() {
|
200
|
-
await test_utils_1.assert.doesThrowAsync(() => this.organizations.removePerson({
|
201
|
-
phone: constants_1.DEMO_NUMBER_HIRING,
|
202
|
-
roleBase: 'guest',
|
203
|
-
organizationId: 'aoeu',
|
204
|
-
personId: 'aoeu',
|
205
|
-
}));
|
206
|
-
}
|
207
|
-
static async canRemovePersonFromOrg(roleBase) {
|
208
|
-
const { person, org } = await this.seedOrgAndHirePerson(roleBase);
|
209
|
-
await this.organizations.removePerson({
|
210
|
-
phone: constants_1.DEMO_NUMBER_HIRING,
|
211
|
-
roleBase,
|
212
|
-
organizationId: org.id,
|
213
|
-
personId: person.id,
|
214
|
-
});
|
215
|
-
const isHired = await this.isPersonPartOfOrg(person.id, org.id);
|
216
|
-
test_utils_1.assert.isFalse(isHired);
|
217
|
-
}
|
218
|
-
static async Org() {
|
219
|
-
return await this.organizations.seedDemoOrganization({
|
220
|
-
name: 'my org',
|
221
|
-
phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
222
|
-
});
|
223
|
-
}
|
224
|
-
static async seedOrgAndHirePerson(base) {
|
225
|
-
const org = await this.organizations.seedDemoOrganization({
|
226
|
-
name: 'my org',
|
227
|
-
phone: constants_1.DEMO_NUMBER_HIRING,
|
228
|
-
});
|
229
|
-
const { person } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER);
|
230
|
-
await this.organizations.addPerson({
|
231
|
-
personId: person.id,
|
232
|
-
organizationId: org.id,
|
233
|
-
roleBase: base,
|
234
|
-
phone: constants_1.DEMO_NUMBER_HIRING,
|
235
|
-
});
|
236
|
-
return { person, org };
|
237
|
-
}
|
238
|
-
static async assertSkillIsInstalled(skillId, orgId) {
|
239
|
-
const isInstalled = await this.organizations.isSkillInstalled(skillId, orgId);
|
240
|
-
test_utils_1.assert.isTrue(isInstalled);
|
241
|
-
}
|
242
|
-
static async seedOrgAndSkill() {
|
243
|
-
const skill = await this.skills.seedDemoSkill({
|
244
|
-
name: 'testing testy',
|
245
|
-
});
|
246
|
-
const org = await this.organizations.seedDemoOrganization({
|
247
|
-
name: 'my org',
|
248
|
-
});
|
249
|
-
return { skill, org };
|
250
|
-
}
|
251
|
-
static async assertOrgIsPublicValue(orgId, expected) {
|
252
|
-
const org = await this.organizations.getOrganizationById(orgId);
|
253
|
-
if (expected) {
|
254
|
-
test_utils_1.assert.isTrue(org.isPublic);
|
255
|
-
}
|
256
|
-
else {
|
257
|
-
test_utils_1.assert.isFalsy(org.isPublic);
|
258
|
-
}
|
259
|
-
}
|
260
|
-
static async setAndAssertOrgIsPublic(orgId, isPublic) {
|
261
|
-
await this.organizations.updateOrganization(orgId, {
|
262
|
-
isPublic,
|
263
|
-
phone: constants_1.DEMO_NUMBER_ORGANIZATION_FIXTURE,
|
264
|
-
});
|
265
|
-
await this.assertOrgIsPublicValue(orgId, isPublic);
|
266
|
-
}
|
267
|
-
};
|
268
|
-
__decorate([
|
269
|
-
(0, test_utils_1.test)()
|
270
|
-
], OrganizationFixtureTest, "canCreateOrganizationFixture", null);
|
271
|
-
__decorate([
|
272
|
-
(0, test_utils_1.test)()
|
273
|
-
], OrganizationFixtureTest, "canSeedOrg", null);
|
274
|
-
__decorate([
|
275
|
-
(0, test_utils_1.test)()
|
276
|
-
], OrganizationFixtureTest, "orgFixtureDestroysOrgs", null);
|
277
|
-
__decorate([
|
278
|
-
(0, test_utils_1.test)()
|
279
|
-
], OrganizationFixtureTest, "isNotPartOfOrgtoStart", null);
|
280
|
-
__decorate([
|
281
|
-
(0, test_utils_1.test)()
|
282
|
-
], OrganizationFixtureTest, "updatingBadOrgTHrows", null);
|
283
|
-
__decorate([
|
284
|
-
(0, test_utils_1.test)()
|
285
|
-
], OrganizationFixtureTest, "canUpdateOrg", null);
|
286
|
-
__decorate([
|
287
|
-
(0, test_utils_1.test)()
|
288
|
-
], OrganizationFixtureTest, "canUpdateOrgAddress", null);
|
289
|
-
__decorate([
|
290
|
-
(0, test_utils_1.test)()
|
291
|
-
], OrganizationFixtureTest, "canMakeOrgPublicAndPrivate", null);
|
292
|
-
__decorate([
|
293
|
-
(0, test_utils_1.test)('can add as guest', 'guest'),
|
294
|
-
(0, test_utils_1.test)('can add as teammate', 'teammate')
|
295
|
-
], OrganizationFixtureTest, "canAddPersonToOrg", null);
|
296
|
-
__decorate([
|
297
|
-
(0, test_utils_1.test)()
|
298
|
-
], OrganizationFixtureTest, "isNotInstalledByDefault", null);
|
299
|
-
__decorate([
|
300
|
-
(0, test_utils_1.test)()
|
301
|
-
], OrganizationFixtureTest, "showsAsInstalled", null);
|
302
|
-
__decorate([
|
303
|
-
(0, test_utils_1.test)()
|
304
|
-
], OrganizationFixtureTest, "cantInstallWithBadSkill", null);
|
305
|
-
__decorate([
|
306
|
-
(0, test_utils_1.test)()
|
307
|
-
], OrganizationFixtureTest, "canInstallWithSlug", null);
|
308
|
-
__decorate([
|
309
|
-
(0, test_utils_1.test)()
|
310
|
-
], OrganizationFixtureTest, "canInstallSkillFromAnotherPerson", null);
|
311
|
-
__decorate([
|
312
|
-
(0, test_utils_1.test)()
|
313
|
-
], OrganizationFixtureTest, "canDeleteAllExistingOrgs", null);
|
314
|
-
__decorate([
|
315
|
-
(0, test_utils_1.test)()
|
316
|
-
], OrganizationFixtureTest, "passesThroughAllFieldsToRequest", null);
|
317
|
-
__decorate([
|
318
|
-
(0, test_utils_1.test)()
|
319
|
-
], OrganizationFixtureTest, "canPassPersonFixture", null);
|
320
|
-
__decorate([
|
321
|
-
(0, test_utils_1.test)()
|
322
|
-
], OrganizationFixtureTest, "canSeedOrgWithNoOptions", null);
|
323
|
-
__decorate([
|
324
|
-
(0, test_utils_1.test)()
|
325
|
-
], OrganizationFixtureTest, "removePersonThrowsWithBadIds", null);
|
326
|
-
__decorate([
|
327
|
-
(0, test_utils_1.test)('can remove guest', 'guest'),
|
328
|
-
(0, test_utils_1.test)('can remove teammate', 'teammate')
|
329
|
-
], OrganizationFixtureTest, "canRemovePersonFromOrg", null);
|
330
|
-
OrganizationFixtureTest = __decorate([
|
331
|
-
fake_1.default.login()
|
332
|
-
], OrganizationFixtureTest);
|
333
|
-
exports.default = OrganizationFixtureTest;
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
9
|
-
const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
|
10
|
-
const test_utils_1 = require("@sprucelabs/test-utils");
|
11
|
-
const __1 = require("../..");
|
12
|
-
class PatchingConsoleErrorToErrorStreamTest extends __1.AbstractSpruceFixtureTest {
|
13
|
-
static patchesConsoleError() {
|
14
|
-
test_utils_1.assert.isEqual(console.error, spruce_skill_utils_1.testLog.error);
|
15
|
-
console.error('Should write to console');
|
16
|
-
}
|
17
|
-
}
|
18
|
-
exports.default = PatchingConsoleErrorToErrorStreamTest;
|
19
|
-
__decorate([
|
20
|
-
(0, test_utils_1.test)()
|
21
|
-
], 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,225 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
19
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
20
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
21
|
-
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;
|
22
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
23
|
-
};
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
25
|
-
if (mod && mod.__esModule) return mod;
|
26
|
-
var result = {};
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
28
|
-
__setModuleDefault(result, mod);
|
29
|
-
return result;
|
30
|
-
};
|
31
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
32
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
33
|
-
};
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
35
|
-
const mercury_client_1 = require("@sprucelabs/mercury-client");
|
36
|
-
const schema_1 = require("@sprucelabs/schema");
|
37
|
-
const test_utils_1 = __importStar(require("@sprucelabs/test-utils"));
|
38
|
-
const test_utils_2 = require("@sprucelabs/test-utils");
|
39
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
40
|
-
const __1 = require("../..");
|
41
|
-
const constants_1 = require("../../tests/constants");
|
42
|
-
const FixtureFactory_1 = __importDefault(require("../../tests/fixtures/FixtureFactory"));
|
43
|
-
dotenv_1.default.config();
|
44
|
-
__1.MercuryFixture.setShouldRequireLocalListeners(false);
|
45
|
-
class PersonFixtureTest extends test_utils_1.default {
|
46
|
-
static async beforeEach() {
|
47
|
-
await super.beforeEach();
|
48
|
-
this.fixture = this.Fixture();
|
49
|
-
mercury_client_1.MercuryTestClient.reset();
|
50
|
-
}
|
51
|
-
static Fixture() {
|
52
|
-
return new FixtureFactory_1.default({ cwd: this.cwd }).Fixture('person');
|
53
|
-
}
|
54
|
-
static async canCreatePersonFixture() {
|
55
|
-
test_utils_1.assert.isTruthy(this.fixture);
|
56
|
-
}
|
57
|
-
static async throwsWhenNoDummyNumberSetInEnv() {
|
58
|
-
delete process.env.DEMO_NUMBER;
|
59
|
-
const err = await test_utils_1.assert.doesThrowAsync(() => this.fixture.loginAsDemoPerson());
|
60
|
-
test_utils_2.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
61
|
-
parameters: ['env.DEMO_NUMBER'],
|
62
|
-
});
|
63
|
-
}
|
64
|
-
static async canLoginAsPerson() {
|
65
|
-
const { person, client } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER);
|
66
|
-
test_utils_1.assert.isTruthy(person);
|
67
|
-
test_utils_1.assert.isTruthy(client);
|
68
|
-
await client.disconnect();
|
69
|
-
}
|
70
|
-
static async canLoginAsPersonWithEnv() {
|
71
|
-
process.env.DEMO_NUMBER = constants_1.DEMO_NUMBER;
|
72
|
-
const { person, client } = await this.fixture.loginAsDemoPerson();
|
73
|
-
test_utils_1.assert.isTruthy(person);
|
74
|
-
test_utils_1.assert.isEqual(person.phone, (0, schema_1.formatPhoneNumber)(constants_1.DEMO_NUMBER));
|
75
|
-
test_utils_1.assert.isTruthy(client);
|
76
|
-
await client.disconnect();
|
77
|
-
}
|
78
|
-
static async canLoginWith2Numbers() {
|
79
|
-
const { person } = await this.fixture.loginAsDemoPerson();
|
80
|
-
const { person: person2 } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_SECOND_LOGIN);
|
81
|
-
test_utils_1.assert.isEqual(person.phone, (0, schema_1.formatPhoneNumber)(constants_1.DEMO_NUMBER));
|
82
|
-
test_utils_1.assert.isEqual(person2.phone, (0, schema_1.formatPhoneNumber)(constants_1.DEMO_NUMBER_SECOND_LOGIN));
|
83
|
-
}
|
84
|
-
static async loggingInWithoutNumberReturnsSameClientEveryTime() {
|
85
|
-
const { client } = await this.fixture.loginAsDemoPerson();
|
86
|
-
const { client: client1 } = await this.fixture.loginAsDemoPerson();
|
87
|
-
test_utils_1.assert.isEqual(client, client1);
|
88
|
-
}
|
89
|
-
static async staysLoggedInAsThisPerson() {
|
90
|
-
mercury_client_1.MercuryClientFactory.setIsTestMode(true);
|
91
|
-
const { client } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_SECOND_LOGIN);
|
92
|
-
//@ts-ignore
|
93
|
-
client.emit = () => {
|
94
|
-
test_utils_1.assert.fail('should reuse client');
|
95
|
-
};
|
96
|
-
const { client: client1 } = await this.fixture.loginAsDemoPerson();
|
97
|
-
test_utils_1.assert.isEqual(client, client1);
|
98
|
-
}
|
99
|
-
static async canOverrideDefaultClient() {
|
100
|
-
const { client } = await this.fixture.loginAsDemoPerson();
|
101
|
-
__1.MercuryFixture.setDefaultClient(client);
|
102
|
-
const { client: client2 } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_SECOND_LOGIN);
|
103
|
-
test_utils_1.assert.isNotEqual(client, client2);
|
104
|
-
}
|
105
|
-
static async honorsDefaultClientEvenWithoutDemoPhoneSet() {
|
106
|
-
const phone = process.env.DEMO_NUMBER;
|
107
|
-
delete process.env.DEMO_NUMBER;
|
108
|
-
const { client } = await this.Fixture().loginAsDemoPerson(phone);
|
109
|
-
__1.MercuryFixture.setDefaultClient(client);
|
110
|
-
const { client: client2 } = await this.Fixture().loginAsDemoPerson();
|
111
|
-
test_utils_1.assert.isEqual(client, client2);
|
112
|
-
}
|
113
|
-
static async listPeoplePassesThroughVars(expectedTarget, expectedPayload = {
|
114
|
-
personIds: ['1234'],
|
115
|
-
roleBases: ['1234'],
|
116
|
-
roleIds: ['1234'],
|
117
|
-
shouldIncludePrivateFields: true,
|
118
|
-
}) {
|
119
|
-
mercury_client_1.MercuryClientFactory.setIsTestMode(true);
|
120
|
-
test_utils_1.assert.isFunction(this.fixture.listPeople);
|
121
|
-
const { client } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_PERSON_FIXTURE);
|
122
|
-
let wasHit = true;
|
123
|
-
let passedTarget;
|
124
|
-
let passedPayload;
|
125
|
-
await client.on('list-people::v2020_12_25', ({ target, payload }) => {
|
126
|
-
passedTarget = target;
|
127
|
-
passedPayload = payload;
|
128
|
-
wasHit = true;
|
129
|
-
return {
|
130
|
-
people: [
|
131
|
-
{
|
132
|
-
id: '1234',
|
133
|
-
casualName: 'tay',
|
134
|
-
dateCreated: 0,
|
135
|
-
},
|
136
|
-
],
|
137
|
-
};
|
138
|
-
});
|
139
|
-
await this.fixture.listPeople(Object.assign(Object.assign({}, expectedTarget), expectedPayload));
|
140
|
-
test_utils_1.assert.isTrue(wasHit);
|
141
|
-
test_utils_1.assert.isEqualDeep(passedTarget, expectedTarget);
|
142
|
-
test_utils_1.assert.isEqualDeep(passedPayload, expectedPayload);
|
143
|
-
}
|
144
|
-
static async listPeopleReturnsPeople(expectedPeople) {
|
145
|
-
mercury_client_1.MercuryClientFactory.setIsTestMode(true);
|
146
|
-
const { client } = await this.fixture.loginAsDemoPerson(constants_1.DEMO_NUMBER_PERSON_FIXTURE);
|
147
|
-
await client.on('list-people::v2020_12_25', () => {
|
148
|
-
return {
|
149
|
-
people: expectedPeople,
|
150
|
-
};
|
151
|
-
});
|
152
|
-
const people = await this.fixture.listPeople({
|
153
|
-
organizationId: '1234',
|
154
|
-
});
|
155
|
-
test_utils_1.assert.isEqualDeep(people, expectedPeople);
|
156
|
-
}
|
157
|
-
}
|
158
|
-
exports.default = PersonFixtureTest;
|
159
|
-
__decorate([
|
160
|
-
(0, test_utils_1.test)()
|
161
|
-
], PersonFixtureTest, "canCreatePersonFixture", null);
|
162
|
-
__decorate([
|
163
|
-
(0, test_utils_1.test)()
|
164
|
-
], PersonFixtureTest, "throwsWhenNoDummyNumberSetInEnv", null);
|
165
|
-
__decorate([
|
166
|
-
(0, test_utils_1.test)()
|
167
|
-
], PersonFixtureTest, "canLoginAsPerson", null);
|
168
|
-
__decorate([
|
169
|
-
(0, test_utils_1.test)()
|
170
|
-
], PersonFixtureTest, "canLoginAsPersonWithEnv", null);
|
171
|
-
__decorate([
|
172
|
-
(0, test_utils_1.test)()
|
173
|
-
], PersonFixtureTest, "canLoginWith2Numbers", null);
|
174
|
-
__decorate([
|
175
|
-
(0, test_utils_1.test)()
|
176
|
-
], PersonFixtureTest, "loggingInWithoutNumberReturnsSameClientEveryTime", null);
|
177
|
-
__decorate([
|
178
|
-
(0, test_utils_1.test)()
|
179
|
-
], PersonFixtureTest, "staysLoggedInAsThisPerson", null);
|
180
|
-
__decorate([
|
181
|
-
(0, test_utils_1.test)()
|
182
|
-
], PersonFixtureTest, "canOverrideDefaultClient", null);
|
183
|
-
__decorate([
|
184
|
-
(0, test_utils_1.test)()
|
185
|
-
], PersonFixtureTest, "honorsDefaultClientEvenWithoutDemoPhoneSet", null);
|
186
|
-
__decorate([
|
187
|
-
(0, test_utils_1.test)('list people passes target', {
|
188
|
-
organizationId: '1234',
|
189
|
-
locationId: '1234',
|
190
|
-
}),
|
191
|
-
(0, test_utils_1.test)('list people passes target 2', {
|
192
|
-
organizationId: '5234',
|
193
|
-
locationId: '2666',
|
194
|
-
}),
|
195
|
-
(0, test_utils_1.test)('list people passes payload 1', {
|
196
|
-
organizationId: '5234',
|
197
|
-
locationId: '2666',
|
198
|
-
}, {
|
199
|
-
personIds: ['56236'],
|
200
|
-
roleBases: ['23452346'],
|
201
|
-
roleIds: ['7567'],
|
202
|
-
shouldIncludePrivateFields: false,
|
203
|
-
})
|
204
|
-
], PersonFixtureTest, "listPeoplePassesThroughVars", null);
|
205
|
-
__decorate([
|
206
|
-
(0, test_utils_1.test)('returns people 1', [
|
207
|
-
{
|
208
|
-
id: '1234',
|
209
|
-
casualName: 'tay',
|
210
|
-
dateCreated: 0,
|
211
|
-
},
|
212
|
-
]),
|
213
|
-
(0, test_utils_1.test)('returns people 2', [
|
214
|
-
{
|
215
|
-
id: '234234',
|
216
|
-
casualName: 'tsaoteuh',
|
217
|
-
dateCreated: 230,
|
218
|
-
},
|
219
|
-
{
|
220
|
-
id: '1234',
|
221
|
-
casualName: 'tay',
|
222
|
-
dateCreated: 0,
|
223
|
-
},
|
224
|
-
])
|
225
|
-
], 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
|
-
}
|