@sprucelabs/spruce-test-fixtures 62.2.24 → 62.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/esm/index.d.ts +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/tests/fixtures/ViewFixture.d.ts +1 -1
- package/build/esm/tests/routers/TestRouter.d.ts +1 -1
- package/build/esm/tests/routers/TestRouter.js +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/tests/fixtures/ViewFixture.d.ts +1 -1
- package/build/tests/routers/TestRouter.d.ts +1 -1
- package/build/tests/routers/TestRouter.js +1 -1
- package/package.json +19 -19
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -112
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -34
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -26
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -69
- package/build/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
- package/build/__tests__/behavioral/FakingEventResponses.test.js +0 -126
- package/build/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
- package/build/__tests__/behavioral/FixtureFactory.test.js +0 -79
- package/build/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
- package/build/__tests__/behavioral/LocationFixture.test.js +0 -144
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -95
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -35
- package/build/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
- package/build/__tests__/behavioral/MercuryFixture.test.js +0 -187
- package/build/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
- package/build/__tests__/behavioral/OrganizationFixture.test.js +0 -333
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -21
- package/build/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
- package/build/__tests__/behavioral/PersonFixture.test.js +0 -225
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -95
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -67
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -44
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -55
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -137
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -54
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -40
- package/build/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
- package/build/__tests__/behavioral/RoleFixture.test.js +0 -118
- package/build/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
- package/build/__tests__/behavioral/SkillFixture.test.js +0 -118
- package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
- package/build/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -41
- package/build/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
- package/build/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -59
- package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
- package/build/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -34
- package/build/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
- package/build/__tests__/behavioral/databases/DummyStore.js +0 -36
- package/build/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
- package/build/__tests__/behavioral/databases/StoreFixture.test.js +0 -156
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -73
- package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
- package/build/__tests__/behavioral/faking/FakeDecorator.test.js +0 -421
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -23
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -27
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -93
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -56
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -141
- package/build/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
- package/build/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -35
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -42
- package/build/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
- package/build/__tests__/behavioral/faking/FakingLocations.test.js +0 -45
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -140
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -174
- package/build/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
- package/build/__tests__/behavioral/faking/UpdatePerson.test.js +0 -32
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -321
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -48
- package/build/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
- package/build/__tests__/behavioral/faking/WhoAmI.test.js +0 -105
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -76
- package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
- package/build/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -272
- package/build/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
- package/build/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -35
- package/build/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
- package/build/__tests__/behavioral/seeding/SeedingData.test.js +0 -271
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -266
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -117
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -55
- package/build/__tests__/behavioral/views/Routing.test.d.ts +0 -36
- package/build/__tests__/behavioral/views/Routing.test.js +0 -177
- package/build/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
- package/build/__tests__/behavioral/views/TestingScope.test.js +0 -197
- package/build/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
- package/build/__tests__/behavioral/views/ViewPlugins.test.js +0 -83
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -55
- package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
- package/build/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -761
- package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
- package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -29
- package/build/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
- package/build/__tests__/support/AbstractFakeDecoratorTest.js +0 -27
- package/build/__tests__/support/EventFaker.d.ts +0 -5
- package/build/__tests__/support/EventFaker.js +0 -36
- package/build/__tests__/support/RandomViewPlugin.d.ts +0 -2
- package/build/__tests__/support/RandomViewPlugin.js +0 -5
- package/build/__tests__/support/RandomViewPlugin2.d.ts +0 -2
- package/build/__tests__/support/RandomViewPlugin2.js +0 -5
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.d.ts +0 -5
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.js +0 -9
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -33
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/src/.spruce/settings.json +0 -6
- package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.d.ts +0 -6
- package/build/__tests__/testDirsAndFiles/plugins1/build/.spruce/views/views.js +0 -11
- package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.d.ts +0 -6
- package/build/__tests__/testDirsAndFiles/plugins2/build/.spruce/views/views.js +0 -11
- package/build/__tests__/testDirsAndFiles/skill/build/.spruce/views/views.js +0 -18
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -11
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -19
- package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
- package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -31
- package/build/__tests__/testDirsAndFiles/skill/package.json +0 -5
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/settings.json +0 -6
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.d.ts +0 -7
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.js +0 -17
- package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
- package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -11
- package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
- package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -31
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +0 -15
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +0 -128
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +0 -40
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +0 -23
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +0 -8
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +0 -80
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.d.ts +0 -12
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +0 -148
- package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +0 -7
- package/build/esm/__tests__/behavioral/FixtureFactory.test.js +0 -61
- package/build/esm/__tests__/behavioral/LocationFixture.test.d.ts +0 -17
- package/build/esm/__tests__/behavioral/LocationFixture.test.js +0 -173
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +0 -12
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +0 -113
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +0 -41
- package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +0 -20
- package/build/esm/__tests__/behavioral/MercuryFixture.test.js +0 -223
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.d.ts +0 -31
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +0 -389
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +0 -18
- package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +0 -22
- package/build/esm/__tests__/behavioral/PersonFixture.test.js +0 -232
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +0 -11
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +0 -112
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +0 -8
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +0 -84
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +0 -55
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +0 -8
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +0 -72
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +0 -10
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +0 -146
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +0 -7
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +0 -66
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +0 -6
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +0 -51
- package/build/esm/__tests__/behavioral/RoleFixture.test.d.ts +0 -15
- package/build/esm/__tests__/behavioral/RoleFixture.test.js +0 -143
- package/build/esm/__tests__/behavioral/SkillFixture.test.d.ts +0 -13
- package/build/esm/__tests__/behavioral/SkillFixture.test.js +0 -141
- package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.d.ts +0 -7
- package/build/esm/__tests__/behavioral/databases/CanUseStoresSetupInBeforeEach.test.js +0 -53
- package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.d.ts +0 -7
- package/build/esm/__tests__/behavioral/databases/DatabaseFixture.test.js +0 -48
- package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/databases/DbResetsAsExpected.test.js +0 -28
- package/build/esm/__tests__/behavioral/databases/DummyStore.d.ts +0 -55
- package/build/esm/__tests__/behavioral/databases/DummyStore.js +0 -43
- package/build/esm/__tests__/behavioral/databases/StoreFixture.test.d.ts +0 -23
- package/build/esm/__tests__/behavioral/databases/StoreFixture.test.js +0 -164
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +0 -9
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +0 -89
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +0 -45
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +0 -482
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +0 -28
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +0 -32
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +0 -8
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +0 -82
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +0 -8
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +0 -70
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +0 -14
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +0 -165
- package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.js +0 -43
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +0 -6
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +0 -55
- package/build/esm/__tests__/behavioral/faking/FakingLocations.test.d.ts +0 -6
- package/build/esm/__tests__/behavioral/faking/FakingLocations.test.js +0 -55
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +0 -19
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +0 -175
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +0 -24
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +0 -214
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +0 -38
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +0 -35
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +0 -360
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +0 -31
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.d.ts +0 -19
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +0 -142
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +0 -10
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +0 -94
- package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.d.ts +0 -34
- package/build/esm/__tests__/behavioral/permissions/FakeAuthorizer.test.js +0 -324
- package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/permissions/PermissionFixture.test.js +0 -43
- package/build/esm/__tests__/behavioral/seeding/SeedingData.test.d.ts +0 -24
- package/build/esm/__tests__/behavioral/seeding/SeedingData.test.js +0 -314
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +0 -37
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +0 -322
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +0 -14
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +0 -138
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +0 -12
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +0 -70
- package/build/esm/__tests__/behavioral/views/Routing.test.d.ts +0 -36
- package/build/esm/__tests__/behavioral/views/Routing.test.js +0 -212
- package/build/esm/__tests__/behavioral/views/TestingScope.test.d.ts +0 -24
- package/build/esm/__tests__/behavioral/views/TestingScope.test.js +0 -238
- package/build/esm/__tests__/behavioral/views/ViewPlugins.test.d.ts +0 -12
- package/build/esm/__tests__/behavioral/views/ViewPlugins.test.js +0 -103
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +0 -11
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +0 -64
- package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.d.ts +0 -118
- package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixture.test.js +0 -856
- package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +0 -5
- package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +0 -39
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.d.ts +0 -5
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +0 -34
- package/build/esm/__tests__/support/EventFaker.d.ts +0 -5
- package/build/esm/__tests__/support/EventFaker.js +0 -45
- package/build/esm/__tests__/support/RandomViewPlugin.d.ts +0 -2
- package/build/esm/__tests__/support/RandomViewPlugin.js +0 -2
- package/build/esm/__tests__/support/RandomViewPlugin2.d.ts +0 -2
- package/build/esm/__tests__/support/RandomViewPlugin2.js +0 -2
- package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +0 -51
- package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +0 -41
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +0 -5
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +0 -9
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +0 -7
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +0 -28
- package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +0 -8
- package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +0 -26
- package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +0 -5
- package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +0 -9
- package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +0 -8
- package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +0 -26
- /package/build/{__tests__/support → esm/tests}/FakeThemeManager.d.ts +0 -0
- /package/build/esm/{__tests__/support → tests}/FakeThemeManager.js +0 -0
- /package/build/{esm/__tests__/support → tests}/FakeThemeManager.d.ts +0 -0
- /package/build/{__tests__/support → tests}/FakeThemeManager.js +0 -0
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { AuthorizerCanOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
|
|
3
|
-
export default class CheckingPermissionsTest extends AbstractSpruceFixtureTest {
|
|
4
|
-
private static contractId;
|
|
5
|
-
protected static beforeEach(): Promise<void>;
|
|
6
|
-
protected static canCreateCheckingPermissions(): Promise<void>;
|
|
7
|
-
protected static sharesInstances(): Promise<void>;
|
|
8
|
-
protected static permsFixtureResetsInstance(): Promise<void>;
|
|
9
|
-
protected static throwsWhenMissingOnCan(): Promise<void>;
|
|
10
|
-
protected static throwsWhenNotSettingResponse(): Promise<void>;
|
|
11
|
-
protected static throwsWhenContractIdNotFaked(): Promise<void>;
|
|
12
|
-
protected static doesNotThrowWhenMatchingSecondContractId(): Promise<void>;
|
|
13
|
-
protected static throwsWhenNotFindingPermissionId(): Promise<void>;
|
|
14
|
-
protected static throwsWhenFindingLaterMissingPermId(): Promise<void>;
|
|
15
|
-
protected static returnsFakedResponses(permissionIds: string[], can: boolean): Promise<void>;
|
|
16
|
-
protected static fixtureAndLoadOptionsShareAuthorizer(): Promise<void>;
|
|
17
|
-
protected static authorizerClobbersMatchingContracts(): Promise<void>;
|
|
18
|
-
protected static usesLatestMatchWhenMultipleSent(): Promise<void>;
|
|
19
|
-
protected static canHandleMulplePermissionsWithDifferentContracts(): Promise<void>;
|
|
20
|
-
protected static sameAuthorizerAsViews(): Promise<void>;
|
|
21
|
-
protected static sameAuthenticatorAsViews(): Promise<void>;
|
|
22
|
-
protected static canSpyOnSavePermissions(): Promise<void>;
|
|
23
|
-
protected static canSeeLastCanOptions(can: AuthorizerCanOptions<any>): Promise<void>;
|
|
24
|
-
private static assertCanOptionsMatch;
|
|
25
|
-
private static assertSpysOnOptionsWhenSaving;
|
|
26
|
-
private static assertPermNotFound;
|
|
27
|
-
private static changeContractId;
|
|
28
|
-
private static assertThrowsFakeError;
|
|
29
|
-
private static fakePermissions;
|
|
30
|
-
private static can;
|
|
31
|
-
private static setupEmptyViewFixture;
|
|
32
|
-
private static get instance();
|
|
33
|
-
private static get auth();
|
|
34
|
-
}
|
|
@@ -1,272 +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 test_utils_1 = require("@sprucelabs/test-utils");
|
|
13
|
-
const test_utils_2 = require("@sprucelabs/test-utils");
|
|
14
|
-
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
|
|
15
|
-
const FakeAuthorizer_1 = __importDefault(require("../../../tests/FakeAuthorizer"));
|
|
16
|
-
const PermissionFixture_1 = __importDefault(require("../../../tests/fixtures/PermissionFixture"));
|
|
17
|
-
class CheckingPermissionsTest extends AbstractSpruceFixtureTest_1.default {
|
|
18
|
-
static async beforeEach() {
|
|
19
|
-
await super.beforeEach();
|
|
20
|
-
this.contractId = (0, test_utils_2.generateId)();
|
|
21
|
-
}
|
|
22
|
-
static async canCreateCheckingPermissions() {
|
|
23
|
-
test_utils_1.assert.isTrue(this.instance instanceof FakeAuthorizer_1.default);
|
|
24
|
-
}
|
|
25
|
-
static async sharesInstances() {
|
|
26
|
-
test_utils_1.assert.isEqual(this.instance, this.instance);
|
|
27
|
-
}
|
|
28
|
-
static async permsFixtureResetsInstance() {
|
|
29
|
-
const instance = this.instance;
|
|
30
|
-
PermissionFixture_1.default.beforeEach();
|
|
31
|
-
test_utils_1.assert.isNotEqual(this.instance, instance);
|
|
32
|
-
}
|
|
33
|
-
static async throwsWhenMissingOnCan() {
|
|
34
|
-
const err = await test_utils_1.assert.doesThrowAsync(() =>
|
|
35
|
-
//@ts-ignore
|
|
36
|
-
this.instance.can());
|
|
37
|
-
test_utils_2.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
38
|
-
parameters: ['contractId', 'permissionIds'],
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
static async throwsWhenNotSettingResponse() {
|
|
42
|
-
await this.assertThrowsFakeError();
|
|
43
|
-
}
|
|
44
|
-
static async throwsWhenContractIdNotFaked() {
|
|
45
|
-
this.fakePermissions([{ id: 'test', can: true }]);
|
|
46
|
-
this.changeContractId();
|
|
47
|
-
await this.assertThrowsFakeError();
|
|
48
|
-
}
|
|
49
|
-
static async doesNotThrowWhenMatchingSecondContractId() {
|
|
50
|
-
this.fakePermissions([{ id: 'test', can: true }]);
|
|
51
|
-
this.changeContractId();
|
|
52
|
-
this.fakePermissions([{ id: 'test2', can: true }]);
|
|
53
|
-
await this.can(['test2']);
|
|
54
|
-
}
|
|
55
|
-
static async throwsWhenNotFindingPermissionId() {
|
|
56
|
-
this.fakePermissions([{ id: 'test', can: true }]);
|
|
57
|
-
await this.assertPermNotFound(['test2'], 'test2');
|
|
58
|
-
}
|
|
59
|
-
static async throwsWhenFindingLaterMissingPermId() {
|
|
60
|
-
this.fakePermissions([{ id: 'test', can: true }]);
|
|
61
|
-
await this.assertPermNotFound(['test', 'test2'], 'test2');
|
|
62
|
-
}
|
|
63
|
-
static async returnsFakedResponses(permissionIds, can) {
|
|
64
|
-
const faked = [];
|
|
65
|
-
const expected = {};
|
|
66
|
-
permissionIds.forEach((id) => ((expected[id] = can), faked.push({ id, can })));
|
|
67
|
-
this.fakePermissions(faked);
|
|
68
|
-
const results = await this.can(permissionIds);
|
|
69
|
-
test_utils_1.assert.isEqualDeep(results, expected);
|
|
70
|
-
}
|
|
71
|
-
static async fixtureAndLoadOptionsShareAuthorizer() {
|
|
72
|
-
this.setupEmptyViewFixture();
|
|
73
|
-
const auth = this.auth;
|
|
74
|
-
const router = this.views.getRouter();
|
|
75
|
-
test_utils_1.assert.isEqual(auth, router.buildLoadOptions().authorizer);
|
|
76
|
-
}
|
|
77
|
-
static async authorizerClobbersMatchingContracts() {
|
|
78
|
-
this.fakePermissions([{ id: 'test', can: true }]);
|
|
79
|
-
this.fakePermissions([{ id: 'test', can: false }]);
|
|
80
|
-
const perms = await this.can(['test']);
|
|
81
|
-
test_utils_1.assert.isFalse(perms['test']);
|
|
82
|
-
}
|
|
83
|
-
static async usesLatestMatchWhenMultipleSent() {
|
|
84
|
-
this.fakePermissions([
|
|
85
|
-
{ id: 'test', can: false },
|
|
86
|
-
{ id: 'test2', can: false },
|
|
87
|
-
]);
|
|
88
|
-
this.fakePermissions([
|
|
89
|
-
{ id: 'test', can: true },
|
|
90
|
-
{ id: 'test2', can: false },
|
|
91
|
-
]);
|
|
92
|
-
const perms = await this.can(['test', 'test2']);
|
|
93
|
-
test_utils_1.assert.isTrue(perms['test']);
|
|
94
|
-
test_utils_1.assert.isFalse(perms['test2']);
|
|
95
|
-
}
|
|
96
|
-
static async canHandleMulplePermissionsWithDifferentContracts() {
|
|
97
|
-
const firstId = this.contractId;
|
|
98
|
-
this.fakePermissions([{ id: 'test', can: true }]);
|
|
99
|
-
this.changeContractId();
|
|
100
|
-
this.fakePermissions([{ id: 'test', can: false }]);
|
|
101
|
-
this.contractId = firstId;
|
|
102
|
-
const perms = await this.can(['test']);
|
|
103
|
-
test_utils_1.assert.isTrue(perms['test']);
|
|
104
|
-
}
|
|
105
|
-
static async sameAuthorizerAsViews() {
|
|
106
|
-
this.setupEmptyViewFixture();
|
|
107
|
-
const auth1 = this.views.getAuthorizer();
|
|
108
|
-
const auth2 = this.permissions.getAuthorizer();
|
|
109
|
-
test_utils_1.assert.isEqual(auth1, auth2);
|
|
110
|
-
}
|
|
111
|
-
static async sameAuthenticatorAsViews() {
|
|
112
|
-
this.setupEmptyViewFixture();
|
|
113
|
-
const auth1 = this.views.getAuthenticator();
|
|
114
|
-
const auth2 = this.permissions.getAuthenticator();
|
|
115
|
-
test_utils_1.assert.isEqual(auth1, auth2);
|
|
116
|
-
}
|
|
117
|
-
static async canSpyOnSavePermissions() {
|
|
118
|
-
await this.assertSpysOnOptionsWhenSaving({
|
|
119
|
-
contractId: 'events-contract',
|
|
120
|
-
target: {},
|
|
121
|
-
permissions: [],
|
|
122
|
-
});
|
|
123
|
-
await this.assertSpysOnOptionsWhenSaving({
|
|
124
|
-
contractId: 'feed-contract',
|
|
125
|
-
target: {
|
|
126
|
-
locationId: (0, test_utils_2.generateId)(),
|
|
127
|
-
personId: (0, test_utils_2.generateId)(),
|
|
128
|
-
},
|
|
129
|
-
permissions: [
|
|
130
|
-
{
|
|
131
|
-
id: 'can-see-other-persons-feed',
|
|
132
|
-
can: {
|
|
133
|
-
clockedIn: true,
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
static async canSeeLastCanOptions(can) {
|
|
140
|
-
await this.assertCanOptionsMatch(can);
|
|
141
|
-
}
|
|
142
|
-
static async assertCanOptionsMatch(can) {
|
|
143
|
-
const { contractId } = can;
|
|
144
|
-
this.auth.fakePermissions({
|
|
145
|
-
contractId: contractId,
|
|
146
|
-
permissions: [
|
|
147
|
-
{
|
|
148
|
-
id: 'can-register-global-events',
|
|
149
|
-
can: true,
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
id: 'can-register-global-events-2',
|
|
153
|
-
can: true,
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: 'can-register-global-events-3',
|
|
157
|
-
can: true,
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
});
|
|
161
|
-
await this.auth.can(can);
|
|
162
|
-
test_utils_1.assert.isEqualDeep(this.auth.getLastCanOptions(), can);
|
|
163
|
-
}
|
|
164
|
-
static async assertSpysOnOptionsWhenSaving(options) {
|
|
165
|
-
await this.auth.savePermissions(options);
|
|
166
|
-
test_utils_1.assert.isEqualDeep(this.auth.getLastSavePermissionsOptions(), options);
|
|
167
|
-
}
|
|
168
|
-
static async assertPermNotFound(checkIds, id) {
|
|
169
|
-
await test_utils_1.assert.doesThrowAsync(() => this.can(checkIds), id);
|
|
170
|
-
}
|
|
171
|
-
static changeContractId() {
|
|
172
|
-
this.contractId = (0, test_utils_2.generateId)();
|
|
173
|
-
}
|
|
174
|
-
static async assertThrowsFakeError() {
|
|
175
|
-
await test_utils_1.assert.doesThrowAsync(() => this.can(['test']), `Contract with the id '${this.contractId}'`);
|
|
176
|
-
}
|
|
177
|
-
static fakePermissions(faked) {
|
|
178
|
-
this.instance.fakePermissions({
|
|
179
|
-
contractId: this.contractId,
|
|
180
|
-
permissions: faked,
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
static can(permissionIds) {
|
|
184
|
-
return this.instance.can({
|
|
185
|
-
contractId: this.contractId,
|
|
186
|
-
permissionIds: permissionIds,
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
static setupEmptyViewFixture() {
|
|
190
|
-
this.views = this.Fixture('view', {
|
|
191
|
-
controllerMap: {},
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
static get instance() {
|
|
195
|
-
return this.permissions.getAuthorizer();
|
|
196
|
-
}
|
|
197
|
-
static get auth() {
|
|
198
|
-
return this.permissions.getAuthorizer();
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
exports.default = CheckingPermissionsTest;
|
|
202
|
-
__decorate([
|
|
203
|
-
(0, test_utils_1.test)()
|
|
204
|
-
], CheckingPermissionsTest, "canCreateCheckingPermissions", null);
|
|
205
|
-
__decorate([
|
|
206
|
-
(0, test_utils_1.test)()
|
|
207
|
-
], CheckingPermissionsTest, "sharesInstances", null);
|
|
208
|
-
__decorate([
|
|
209
|
-
(0, test_utils_1.test)()
|
|
210
|
-
], CheckingPermissionsTest, "permsFixtureResetsInstance", null);
|
|
211
|
-
__decorate([
|
|
212
|
-
(0, test_utils_1.test)()
|
|
213
|
-
], CheckingPermissionsTest, "throwsWhenMissingOnCan", null);
|
|
214
|
-
__decorate([
|
|
215
|
-
(0, test_utils_1.test)()
|
|
216
|
-
], CheckingPermissionsTest, "throwsWhenNotSettingResponse", null);
|
|
217
|
-
__decorate([
|
|
218
|
-
(0, test_utils_1.test)()
|
|
219
|
-
], CheckingPermissionsTest, "throwsWhenContractIdNotFaked", null);
|
|
220
|
-
__decorate([
|
|
221
|
-
(0, test_utils_1.test)()
|
|
222
|
-
], CheckingPermissionsTest, "doesNotThrowWhenMatchingSecondContractId", null);
|
|
223
|
-
__decorate([
|
|
224
|
-
(0, test_utils_1.test)()
|
|
225
|
-
], CheckingPermissionsTest, "throwsWhenNotFindingPermissionId", null);
|
|
226
|
-
__decorate([
|
|
227
|
-
(0, test_utils_1.test)()
|
|
228
|
-
], CheckingPermissionsTest, "throwsWhenFindingLaterMissingPermId", null);
|
|
229
|
-
__decorate([
|
|
230
|
-
(0, test_utils_1.test)('returns false on can 1', ['first', 'second', 'third'], false),
|
|
231
|
-
(0, test_utils_1.test)('returns false on can 2', ['third', 'fourth'], false),
|
|
232
|
-
(0, test_utils_1.test)('returns false on can 3', ['first', 'second', 'third'], true),
|
|
233
|
-
(0, test_utils_1.test)('returns false on can 4', ['third', 'fourth'], true)
|
|
234
|
-
], CheckingPermissionsTest, "returnsFakedResponses", null);
|
|
235
|
-
__decorate([
|
|
236
|
-
(0, test_utils_1.test)()
|
|
237
|
-
], CheckingPermissionsTest, "fixtureAndLoadOptionsShareAuthorizer", null);
|
|
238
|
-
__decorate([
|
|
239
|
-
(0, test_utils_1.test)()
|
|
240
|
-
], CheckingPermissionsTest, "authorizerClobbersMatchingContracts", null);
|
|
241
|
-
__decorate([
|
|
242
|
-
(0, test_utils_1.test)()
|
|
243
|
-
], CheckingPermissionsTest, "usesLatestMatchWhenMultipleSent", null);
|
|
244
|
-
__decorate([
|
|
245
|
-
(0, test_utils_1.test)()
|
|
246
|
-
], CheckingPermissionsTest, "canHandleMulplePermissionsWithDifferentContracts", null);
|
|
247
|
-
__decorate([
|
|
248
|
-
(0, test_utils_1.test)()
|
|
249
|
-
], CheckingPermissionsTest, "sameAuthorizerAsViews", null);
|
|
250
|
-
__decorate([
|
|
251
|
-
(0, test_utils_1.test)()
|
|
252
|
-
], CheckingPermissionsTest, "sameAuthenticatorAsViews", null);
|
|
253
|
-
__decorate([
|
|
254
|
-
(0, test_utils_1.test)()
|
|
255
|
-
], CheckingPermissionsTest, "canSpyOnSavePermissions", null);
|
|
256
|
-
__decorate([
|
|
257
|
-
(0, test_utils_1.test)('can see last can options 1', {
|
|
258
|
-
contractId: 'events-contract',
|
|
259
|
-
permissionIds: ['can-register-global-events'],
|
|
260
|
-
target: {},
|
|
261
|
-
}),
|
|
262
|
-
(0, test_utils_1.test)('can see last can options 2', {
|
|
263
|
-
contractId: 'events-contract-2',
|
|
264
|
-
permissionIds: [
|
|
265
|
-
'can-register-global-events',
|
|
266
|
-
'can-register-global-events-2',
|
|
267
|
-
],
|
|
268
|
-
target: {
|
|
269
|
-
personId: (0, test_utils_2.generateId)(),
|
|
270
|
-
},
|
|
271
|
-
})
|
|
272
|
-
], CheckingPermissionsTest, "canSeeLastCanOptions", null);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
|
|
2
|
-
export default class PermissionFixtureTest extends AbstractSpruceFixtureTest {
|
|
3
|
-
protected static disablesPermissionsAtStart(): Promise<void>;
|
|
4
|
-
protected static permissionFixtureShouldUseSharedInstance(): Promise<void>;
|
|
5
|
-
}
|
|
@@ -1,35 +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 spruce_permission_utils_1 = require("@sprucelabs/spruce-permission-utils");
|
|
13
|
-
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
14
|
-
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
|
|
15
|
-
const fake_1 = __importDefault(require("../../../tests/decorators/fake"));
|
|
16
|
-
let PermissionFixtureTest = class PermissionFixtureTest extends AbstractSpruceFixtureTest_1.default {
|
|
17
|
-
static async disablesPermissionsAtStart() {
|
|
18
|
-
test_utils_1.assert.isEqual(process.env.SHOULD_REGISTER_PERMISSIONS, 'false');
|
|
19
|
-
}
|
|
20
|
-
static async permissionFixtureShouldUseSharedInstance() {
|
|
21
|
-
const actual = this.permissions.getAuthorizer();
|
|
22
|
-
const expected = spruce_permission_utils_1.AuthorizerFactory.getInstance();
|
|
23
|
-
test_utils_1.assert.isEqual(actual, expected);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, test_utils_1.test)()
|
|
28
|
-
], PermissionFixtureTest, "disablesPermissionsAtStart", null);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, test_utils_1.test)()
|
|
31
|
-
], PermissionFixtureTest, "permissionFixtureShouldUseSharedInstance", null);
|
|
32
|
-
PermissionFixtureTest = __decorate([
|
|
33
|
-
fake_1.default.login()
|
|
34
|
-
], PermissionFixtureTest);
|
|
35
|
-
exports.default = PermissionFixtureTest;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import AbstractSpruceFixtureTest from '../../../tests/AbstractSpruceFixtureTest';
|
|
2
|
-
export default class SeedingDataTest extends AbstractSpruceFixtureTest {
|
|
3
|
-
private static fixture;
|
|
4
|
-
private static client;
|
|
5
|
-
protected static beforeEach(): Promise<void>;
|
|
6
|
-
protected static hasSeedFixture(): void;
|
|
7
|
-
protected static canSeedManyOrgs(): Promise<void>;
|
|
8
|
-
protected static actuallyCreatesOrgs(): Promise<void>;
|
|
9
|
-
protected static canSeedLocations(): Promise<void>;
|
|
10
|
-
protected static seedingOrgsCreatesOrganization(): Promise<void>;
|
|
11
|
-
protected static canPassOrgToLocationSeeder(): Promise<void>;
|
|
12
|
-
protected static throwsWhenSeedingWithoutCount(): Promise<void>;
|
|
13
|
-
protected static actuallyCreatesLocations(): Promise<void>;
|
|
14
|
-
protected static needsStartingPhoneWhenSeedingPeople(options: any): Promise<void>;
|
|
15
|
-
protected static returnsSeededGuests(options: any, expectedCount: number, base: string): Promise<void>;
|
|
16
|
-
protected static setsFirstPersonsNumberToTheStartingPhone(phone: string): Promise<void>;
|
|
17
|
-
protected static canSeedMultipleRolesAtOnce(): Promise<void>;
|
|
18
|
-
protected static seededPeopleHaveNames(): Promise<void>;
|
|
19
|
-
protected static peopleAllHaveUniqueNames(): Promise<void>;
|
|
20
|
-
protected static namesAreOnlyAssignedIfNotYetAssigned(): Promise<void>;
|
|
21
|
-
private static listPeople;
|
|
22
|
-
private static seedLocations;
|
|
23
|
-
private static assertOnlyOneOrgExists;
|
|
24
|
-
}
|
|
@@ -1,271 +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 __rest = (this && this.__rest) || function (s, e) {
|
|
9
|
-
var t = {};
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
13
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
14
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
15
|
-
t[p[i]] = s[p[i]];
|
|
16
|
-
}
|
|
17
|
-
return t;
|
|
18
|
-
};
|
|
19
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
-
};
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
const schema_1 = require("@sprucelabs/schema");
|
|
24
|
-
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
|
25
|
-
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
26
|
-
const test_utils_2 = require("@sprucelabs/test-utils");
|
|
27
|
-
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
|
|
28
|
-
const constants_1 = require("../../../tests/constants");
|
|
29
|
-
const fake_1 = __importDefault(require("../../../tests/decorators/fake"));
|
|
30
|
-
const sorter = (a, b) => (a.id > b.id ? 1 : -1);
|
|
31
|
-
let SeedingDataTest = class SeedingDataTest extends AbstractSpruceFixtureTest_1.default {
|
|
32
|
-
static async beforeEach() {
|
|
33
|
-
await super.beforeEach();
|
|
34
|
-
this.client = fake_1.default.getClient();
|
|
35
|
-
this.fixture = this.Fixture('seed');
|
|
36
|
-
await this.fixture.resetAccount(constants_1.DEMO_NUMBER_SEED_FIXTURE);
|
|
37
|
-
}
|
|
38
|
-
static hasSeedFixture() {
|
|
39
|
-
test_utils_1.assert.isTruthy(this.fixture);
|
|
40
|
-
}
|
|
41
|
-
static async canSeedManyOrgs() {
|
|
42
|
-
const organizations = await this.fixture.seedOrganizations({
|
|
43
|
-
totalOrganizations: 5,
|
|
44
|
-
});
|
|
45
|
-
test_utils_1.assert.isLength(organizations, 5);
|
|
46
|
-
}
|
|
47
|
-
static async actuallyCreatesOrgs() {
|
|
48
|
-
const organizations = await this.fixture.seedOrganizations({
|
|
49
|
-
totalOrganizations: 3,
|
|
50
|
-
});
|
|
51
|
-
const results = await this.client.emit('list-organizations::v2020_12_25', {
|
|
52
|
-
payload: {
|
|
53
|
-
shouldOnlyShowMine: true,
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
const { organizations: matched } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
57
|
-
test_utils_1.assert.isLength(matched, 3);
|
|
58
|
-
test_utils_1.assert.isLength(organizations, 3);
|
|
59
|
-
for (const org of organizations) {
|
|
60
|
-
const results = await this.client.emit('get-organization::v2020_12_25', {
|
|
61
|
-
target: {
|
|
62
|
-
organizationId: org.id,
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
static async canSeedLocations() {
|
|
69
|
-
const { locations } = await this.fixture.seedAccount({
|
|
70
|
-
totalLocations: 5,
|
|
71
|
-
});
|
|
72
|
-
test_utils_1.assert.isLength(locations, 5);
|
|
73
|
-
}
|
|
74
|
-
static async seedingOrgsCreatesOrganization() {
|
|
75
|
-
const { locations } = await this.fixture.seedAccount({
|
|
76
|
-
totalLocations: 3,
|
|
77
|
-
});
|
|
78
|
-
test_utils_1.assert.isLength(locations, 3);
|
|
79
|
-
await this.assertOnlyOneOrgExists();
|
|
80
|
-
}
|
|
81
|
-
static async canPassOrgToLocationSeeder() {
|
|
82
|
-
const org = await this.organizations.seedDemoOrganization();
|
|
83
|
-
await this.fixture.seedAccount({
|
|
84
|
-
totalLocations: 3,
|
|
85
|
-
organizationId: org.id,
|
|
86
|
-
});
|
|
87
|
-
await this.assertOnlyOneOrgExists();
|
|
88
|
-
}
|
|
89
|
-
static async throwsWhenSeedingWithoutCount() {
|
|
90
|
-
const err = await test_utils_1.assert.doesThrowAsync(() =>
|
|
91
|
-
//@ts-ignore
|
|
92
|
-
this.fixture.seedAccount({}));
|
|
93
|
-
test_utils_2.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
94
|
-
parameters: ['totalLocations'],
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
static async actuallyCreatesLocations() {
|
|
98
|
-
const { organization, locations } = await this.seedLocations();
|
|
99
|
-
const results = await this.client.emit('list-locations::v2020_12_25', {
|
|
100
|
-
target: {
|
|
101
|
-
organizationId: organization.id,
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
const { locations: matches } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
105
|
-
test_utils_1.assert.isLength(matches, 3);
|
|
106
|
-
for (const location of locations) {
|
|
107
|
-
const results = await this.client.emit('get-location::v2020_12_25', {
|
|
108
|
-
target: {
|
|
109
|
-
locationId: location.id,
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
static async needsStartingPhoneWhenSeedingPeople(options) {
|
|
116
|
-
const err = await test_utils_1.assert.doesThrowAsync(() => this.seedLocations(Object.assign({}, options)));
|
|
117
|
-
test_utils_2.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
118
|
-
parameters: ['startingPhone'],
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
static async returnsSeededGuests(options, expectedCount, base) {
|
|
122
|
-
var _a;
|
|
123
|
-
const _b = await this.seedLocations(Object.assign({ totalLocations: 1, startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE }, options)), { locations } = _b, rest = __rest(_b, ["locations"]);
|
|
124
|
-
const withoutOwner = await this.listPeople(locations[0], base);
|
|
125
|
-
const withoutOwnerCleaned = withoutOwner.map((_a) => {
|
|
126
|
-
var { roleIds: _ } = _a, rest = __rest(_a, ["roleIds"]);
|
|
127
|
-
return rest;
|
|
128
|
-
});
|
|
129
|
-
//@ts-ignore
|
|
130
|
-
const people = (_a = rest[base + 's']) !== null && _a !== void 0 ? _a : [];
|
|
131
|
-
people.sort(sorter);
|
|
132
|
-
withoutOwnerCleaned.sort(sorter);
|
|
133
|
-
test_utils_1.assert.isLength(withoutOwner, expectedCount);
|
|
134
|
-
test_utils_1.assert.isEqualDeep(people, withoutOwnerCleaned);
|
|
135
|
-
}
|
|
136
|
-
static async setsFirstPersonsNumberToTheStartingPhone(phone) {
|
|
137
|
-
const { guests } = await this.seedLocations({
|
|
138
|
-
totalLocations: 1,
|
|
139
|
-
totalGuests: 1,
|
|
140
|
-
startingPhone: phone,
|
|
141
|
-
});
|
|
142
|
-
test_utils_1.assert.isEqual(guests[0].phone, (0, schema_1.formatPhoneNumber)(phone));
|
|
143
|
-
}
|
|
144
|
-
static async canSeedMultipleRolesAtOnce() {
|
|
145
|
-
const { locations } = await this.seedLocations({
|
|
146
|
-
startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
147
|
-
totalLocations: 1,
|
|
148
|
-
totalGuests: 3,
|
|
149
|
-
totalManagers: 2,
|
|
150
|
-
});
|
|
151
|
-
const people = await this.listPeople(locations[0], ['guest', 'manager']);
|
|
152
|
-
test_utils_1.assert.isLength(people, 5);
|
|
153
|
-
}
|
|
154
|
-
static async seededPeopleHaveNames() {
|
|
155
|
-
const { teammates } = await this.seedLocations({
|
|
156
|
-
startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
157
|
-
totalLocations: 1,
|
|
158
|
-
totalTeammates: 2,
|
|
159
|
-
});
|
|
160
|
-
test_utils_1.assert.isTruthy(teammates[0].firstName);
|
|
161
|
-
}
|
|
162
|
-
static async peopleAllHaveUniqueNames() {
|
|
163
|
-
const { teammates } = await this.seedLocations({
|
|
164
|
-
startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
165
|
-
totalLocations: 1,
|
|
166
|
-
totalTeammates: 2,
|
|
167
|
-
});
|
|
168
|
-
const names = teammates.map((t) => t.casualName);
|
|
169
|
-
const unique = [...new Set(names)];
|
|
170
|
-
test_utils_1.assert.isLength(unique, names.length);
|
|
171
|
-
}
|
|
172
|
-
static async namesAreOnlyAssignedIfNotYetAssigned() {
|
|
173
|
-
const { client } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE);
|
|
174
|
-
const firstName = `Test person:: ${Math.random()}`;
|
|
175
|
-
const lastName = `${Math.random()}`;
|
|
176
|
-
await client.emitAndFlattenResponses('update-person::v2020_12_25', {
|
|
177
|
-
payload: {
|
|
178
|
-
firstName,
|
|
179
|
-
lastName,
|
|
180
|
-
},
|
|
181
|
-
});
|
|
182
|
-
const { teammates } = await this.seedLocations({
|
|
183
|
-
startingPhone: constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE,
|
|
184
|
-
totalLocations: 1,
|
|
185
|
-
totalTeammates: 1,
|
|
186
|
-
});
|
|
187
|
-
const [tm1] = teammates;
|
|
188
|
-
test_utils_1.assert.isEqual(tm1.casualName, firstName + ' ' + lastName[0] + '.');
|
|
189
|
-
}
|
|
190
|
-
static async listPeople(location, base) {
|
|
191
|
-
const people = await this.people.listPeople({
|
|
192
|
-
locationId: location.id,
|
|
193
|
-
organizationId: location.organizationId,
|
|
194
|
-
roleBases: Array.isArray(base) ? base : [base],
|
|
195
|
-
shouldIncludePrivateFields: true,
|
|
196
|
-
});
|
|
197
|
-
const withoutOwner = people.filter((p) => p.id !== fake_1.default.getPerson().id);
|
|
198
|
-
return withoutOwner;
|
|
199
|
-
}
|
|
200
|
-
static async seedLocations(options) {
|
|
201
|
-
const org = await this.organizations.seedDemoOrganization();
|
|
202
|
-
const results = await this.fixture.seedAccount(Object.assign({ totalLocations: 3, organizationId: org.id }, options));
|
|
203
|
-
return Object.assign({ organization: org }, results);
|
|
204
|
-
}
|
|
205
|
-
static async assertOnlyOneOrgExists() {
|
|
206
|
-
const results = await this.client.emit('list-organizations::v2020_12_25', {
|
|
207
|
-
payload: {
|
|
208
|
-
shouldOnlyShowMine: true,
|
|
209
|
-
},
|
|
210
|
-
});
|
|
211
|
-
const { organizations } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
212
|
-
test_utils_1.assert.isLength(organizations, 1);
|
|
213
|
-
test_utils_1.assert.isObject(organizations[0].address);
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
__decorate([
|
|
217
|
-
(0, test_utils_1.test)()
|
|
218
|
-
], SeedingDataTest, "hasSeedFixture", null);
|
|
219
|
-
__decorate([
|
|
220
|
-
(0, test_utils_1.test)()
|
|
221
|
-
], SeedingDataTest, "canSeedManyOrgs", null);
|
|
222
|
-
__decorate([
|
|
223
|
-
(0, test_utils_1.test)()
|
|
224
|
-
], SeedingDataTest, "actuallyCreatesOrgs", null);
|
|
225
|
-
__decorate([
|
|
226
|
-
(0, test_utils_1.test)()
|
|
227
|
-
], SeedingDataTest, "canSeedLocations", null);
|
|
228
|
-
__decorate([
|
|
229
|
-
(0, test_utils_1.test)()
|
|
230
|
-
], SeedingDataTest, "seedingOrgsCreatesOrganization", null);
|
|
231
|
-
__decorate([
|
|
232
|
-
(0, test_utils_1.test)()
|
|
233
|
-
], SeedingDataTest, "canPassOrgToLocationSeeder", null);
|
|
234
|
-
__decorate([
|
|
235
|
-
(0, test_utils_1.test)()
|
|
236
|
-
], SeedingDataTest, "throwsWhenSeedingWithoutCount", null);
|
|
237
|
-
__decorate([
|
|
238
|
-
(0, test_utils_1.test)()
|
|
239
|
-
], SeedingDataTest, "actuallyCreatesLocations", null);
|
|
240
|
-
__decorate([
|
|
241
|
-
(0, test_utils_1.test)('missing starting phone with totalGuests', { totalGuests: 10 }),
|
|
242
|
-
(0, test_utils_1.test)('missing starting phone with totalTeammates', { totalTeammates: 10 })
|
|
243
|
-
], SeedingDataTest, "needsStartingPhoneWhenSeedingPeople", null);
|
|
244
|
-
__decorate([
|
|
245
|
-
(0, test_utils_1.test)('can seed 3 guests', { totalGuests: 3 }, 3, 'guest'),
|
|
246
|
-
(0, test_utils_1.test)('can seed 5 guests', { totalGuests: 5 }, 5, 'guest'),
|
|
247
|
-
(0, test_utils_1.test)('can seed 2 teammates', { totalTeammates: 2 }, 2, 'teammate'),
|
|
248
|
-
(0, test_utils_1.test)('can seed 3 managers', { totalManagers: 3 }, 3, 'manager'),
|
|
249
|
-
(0, test_utils_1.test)('can seed 3 groupManager', { totalGroupManagers: 3 }, 3, 'groupManager'),
|
|
250
|
-
(0, test_utils_1.test)('can seed 1 owners', { totalOwners: 1 }, 1, 'owner')
|
|
251
|
-
], SeedingDataTest, "returnsSeededGuests", null);
|
|
252
|
-
__decorate([
|
|
253
|
-
(0, test_utils_1.test)('seeds with starting phone 1', constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE),
|
|
254
|
-
(0, test_utils_1.test)('seeds with starting phone 2', constants_1.DEMO_NUMBER_SEED_FIXTURE_STARTING_PHONE_ALT)
|
|
255
|
-
], SeedingDataTest, "setsFirstPersonsNumberToTheStartingPhone", null);
|
|
256
|
-
__decorate([
|
|
257
|
-
(0, test_utils_1.test)()
|
|
258
|
-
], SeedingDataTest, "canSeedMultipleRolesAtOnce", null);
|
|
259
|
-
__decorate([
|
|
260
|
-
(0, test_utils_1.test)()
|
|
261
|
-
], SeedingDataTest, "seededPeopleHaveNames", null);
|
|
262
|
-
__decorate([
|
|
263
|
-
(0, test_utils_1.test)()
|
|
264
|
-
], SeedingDataTest, "peopleAllHaveUniqueNames", null);
|
|
265
|
-
__decorate([
|
|
266
|
-
(0, test_utils_1.test)()
|
|
267
|
-
], SeedingDataTest, "namesAreOnlyAssignedIfNotYetAssigned", null);
|
|
268
|
-
SeedingDataTest = __decorate([
|
|
269
|
-
fake_1.default.login(constants_1.DEMO_NUMBER_SEED_FIXTURE)
|
|
270
|
-
], SeedingDataTest);
|
|
271
|
-
exports.default = SeedingDataTest;
|