@sprucelabs/spruce-test-fixtures 62.2.24 → 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,856 +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 { AbstractSkillViewController, AbstractViewController, ActiveRecordListViewController, AuthenticatorImpl, formAssert, SwipeViewControllerImpl, vcAssert, ViewControllerFactory, } from '@sprucelabs/heartwood-view-controllers';
|
17
|
-
import { formatPhoneNumber } from '@sprucelabs/schema';
|
18
|
-
import { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
|
19
|
-
import { assert, test } from '@sprucelabs/test-utils';
|
20
|
-
import { errorAssert, generateId } from '@sprucelabs/test-utils';
|
21
|
-
import { ClientProxyDecorator, seed } from '../../../../index.js';
|
22
|
-
import AbstractSpruceFixtureTest from '../../../../tests/AbstractSpruceFixtureTest.js';
|
23
|
-
import { DEMO_NUMBER_VIEW_FIXTURE, DEMO_NUMBER, DEMO_NUMBER_VIEW_FIXTURE_2, DEMO_NUMBER_VIEW_FIXTURE_CLIENT_2, } from '../../../../tests/constants.js';
|
24
|
-
import fake from '../../../../tests/decorators/fake.js';
|
25
|
-
import FakeSkillViewController from '../../../../tests/Fake.svc.js';
|
26
|
-
import SpyScope from '../../../../tests/fixtures/SpyScope.js';
|
27
|
-
import ViewFixture from '../../../../tests/fixtures/ViewFixture.js';
|
28
|
-
import SpyViewControllerFactory from '../../../../tests/SpyViewControllerFactory.js';
|
29
|
-
import EventFaker from '../../../support/EventFaker.js';
|
30
|
-
import FakeThemeManager from '../../../support/FakeThemeManager.js';
|
31
|
-
const DEMO_NUMBER_FORMATTED = formatPhoneNumber(DEMO_NUMBER !== null && DEMO_NUMBER !== void 0 ? DEMO_NUMBER : '');
|
32
|
-
let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
33
|
-
static beforeEach() {
|
34
|
-
const _super = Object.create(null, {
|
35
|
-
beforeEach: { get: () => super.beforeEach }
|
36
|
-
});
|
37
|
-
return __awaiter(this, void 0, void 0, function* () {
|
38
|
-
yield _super.beforeEach.call(this);
|
39
|
-
this.fixture = this.ViewFixture();
|
40
|
-
this.fixtureNoOptions = this.Fixture('view');
|
41
|
-
this.eventFaker = new EventFaker();
|
42
|
-
yield this.eventFaker.fakeRegisterSkill();
|
43
|
-
yield this.eventFaker.fakeUnregisterSkill();
|
44
|
-
yield this.eventFaker.fakeRegisterProxyToken();
|
45
|
-
});
|
46
|
-
}
|
47
|
-
static canLogin() {
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
49
|
-
const auth = AuthenticatorImpl.getInstance();
|
50
|
-
assert.isEqualDeep(auth.getPerson(), this.fakedPerson);
|
51
|
-
const { person } = yield this.fixtureNoOptions.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
52
|
-
const loggedIn = auth.getPerson();
|
53
|
-
assert.isTruthy(loggedIn);
|
54
|
-
assert.isEqualDeep(loggedIn, person);
|
55
|
-
});
|
56
|
-
}
|
57
|
-
static loginFallsBackToDemoNumber() {
|
58
|
-
return __awaiter(this, void 0, void 0, function* () {
|
59
|
-
const { person } = yield this.fixtureNoOptions.loginAsDemoPerson();
|
60
|
-
assert.isEqual(person.phone, DEMO_NUMBER_FORMATTED);
|
61
|
-
});
|
62
|
-
}
|
63
|
-
static canSetHeartwoodRoot() {
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
65
|
-
const fixture = this.Fixture('view', {
|
66
|
-
controllerMap: {
|
67
|
-
'heartwood.root': true,
|
68
|
-
},
|
69
|
-
});
|
70
|
-
const factory = fixture.getFactory();
|
71
|
-
//@ts-ignore
|
72
|
-
assert.isTrue(factory.controllerMap['heartwood.root']);
|
73
|
-
});
|
74
|
-
}
|
75
|
-
static fixturesShouldShareConnectToApiReferences() {
|
76
|
-
const fixture1 = this.fixtureNoOptions;
|
77
|
-
const fixture2 = this.fixtureNoOptions;
|
78
|
-
//@ts-ignore
|
79
|
-
assert.isEqual(fixture1.connectToApi, fixture2.connectToApi);
|
80
|
-
}
|
81
|
-
static canPassThroughPersonFixture() {
|
82
|
-
const personFixture = this.Fixture('person');
|
83
|
-
const viewFixture = this.Fixture('view', { people: personFixture });
|
84
|
-
//@ts-ignore
|
85
|
-
assert.isEqual(viewFixture.people, personFixture);
|
86
|
-
}
|
87
|
-
static feedsInScope() {
|
88
|
-
return __awaiter(this, void 0, void 0, function* () {
|
89
|
-
const { vc, fixture } = this.Scope();
|
90
|
-
assert.isNull(vc.loadOptions);
|
91
|
-
yield fixture.load(vc, {});
|
92
|
-
assert.isTruthy(vc.loadOptions);
|
93
|
-
assert.isTruthy(vc.loadOptions.scope);
|
94
|
-
});
|
95
|
-
}
|
96
|
-
static scopeCanGetAndSetOrganization() {
|
97
|
-
return __awaiter(this, void 0, void 0, function* () {
|
98
|
-
var _a;
|
99
|
-
const { vc, fixture } = this.Scope();
|
100
|
-
yield fixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
101
|
-
yield fixture.load(vc);
|
102
|
-
const scope = (_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope;
|
103
|
-
assert.isTruthy(scope);
|
104
|
-
let org = yield scope.getCurrentOrganization();
|
105
|
-
assert.isNull(org);
|
106
|
-
const created = yield this.organizations.seedDemoOrganization({
|
107
|
-
name: 'Scope org',
|
108
|
-
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
109
|
-
});
|
110
|
-
scope.setCurrentOrganization(created.id);
|
111
|
-
org = yield scope.getCurrentOrganization();
|
112
|
-
assert.isEqualDeep(org, created);
|
113
|
-
});
|
114
|
-
}
|
115
|
-
static scopeGetsLastOrgByDefault() {
|
116
|
-
return __awaiter(this, void 0, void 0, function* () {
|
117
|
-
const orgs = this.organizations;
|
118
|
-
yield orgs.seedDemoOrganization({
|
119
|
-
name: 'Scope org',
|
120
|
-
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
121
|
-
});
|
122
|
-
yield orgs.seedDemoOrganization({
|
123
|
-
name: 'Scope org',
|
124
|
-
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
125
|
-
});
|
126
|
-
const expected = yield orgs.seedDemoOrganization({
|
127
|
-
name: 'Scope org',
|
128
|
-
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
129
|
-
});
|
130
|
-
const viewFixture = this.fixtureNoOptions;
|
131
|
-
yield viewFixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
132
|
-
const current = yield viewFixture.getScope().getCurrentOrganization();
|
133
|
-
assert.isEqualDeep(current, expected);
|
134
|
-
});
|
135
|
-
}
|
136
|
-
static scopeGetsLastLocationByDefault() {
|
137
|
-
return __awaiter(this, void 0, void 0, function* () {
|
138
|
-
const org = yield this.organizations.seedDemoOrganization({
|
139
|
-
name: 'Scope org',
|
140
|
-
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
141
|
-
});
|
142
|
-
yield this.locations.seedDemoLocation({
|
143
|
-
organizationId: org.id,
|
144
|
-
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
145
|
-
});
|
146
|
-
yield this.locations.seedDemoLocation({
|
147
|
-
organizationId: org.id,
|
148
|
-
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
149
|
-
});
|
150
|
-
yield this.locations.seedDemoLocation({
|
151
|
-
organizationId: org.id,
|
152
|
-
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
153
|
-
});
|
154
|
-
const viewFixture = this.fixtureNoOptions;
|
155
|
-
yield viewFixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
156
|
-
const current = yield viewFixture.getScope().getCurrentLocation();
|
157
|
-
const { client } = yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
158
|
-
const [{ locations }] = yield client.emitAndFlattenResponses('list-locations::v2020_12_25', {
|
159
|
-
target: {
|
160
|
-
organizationId: org.id,
|
161
|
-
},
|
162
|
-
});
|
163
|
-
const expected = locations[0];
|
164
|
-
assert.isEqualDeep(current, expected);
|
165
|
-
});
|
166
|
-
}
|
167
|
-
static scopeCanGetAndSetLocation() {
|
168
|
-
return __awaiter(this, void 0, void 0, function* () {
|
169
|
-
var _a;
|
170
|
-
yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
171
|
-
const { vc, fixture } = this.Scope();
|
172
|
-
yield fixture.load(vc);
|
173
|
-
const scope = (_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope;
|
174
|
-
assert.isTruthy(scope);
|
175
|
-
let location = yield scope.getCurrentLocation();
|
176
|
-
assert.isNull(location);
|
177
|
-
const created = yield this.Fixture('location').seedDemoLocation({
|
178
|
-
name: 'Scope org',
|
179
|
-
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
180
|
-
});
|
181
|
-
scope.setCurrentLocation(created.id);
|
182
|
-
location = yield scope.getCurrentLocation();
|
183
|
-
assert.isEqualDeep(location, created);
|
184
|
-
});
|
185
|
-
}
|
186
|
-
static sharesPersonFixture() {
|
187
|
-
return __awaiter(this, void 0, void 0, function* () {
|
188
|
-
const { fixture } = this.Scope();
|
189
|
-
assert.isEqual(
|
190
|
-
//@ts-ignore
|
191
|
-
fixture.people,
|
192
|
-
//@ts-ignore
|
193
|
-
fixture.orgs.people);
|
194
|
-
assert.isEqual(
|
195
|
-
//@ts-ignore
|
196
|
-
fixture.people,
|
197
|
-
//@ts-ignore
|
198
|
-
fixture.locations.people);
|
199
|
-
assert.isEqual(
|
200
|
-
//@ts-ignore
|
201
|
-
fixture.orgs,
|
202
|
-
//@ts-ignore
|
203
|
-
fixture.locations.orgs);
|
204
|
-
});
|
205
|
-
}
|
206
|
-
static canSetScopeForCurrentOrganizationAcrossViewFixtures() {
|
207
|
-
return __awaiter(this, void 0, void 0, function* () {
|
208
|
-
var _a;
|
209
|
-
const org = yield this.organizations.seedDemoOrganization({
|
210
|
-
phone: DEMO_NUMBER_VIEW_FIXTURE,
|
211
|
-
name: 'My new org!',
|
212
|
-
});
|
213
|
-
this.fixtureNoOptions.getScope().setCurrentOrganization(org.id);
|
214
|
-
const { vc, fixture } = this.Scope();
|
215
|
-
yield fixture.load(vc);
|
216
|
-
const current = yield ((_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope.getCurrentOrganization());
|
217
|
-
assert.isEqualDeep(current, org);
|
218
|
-
});
|
219
|
-
}
|
220
|
-
static scopeShouldBeResetEachRun() {
|
221
|
-
return __awaiter(this, void 0, void 0, function* () {
|
222
|
-
var _a;
|
223
|
-
const { vc, fixture } = this.Scope();
|
224
|
-
yield fixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE);
|
225
|
-
yield fixture.load(vc);
|
226
|
-
const current = yield ((_a = vc.loadOptions) === null || _a === void 0 ? void 0 : _a.scope.getCurrentOrganization());
|
227
|
-
assert.isNull(current);
|
228
|
-
});
|
229
|
-
}
|
230
|
-
static fixturesShareVcFactory() {
|
231
|
-
const options = {
|
232
|
-
controllerMap: {
|
233
|
-
'heartwood.root': true,
|
234
|
-
},
|
235
|
-
};
|
236
|
-
const fixture1 = this.Fixture('view', options);
|
237
|
-
const fixture2 = this.Fixture('view', options);
|
238
|
-
assert.isEqual(fixture1.getFactory(), fixture2.getFactory());
|
239
|
-
}
|
240
|
-
static mixesInControllerMapWithLocalViews() {
|
241
|
-
return __awaiter(this, void 0, void 0, function* () {
|
242
|
-
yield this.bootAndRegisterSkillFromTestDir('skill');
|
243
|
-
const fixture = this.Fixture('view', {
|
244
|
-
controllerMap: {
|
245
|
-
'new.view': FakeSkillViewController,
|
246
|
-
},
|
247
|
-
});
|
248
|
-
const factory = fixture.getFactory();
|
249
|
-
//@ts-ignore
|
250
|
-
factory.Controller('views.book', {});
|
251
|
-
//@ts-ignore
|
252
|
-
factory.Controller('new.view', {});
|
253
|
-
});
|
254
|
-
}
|
255
|
-
static fixturesContinueToMixinViewControllers() {
|
256
|
-
this.Fixture('view', {
|
257
|
-
controllerMap: {
|
258
|
-
'new.view': FakeSkillViewController,
|
259
|
-
},
|
260
|
-
}).getFactory();
|
261
|
-
const fixture = this.Fixture('view', {
|
262
|
-
controllerMap: {
|
263
|
-
'new.view2': FakeSkillViewController,
|
264
|
-
},
|
265
|
-
});
|
266
|
-
//@ts-ignore
|
267
|
-
fixture.getFactory().Controller('new.view2');
|
268
|
-
}
|
269
|
-
static fixtureAttachesRenderCount() {
|
270
|
-
const vc = this.MockVc();
|
271
|
-
vcAssert.assertTriggerRenderCount(vc, 0);
|
272
|
-
vc.triggerRender();
|
273
|
-
vcAssert.assertTriggerRenderCount(vc, 1);
|
274
|
-
}
|
275
|
-
static fixturePatchesAlertToThrow() {
|
276
|
-
return __awaiter(this, void 0, void 0, function* () {
|
277
|
-
const vc = this.MockVc();
|
278
|
-
//@ts-ignore
|
279
|
-
assert.isFunction(vc._originalAlert);
|
280
|
-
//@ts-ignore
|
281
|
-
yield assert.doesThrowAsync(() => vc.alert());
|
282
|
-
});
|
283
|
-
}
|
284
|
-
static fixturePatchesRenderInDialogToThrow() {
|
285
|
-
const vc = this.MockVc();
|
286
|
-
//@ts-ignore
|
287
|
-
assert.isFunction(vc._originalRenderInDialog);
|
288
|
-
//@ts-ignore
|
289
|
-
assert.doesThrow(() => vc.renderInDialog({}));
|
290
|
-
}
|
291
|
-
static testRouterThrowsOnRedirect() {
|
292
|
-
return __awaiter(this, void 0, void 0, function* () {
|
293
|
-
const router = this.fixture.getRouter();
|
294
|
-
yield assert.doesThrowAsync(() => router.redirect('heartwood.root'));
|
295
|
-
yield vcAssert.assertActionRedirects({
|
296
|
-
action: () => router.redirect('heartwood.root'),
|
297
|
-
router,
|
298
|
-
});
|
299
|
-
});
|
300
|
-
}
|
301
|
-
static canGetAuthenticatorInstance() {
|
302
|
-
const viewFixture = this.Fixture('view', {
|
303
|
-
controllerMap: {
|
304
|
-
card: FakeSkillViewController,
|
305
|
-
},
|
306
|
-
});
|
307
|
-
assert.isFunction(viewFixture.getAuthenticator);
|
308
|
-
assert.isEqual(viewFixture.getAuthenticator(), AuthenticatorImpl.getInstance());
|
309
|
-
}
|
310
|
-
static activeRecordThrowsByDefault() {
|
311
|
-
//@ts-ignore
|
312
|
-
assert.isTrue(ActiveRecordListViewController.shouldThrowOnResponseError);
|
313
|
-
ActiveRecordListViewController.setShouldThrowOnResponseError(false);
|
314
|
-
}
|
315
|
-
static activeRecordThrowReset() {
|
316
|
-
//@ts-ignore
|
317
|
-
assert.isTrue(ActiveRecordListViewController.shouldThrowOnResponseError);
|
318
|
-
}
|
319
|
-
static loggingInWithViewFixtureSetsProxyTokenForSkill() {
|
320
|
-
return __awaiter(this, void 0, void 0, function* () {
|
321
|
-
const { client, token, generator } = yield this.loginAndGetProxy();
|
322
|
-
assert.isTruthy(token);
|
323
|
-
assert.isTruthy(client.getProxyToken());
|
324
|
-
assert.isEqual(token, client.getProxyToken());
|
325
|
-
const token2 = yield (generator === null || generator === void 0 ? void 0 : generator());
|
326
|
-
assert.isEqual(token, token2);
|
327
|
-
const results = yield client.emit('whoami::v2020_12_25');
|
328
|
-
eventResponseUtil.getFirstResponseOrThrow(results);
|
329
|
-
});
|
330
|
-
}
|
331
|
-
static proxyGeneratorIsResetWhenDifferentPersonLogsIn() {
|
332
|
-
return __awaiter(this, void 0, void 0, function* () {
|
333
|
-
const { token } = yield this.loginAndGetProxy();
|
334
|
-
const { token: token2 } = yield this.loginAndGetProxy(DEMO_NUMBER_VIEW_FIXTURE_2);
|
335
|
-
assert.isNotEqual(token, token2);
|
336
|
-
});
|
337
|
-
}
|
338
|
-
static sameProxyAcrossFixturesWithSameNumber() {
|
339
|
-
return __awaiter(this, void 0, void 0, function* () {
|
340
|
-
const { token } = yield this.loginAndGetProxy();
|
341
|
-
const { token: token2 } = yield this.loginAndGetProxy();
|
342
|
-
assert.isEqual(token, token2);
|
343
|
-
});
|
344
|
-
}
|
345
|
-
static generatorResetEachTest() {
|
346
|
-
return __awaiter(this, void 0, void 0, function* () {
|
347
|
-
//@ts-ignore
|
348
|
-
assert.isEqualDeep(ViewFixture.loggedInPersonProxyTokens, {});
|
349
|
-
const generator = this.getProxyGenerator();
|
350
|
-
assert.isFalsy(generator);
|
351
|
-
});
|
352
|
-
}
|
353
|
-
static loggingInAsViewSetsClientForViewControllers() {
|
354
|
-
return __awaiter(this, void 0, void 0, function* () {
|
355
|
-
const client = yield this.loginAsDemoPerson();
|
356
|
-
const vc = this.fixture.Controller('client', {});
|
357
|
-
const client2 = yield vc.connect();
|
358
|
-
assert.isEqual(client, client2);
|
359
|
-
});
|
360
|
-
}
|
361
|
-
static viewClientIsResetAfterEachTest() {
|
362
|
-
//@ts-ignore
|
363
|
-
assert.isFalsy(ViewFixture.viewClient);
|
364
|
-
}
|
365
|
-
static generatorIsNotVulnerableToRaceConditions() {
|
366
|
-
return __awaiter(this, void 0, void 0, function* () {
|
367
|
-
const client = yield this.loginAsDemoPerson();
|
368
|
-
const generator = this.fixture.getProxyTokenGenerator();
|
369
|
-
assert.isTruthy(generator);
|
370
|
-
let hitCount = 0;
|
371
|
-
yield client.on('register-proxy-token::v2020_12_25', () => {
|
372
|
-
hitCount++;
|
373
|
-
return {
|
374
|
-
token: 'aoeu',
|
375
|
-
};
|
376
|
-
});
|
377
|
-
yield Promise.all([
|
378
|
-
generator(),
|
379
|
-
generator(),
|
380
|
-
generator(),
|
381
|
-
generator(),
|
382
|
-
generator(),
|
383
|
-
generator(),
|
384
|
-
generator(),
|
385
|
-
generator(),
|
386
|
-
generator(),
|
387
|
-
]);
|
388
|
-
assert.isEqual(hitCount, 1);
|
389
|
-
});
|
390
|
-
}
|
391
|
-
static patchesConfirmToThrow() {
|
392
|
-
return __awaiter(this, void 0, void 0, function* () {
|
393
|
-
const vc = this.MockVc();
|
394
|
-
//@ts-ignore
|
395
|
-
yield assert.doesThrowAsync(() => vc.confirm());
|
396
|
-
});
|
397
|
-
}
|
398
|
-
static setsSwipeVcJumpToSlideDuration() {
|
399
|
-
return __awaiter(this, void 0, void 0, function* () {
|
400
|
-
assert.isEqual(SwipeViewControllerImpl.swipeDelay, 0);
|
401
|
-
SwipeViewControllerImpl.swipeDelay = 100;
|
402
|
-
yield ViewFixture.beforeEach();
|
403
|
-
assert.isEqual(SwipeViewControllerImpl.swipeDelay, 0);
|
404
|
-
});
|
405
|
-
}
|
406
|
-
static canSetScope() {
|
407
|
-
const scope = new SpyScope({
|
408
|
-
organizationFixture: this.organizations,
|
409
|
-
locationFixture: this.locations,
|
410
|
-
});
|
411
|
-
this.fixture.setScope(scope);
|
412
|
-
assert.isEqual(this.fixture.getScope(), scope);
|
413
|
-
}
|
414
|
-
static loadingAScopedToOrgVcWithoutASeededOrgThrows() {
|
415
|
-
return __awaiter(this, void 0, void 0, function* () {
|
416
|
-
const vc = this.ScopedByOrgVc();
|
417
|
-
const err = yield assert.doesThrowAsync(() => this.fixture.load(vc));
|
418
|
-
errorAssert.assertError(err, 'SCOPE_REQUIREMENTS_NOT_MET');
|
419
|
-
});
|
420
|
-
}
|
421
|
-
static loadingAScopedToLocationVcWithoutASeededLocationThrows() {
|
422
|
-
return __awaiter(this, void 0, void 0, function* () {
|
423
|
-
const vc = this.ScopedByLocationVc();
|
424
|
-
const err = yield assert.doesThrowAsync(() => this.fixture.load(vc));
|
425
|
-
errorAssert.assertError(err, 'SCOPE_REQUIREMENTS_NOT_MET');
|
426
|
-
});
|
427
|
-
}
|
428
|
-
static loadingWithOrgScopeAndSeededOrg() {
|
429
|
-
return __awaiter(this, void 0, void 0, function* () {
|
430
|
-
const vc = this.ScopedByOrgVc();
|
431
|
-
yield this.fixture.load(vc);
|
432
|
-
vc.getScope = () => ['employed', 'organization'];
|
433
|
-
yield this.fixture.load(vc);
|
434
|
-
});
|
435
|
-
}
|
436
|
-
static loadingWithLocationScopeAndSeededLocation() {
|
437
|
-
return __awaiter(this, void 0, void 0, function* () {
|
438
|
-
const vc = this.ScopedByLocationVc();
|
439
|
-
yield this.fixture.load(vc);
|
440
|
-
vc.getScope = () => ['employed', 'location'];
|
441
|
-
yield this.fixture.load(vc);
|
442
|
-
});
|
443
|
-
}
|
444
|
-
static setsFactoryToFormAssert() {
|
445
|
-
return __awaiter(this, void 0, void 0, function* () {
|
446
|
-
this.fixture.getFactory();
|
447
|
-
//@ts-ignore
|
448
|
-
assert.isEqual(formAssert.views, this.fixture.getFactory());
|
449
|
-
});
|
450
|
-
}
|
451
|
-
static canSetMercuryClient() {
|
452
|
-
return __awaiter(this, void 0, void 0, function* () {
|
453
|
-
const client = yield this.mercury.connectToApi({
|
454
|
-
shouldReUseClient: false,
|
455
|
-
});
|
456
|
-
this.fixture.setClient(client);
|
457
|
-
//@ts-ignore
|
458
|
-
assert.isEqual(ViewFixture.viewClient, client);
|
459
|
-
});
|
460
|
-
}
|
461
|
-
static loadOptionsComeWithFakeThemeManager() {
|
462
|
-
return __awaiter(this, void 0, void 0, function* () {
|
463
|
-
const options = this.buildLoadOptions();
|
464
|
-
assert.isTrue(options.themes instanceof FakeThemeManager);
|
465
|
-
});
|
466
|
-
}
|
467
|
-
static sameFakeThemeEachTime() {
|
468
|
-
return __awaiter(this, void 0, void 0, function* () {
|
469
|
-
const options1 = this.buildLoadOptions();
|
470
|
-
const options2 = this.buildLoadOptions();
|
471
|
-
assert.isEqual(options1.themes, options2.themes);
|
472
|
-
});
|
473
|
-
}
|
474
|
-
static sameThemesOnFixture() {
|
475
|
-
return __awaiter(this, void 0, void 0, function* () {
|
476
|
-
assert.isEqual(this.fixture.getThemes(), this.buildLoadOptions().themes);
|
477
|
-
});
|
478
|
-
}
|
479
|
-
static canSetController() {
|
480
|
-
return __awaiter(this, void 0, void 0, function* () {
|
481
|
-
const factory = this.fixture.getFactory();
|
482
|
-
const name = generateId();
|
483
|
-
const Vc = {};
|
484
|
-
let passedName;
|
485
|
-
let passedVc;
|
486
|
-
factory.setController = (name, Vc) => {
|
487
|
-
passedName = name;
|
488
|
-
passedVc = Vc;
|
489
|
-
};
|
490
|
-
this.fixture.setController(name, Vc);
|
491
|
-
assert.isEqual(passedName, name);
|
492
|
-
assert.isEqual(passedVc, Vc);
|
493
|
-
});
|
494
|
-
}
|
495
|
-
static deviceIsSetOnFixtureAndFactory() {
|
496
|
-
return __awaiter(this, void 0, void 0, function* () {
|
497
|
-
const factory = this.fixture.getFactory();
|
498
|
-
const device = this.fixture.getDevice();
|
499
|
-
//@ts-ignore
|
500
|
-
assert.isEqual(factory.device, device);
|
501
|
-
const factory2 = this.ViewFixture();
|
502
|
-
assert.isEqual(factory2.getDevice(), device);
|
503
|
-
this.lastDevice = device;
|
504
|
-
});
|
505
|
-
}
|
506
|
-
static newDeviceBeforeEach() {
|
507
|
-
return __awaiter(this, void 0, void 0, function* () {
|
508
|
-
const device = this.fixture.getDevice();
|
509
|
-
assert.isNotEqual(device, this.lastDevice);
|
510
|
-
});
|
511
|
-
}
|
512
|
-
static mutesLogs() {
|
513
|
-
return __awaiter(this, void 0, void 0, function* () {
|
514
|
-
console.log = () => assert.fail('should not be called');
|
515
|
-
console.warn = () => assert.fail('should not be called');
|
516
|
-
console.error = () => assert.fail('should not be called');
|
517
|
-
const vc = this.MockVc('logging');
|
518
|
-
const log = vc.getLog();
|
519
|
-
log.info('hey');
|
520
|
-
log.error('hey');
|
521
|
-
log.warn('hey');
|
522
|
-
});
|
523
|
-
}
|
524
|
-
static buildVcPluginExposedInFixture() {
|
525
|
-
return __awaiter(this, void 0, void 0, function* () {
|
526
|
-
const factory = this.fixture.getFactory();
|
527
|
-
let wasHit = false;
|
528
|
-
let PassedClass;
|
529
|
-
let response = {};
|
530
|
-
//@ts-ignore
|
531
|
-
factory.BuildPlugin = (Class) => {
|
532
|
-
wasHit = true;
|
533
|
-
PassedClass = Class;
|
534
|
-
return response;
|
535
|
-
};
|
536
|
-
const plugin = this.fixture.BuildPlugin(SpyVcPlugin);
|
537
|
-
assert.isTrue(wasHit);
|
538
|
-
assert.isEqual(PassedClass, SpyVcPlugin);
|
539
|
-
assert.isEqual(plugin, response);
|
540
|
-
});
|
541
|
-
}
|
542
|
-
static addPluginExposedInFixure() {
|
543
|
-
return __awaiter(this, void 0, void 0, function* () {
|
544
|
-
const factory = this.fixture.getFactory();
|
545
|
-
const name = generateId();
|
546
|
-
let passedName;
|
547
|
-
let passedPlugin;
|
548
|
-
const plugin = this.fixture.BuildPlugin(SpyVcPlugin);
|
549
|
-
factory.addPlugin = (named, plugin) => {
|
550
|
-
passedName = named;
|
551
|
-
passedPlugin = plugin;
|
552
|
-
};
|
553
|
-
this.fixture.addPlugin(name, plugin);
|
554
|
-
assert.isEqual(passedName, name);
|
555
|
-
assert.isEqual(passedPlugin, plugin);
|
556
|
-
});
|
557
|
-
}
|
558
|
-
static getFactoryReturnsSpyFactory() {
|
559
|
-
return __awaiter(this, void 0, void 0, function* () {
|
560
|
-
this.assertSpyFactoryUsed();
|
561
|
-
});
|
562
|
-
}
|
563
|
-
static spyFactoryResetForEachTestIfDeleted() {
|
564
|
-
return __awaiter(this, void 0, void 0, function* () {
|
565
|
-
delete ViewControllerFactory.Class;
|
566
|
-
});
|
567
|
-
}
|
568
|
-
static getFactoryReturnsSpyFactoryForNextTest() {
|
569
|
-
return __awaiter(this, void 0, void 0, function* () {
|
570
|
-
this.assertSpyFactoryUsed();
|
571
|
-
});
|
572
|
-
}
|
573
|
-
static assertSpyFactoryUsed() {
|
574
|
-
assert.isInstanceOf(this.fixture.getFactory(), SpyViewControllerFactory);
|
575
|
-
}
|
576
|
-
static ViewFixture() {
|
577
|
-
return this.Fixture('view', {
|
578
|
-
controllerMap: {
|
579
|
-
scope: ScopeSvc,
|
580
|
-
client: ClientSvc,
|
581
|
-
scopedByOrg: ScopedByOrgSvc,
|
582
|
-
scopedByLocation: ScopedByLocationSvc,
|
583
|
-
},
|
584
|
-
});
|
585
|
-
}
|
586
|
-
static buildLoadOptions() {
|
587
|
-
return this.router.buildLoadOptions();
|
588
|
-
}
|
589
|
-
static ScopedByOrgVc() {
|
590
|
-
return this.fixture.Controller('scopedByOrg', {});
|
591
|
-
}
|
592
|
-
static ScopedByLocationVc() {
|
593
|
-
return this.fixture.Controller('scopedByLocation', {});
|
594
|
-
}
|
595
|
-
static loginAsDemoPerson() {
|
596
|
-
return __awaiter(this, void 0, void 0, function* () {
|
597
|
-
const { client } = yield this.fixture.loginAsDemoPerson(DEMO_NUMBER_VIEW_FIXTURE_CLIENT_2);
|
598
|
-
return client;
|
599
|
-
});
|
600
|
-
}
|
601
|
-
static loginAndGetProxy(phone) {
|
602
|
-
return __awaiter(this, void 0, void 0, function* () {
|
603
|
-
const { client } = yield this.fixtureNoOptions.loginAsDemoPerson(phone !== null && phone !== void 0 ? phone : DEMO_NUMBER_VIEW_FIXTURE);
|
604
|
-
const generator = this.getProxyGenerator();
|
605
|
-
const token = yield (generator === null || generator === void 0 ? void 0 : generator());
|
606
|
-
return { client, token, generator };
|
607
|
-
});
|
608
|
-
}
|
609
|
-
static getProxyGenerator() {
|
610
|
-
const decorator = ClientProxyDecorator.getInstance();
|
611
|
-
const generator = decorator.getProxyTokenGenerator();
|
612
|
-
return generator;
|
613
|
-
}
|
614
|
-
static Scope() {
|
615
|
-
const factory = this.fixture.getFactory();
|
616
|
-
const vc = factory.Controller('scope', {});
|
617
|
-
return { vc, fixture: this.fixture };
|
618
|
-
}
|
619
|
-
static MockVc(named = 'card') {
|
620
|
-
const viewFixture = this.Fixture('view', {
|
621
|
-
controllerMap: {
|
622
|
-
card: FakeSkillViewController,
|
623
|
-
logging: LoggingViewController,
|
624
|
-
},
|
625
|
-
});
|
626
|
-
const factory = viewFixture.getFactory();
|
627
|
-
const vc = factory.Controller(named, {
|
628
|
-
header: { title: 'hey' },
|
629
|
-
});
|
630
|
-
return vc;
|
631
|
-
}
|
632
|
-
static get router() {
|
633
|
-
return this.fixture.getRouter();
|
634
|
-
}
|
635
|
-
};
|
636
|
-
__decorate([
|
637
|
-
test()
|
638
|
-
], ViewFixtureTest, "canLogin", null);
|
639
|
-
__decorate([
|
640
|
-
test()
|
641
|
-
], ViewFixtureTest, "loginFallsBackToDemoNumber", null);
|
642
|
-
__decorate([
|
643
|
-
test()
|
644
|
-
], ViewFixtureTest, "canSetHeartwoodRoot", null);
|
645
|
-
__decorate([
|
646
|
-
test()
|
647
|
-
], ViewFixtureTest, "fixturesShouldShareConnectToApiReferences", null);
|
648
|
-
__decorate([
|
649
|
-
test()
|
650
|
-
], ViewFixtureTest, "canPassThroughPersonFixture", null);
|
651
|
-
__decorate([
|
652
|
-
test()
|
653
|
-
], ViewFixtureTest, "feedsInScope", null);
|
654
|
-
__decorate([
|
655
|
-
test()
|
656
|
-
], ViewFixtureTest, "scopeCanGetAndSetOrganization", null);
|
657
|
-
__decorate([
|
658
|
-
test()
|
659
|
-
], ViewFixtureTest, "scopeGetsLastOrgByDefault", null);
|
660
|
-
__decorate([
|
661
|
-
test()
|
662
|
-
], ViewFixtureTest, "scopeGetsLastLocationByDefault", null);
|
663
|
-
__decorate([
|
664
|
-
test()
|
665
|
-
], ViewFixtureTest, "scopeCanGetAndSetLocation", null);
|
666
|
-
__decorate([
|
667
|
-
test()
|
668
|
-
], ViewFixtureTest, "sharesPersonFixture", null);
|
669
|
-
__decorate([
|
670
|
-
test()
|
671
|
-
], ViewFixtureTest, "canSetScopeForCurrentOrganizationAcrossViewFixtures", null);
|
672
|
-
__decorate([
|
673
|
-
test()
|
674
|
-
], ViewFixtureTest, "scopeShouldBeResetEachRun", null);
|
675
|
-
__decorate([
|
676
|
-
test()
|
677
|
-
], ViewFixtureTest, "fixturesShareVcFactory", null);
|
678
|
-
__decorate([
|
679
|
-
test()
|
680
|
-
], ViewFixtureTest, "mixesInControllerMapWithLocalViews", null);
|
681
|
-
__decorate([
|
682
|
-
test()
|
683
|
-
], ViewFixtureTest, "fixturesContinueToMixinViewControllers", null);
|
684
|
-
__decorate([
|
685
|
-
test()
|
686
|
-
], ViewFixtureTest, "fixtureAttachesRenderCount", null);
|
687
|
-
__decorate([
|
688
|
-
test()
|
689
|
-
], ViewFixtureTest, "fixturePatchesAlertToThrow", null);
|
690
|
-
__decorate([
|
691
|
-
test()
|
692
|
-
], ViewFixtureTest, "fixturePatchesRenderInDialogToThrow", null);
|
693
|
-
__decorate([
|
694
|
-
test()
|
695
|
-
], ViewFixtureTest, "testRouterThrowsOnRedirect", null);
|
696
|
-
__decorate([
|
697
|
-
test()
|
698
|
-
], ViewFixtureTest, "canGetAuthenticatorInstance", null);
|
699
|
-
__decorate([
|
700
|
-
test()
|
701
|
-
], ViewFixtureTest, "activeRecordThrowsByDefault", null);
|
702
|
-
__decorate([
|
703
|
-
test()
|
704
|
-
], ViewFixtureTest, "activeRecordThrowReset", null);
|
705
|
-
__decorate([
|
706
|
-
test()
|
707
|
-
], ViewFixtureTest, "loggingInWithViewFixtureSetsProxyTokenForSkill", null);
|
708
|
-
__decorate([
|
709
|
-
test()
|
710
|
-
], ViewFixtureTest, "proxyGeneratorIsResetWhenDifferentPersonLogsIn", null);
|
711
|
-
__decorate([
|
712
|
-
test()
|
713
|
-
], ViewFixtureTest, "sameProxyAcrossFixturesWithSameNumber", null);
|
714
|
-
__decorate([
|
715
|
-
test()
|
716
|
-
], ViewFixtureTest, "generatorResetEachTest", null);
|
717
|
-
__decorate([
|
718
|
-
test()
|
719
|
-
], ViewFixtureTest, "loggingInAsViewSetsClientForViewControllers", null);
|
720
|
-
__decorate([
|
721
|
-
test()
|
722
|
-
], ViewFixtureTest, "viewClientIsResetAfterEachTest", null);
|
723
|
-
__decorate([
|
724
|
-
test()
|
725
|
-
], ViewFixtureTest, "generatorIsNotVulnerableToRaceConditions", null);
|
726
|
-
__decorate([
|
727
|
-
test()
|
728
|
-
], ViewFixtureTest, "patchesConfirmToThrow", null);
|
729
|
-
__decorate([
|
730
|
-
test()
|
731
|
-
], ViewFixtureTest, "setsSwipeVcJumpToSlideDuration", null);
|
732
|
-
__decorate([
|
733
|
-
test()
|
734
|
-
], ViewFixtureTest, "canSetScope", null);
|
735
|
-
__decorate([
|
736
|
-
test()
|
737
|
-
], ViewFixtureTest, "loadingAScopedToOrgVcWithoutASeededOrgThrows", null);
|
738
|
-
__decorate([
|
739
|
-
test()
|
740
|
-
], ViewFixtureTest, "loadingAScopedToLocationVcWithoutASeededLocationThrows", null);
|
741
|
-
__decorate([
|
742
|
-
test(),
|
743
|
-
seed('organizations', 1)
|
744
|
-
], ViewFixtureTest, "loadingWithOrgScopeAndSeededOrg", null);
|
745
|
-
__decorate([
|
746
|
-
test(),
|
747
|
-
seed('locations', 1)
|
748
|
-
], ViewFixtureTest, "loadingWithLocationScopeAndSeededLocation", null);
|
749
|
-
__decorate([
|
750
|
-
test()
|
751
|
-
], ViewFixtureTest, "setsFactoryToFormAssert", null);
|
752
|
-
__decorate([
|
753
|
-
test()
|
754
|
-
], ViewFixtureTest, "canSetMercuryClient", null);
|
755
|
-
__decorate([
|
756
|
-
test()
|
757
|
-
], ViewFixtureTest, "loadOptionsComeWithFakeThemeManager", null);
|
758
|
-
__decorate([
|
759
|
-
test()
|
760
|
-
], ViewFixtureTest, "sameFakeThemeEachTime", null);
|
761
|
-
__decorate([
|
762
|
-
test()
|
763
|
-
], ViewFixtureTest, "sameThemesOnFixture", null);
|
764
|
-
__decorate([
|
765
|
-
test()
|
766
|
-
], ViewFixtureTest, "canSetController", null);
|
767
|
-
__decorate([
|
768
|
-
test()
|
769
|
-
], ViewFixtureTest, "deviceIsSetOnFixtureAndFactory", null);
|
770
|
-
__decorate([
|
771
|
-
test()
|
772
|
-
], ViewFixtureTest, "newDeviceBeforeEach", null);
|
773
|
-
__decorate([
|
774
|
-
test()
|
775
|
-
], ViewFixtureTest, "mutesLogs", null);
|
776
|
-
__decorate([
|
777
|
-
test()
|
778
|
-
], ViewFixtureTest, "buildVcPluginExposedInFixture", null);
|
779
|
-
__decorate([
|
780
|
-
test()
|
781
|
-
], ViewFixtureTest, "addPluginExposedInFixure", null);
|
782
|
-
__decorate([
|
783
|
-
test()
|
784
|
-
], ViewFixtureTest, "getFactoryReturnsSpyFactory", null);
|
785
|
-
__decorate([
|
786
|
-
test()
|
787
|
-
], ViewFixtureTest, "spyFactoryResetForEachTestIfDeleted", null);
|
788
|
-
__decorate([
|
789
|
-
test()
|
790
|
-
], ViewFixtureTest, "getFactoryReturnsSpyFactoryForNextTest", null);
|
791
|
-
ViewFixtureTest = __decorate([
|
792
|
-
fake.login(DEMO_NUMBER_FORMATTED)
|
793
|
-
], ViewFixtureTest);
|
794
|
-
export default ViewFixtureTest;
|
795
|
-
class LoggingViewController extends AbstractViewController {
|
796
|
-
getLog() {
|
797
|
-
return this.log;
|
798
|
-
}
|
799
|
-
render() {
|
800
|
-
return {};
|
801
|
-
}
|
802
|
-
}
|
803
|
-
class ScopeSvc extends AbstractSkillViewController {
|
804
|
-
constructor() {
|
805
|
-
super(...arguments);
|
806
|
-
this.loadOptions = null;
|
807
|
-
}
|
808
|
-
load(options) {
|
809
|
-
return __awaiter(this, void 0, void 0, function* () {
|
810
|
-
this.loadOptions = options;
|
811
|
-
});
|
812
|
-
}
|
813
|
-
render() {
|
814
|
-
return {
|
815
|
-
layouts: [],
|
816
|
-
};
|
817
|
-
}
|
818
|
-
}
|
819
|
-
class ScopedByOrgSvc extends AbstractSkillViewController {
|
820
|
-
constructor() {
|
821
|
-
super(...arguments);
|
822
|
-
this.getScope = () => ['organization'];
|
823
|
-
}
|
824
|
-
render() {
|
825
|
-
return {
|
826
|
-
layouts: [],
|
827
|
-
};
|
828
|
-
}
|
829
|
-
}
|
830
|
-
class ScopedByLocationSvc extends AbstractSkillViewController {
|
831
|
-
constructor() {
|
832
|
-
super(...arguments);
|
833
|
-
this.getScope = () => ['location'];
|
834
|
-
}
|
835
|
-
render() {
|
836
|
-
return {
|
837
|
-
layouts: [],
|
838
|
-
};
|
839
|
-
}
|
840
|
-
}
|
841
|
-
class ClientSvc extends AbstractSkillViewController {
|
842
|
-
constructor() {
|
843
|
-
super(...arguments);
|
844
|
-
this.loadOptions = null;
|
845
|
-
}
|
846
|
-
connect() {
|
847
|
-
return this.connectToApi();
|
848
|
-
}
|
849
|
-
render() {
|
850
|
-
return {
|
851
|
-
layouts: [],
|
852
|
-
};
|
853
|
-
}
|
854
|
-
}
|
855
|
-
class SpyVcPlugin {
|
856
|
-
}
|