@sprucelabs/spruce-test-fixtures 49.0.39 → 49.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +5 -5
- package/build/__tests__/behavioral/DatabaseFixture.test.d.ts +1 -1
- package/build/__tests__/behavioral/DatabaseFixture.test.js +7 -7
- package/build/__tests__/behavioral/DbResetsAsExpected.test.js +4 -4
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +18 -18
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +3 -3
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +5 -5
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +9 -9
- package/build/__tests__/behavioral/FakingEventResponses.test.js +15 -15
- package/build/__tests__/behavioral/FixtureFactory.test.d.ts +1 -1
- package/build/__tests__/behavioral/FixtureFactory.test.js +14 -14
- package/build/__tests__/behavioral/LocationFixture.test.js +17 -17
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +11 -11
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +3 -3
- package/build/__tests__/behavioral/MercuryFixture.test.js +28 -28
- package/build/__tests__/behavioral/OrganizationFixture.test.js +50 -50
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +3 -3
- package/build/__tests__/behavioral/PersonFixture.test.d.ts +1 -1
- package/build/__tests__/behavioral/PersonFixture.test.js +37 -37
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +22 -22
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +5 -5
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +3 -3
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +5 -5
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +9 -9
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +4 -4
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +2 -2
- package/build/__tests__/behavioral/RoleFixture.test.js +15 -15
- package/build/__tests__/behavioral/SeedingData.test.js +43 -43
- package/build/__tests__/behavioral/SkillFixture.test.js +22 -22
- package/build/__tests__/behavioral/StoreFixture.test.d.ts +1 -1
- package/build/__tests__/behavioral/StoreFixture.test.js +20 -20
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +11 -11
- package/build/__tests__/behavioral/faking/FakeDecorator.test.js +74 -74
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +3 -3
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +3 -3
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +1 -1
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +8 -8
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +6 -6
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +15 -15
- package/build/__tests__/behavioral/faking/FakingAuthenticator.test.js +5 -5
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +5 -5
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +19 -19
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +41 -41
- package/build/__tests__/behavioral/faking/UpdatePerson.test.js +5 -5
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +60 -60
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +1 -1
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +4 -4
- package/build/__tests__/behavioral/faking/WhoAmI.test.js +12 -12
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +17 -17
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +54 -54
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +16 -16
- package/build/__tests__/behavioral/views/CheckingPermissions.test.js +30 -30
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +8 -8
- package/build/__tests__/behavioral/views/Routing.test.js +30 -30
- package/build/__tests__/behavioral/views/TestingScope.test.js +10 -10
- package/build/__tests__/behavioral/views/ViewFixture.test.js +107 -107
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +10 -10
- package/build/__tests__/support/AbstractFakeDecoratorTest.js +4 -4
- package/build/esm/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +1 -1
- package/build/esm/__tests__/behavioral/DatabaseFixture.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/DatabaseFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/DbResetsAsExpected.test.js +1 -1
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +1 -1
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +1 -1
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +1 -1
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +1 -1
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +1 -1
- package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/FixtureFactory.test.js +1 -1
- package/build/esm/__tests__/behavioral/LocationFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +1 -1
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +1 -1
- package/build/esm/__tests__/behavioral/MercuryFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +1 -1
- package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/PersonFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +1 -1
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +1 -1
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +1 -1
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +1 -1
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +1 -1
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +1 -1
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +1 -1
- package/build/esm/__tests__/behavioral/RoleFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/SeedingData.test.js +1 -1
- package/build/esm/__tests__/behavioral/SkillFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/StoreFixture.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/StoreFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +1 -1
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +1 -1
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +1 -1
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/CheckingPermissions.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/Routing.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/TestingScope.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +1 -1
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +1 -1
- package/build/esm/tests/AbstractSpruceFixtureTest.js +1 -1
- package/build/esm/tests/SpyAuthorizer.js +1 -1
- package/build/esm/tests/decorators/fake.js +1 -1
- package/build/esm/tests/decorators/install.js +1 -1
- package/build/esm/tests/decorators/login.js +1 -1
- package/build/esm/tests/decorators/seed.js +1 -1
- package/build/esm/tests/fixtures/LocationFixture.js +1 -1
- package/build/esm/tests/fixtures/RoleFixture.js +1 -1
- package/build/esm/tests/fixtures/SeedFixture.js +1 -1
- package/build/tests/AbstractSpruceFixtureTest.js +3 -3
- package/build/tests/SpyAuthorizer.js +3 -3
- package/build/tests/decorators/fake.js +20 -20
- package/build/tests/decorators/install.js +3 -3
- package/build/tests/decorators/login.js +4 -4
- package/build/tests/decorators/seed.js +2 -2
- package/build/tests/fixtures/LocationFixture.js +3 -3
- package/build/tests/fixtures/RoleFixture.js +2 -2
- package/build/tests/fixtures/SeedFixture.js +2 -2
- package/package.json +5 -5
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const
|
|
12
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
13
13
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
|
|
14
14
|
const fake_1 = __importDefault(require("../../../tests/decorators/fake"));
|
|
15
15
|
const seed_1 = __importDefault(require("../../../tests/decorators/seed"));
|
|
@@ -18,22 +18,22 @@ let FakingInBeforeEachTest = class FakingInBeforeEachTest extends AbstractSpruce
|
|
|
18
18
|
await super.beforeEach();
|
|
19
19
|
}
|
|
20
20
|
static async canGetLocations() {
|
|
21
|
-
|
|
21
|
+
test_utils_1.assert.isLength(this.fakedLocations, 1);
|
|
22
22
|
}
|
|
23
23
|
static async canGetRolesForBothSeededOrgs() {
|
|
24
24
|
const matches = this.fakedRoles.filter((r) => r.organizationId === this.fakedOrganizations[0].id);
|
|
25
25
|
const matches2 = this.fakedRoles.filter((r) => r.organizationId === this.fakedOrganizations[1].id);
|
|
26
|
-
|
|
26
|
+
test_utils_1.assert.isEqual(matches.length, matches2.length);
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
__decorate([
|
|
30
30
|
(0, seed_1.default)('locations', 1)
|
|
31
31
|
], FakingInBeforeEachTest, "beforeEach", null);
|
|
32
32
|
__decorate([
|
|
33
|
-
(0,
|
|
33
|
+
(0, test_utils_1.test)()
|
|
34
34
|
], FakingInBeforeEachTest, "canGetLocations", null);
|
|
35
35
|
__decorate([
|
|
36
|
-
(0,
|
|
36
|
+
(0, test_utils_1.test)(),
|
|
37
37
|
(0, seed_1.default)('organizations', 1)
|
|
38
38
|
], FakingInBeforeEachTest, "canGetRolesForBothSeededOrgs", null);
|
|
39
39
|
FakingInBeforeEachTest = __decorate([
|
|
@@ -10,8 +10,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const spruce_core_schemas_1 = require("@sprucelabs/spruce-core-schemas");
|
|
13
|
-
const test_1 = require("@sprucelabs/test");
|
|
14
13
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
14
|
+
const test_utils_2 = require("@sprucelabs/test-utils");
|
|
15
15
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
|
|
16
16
|
const fake_1 = __importDefault(require("../../../tests/decorators/fake"));
|
|
17
17
|
const seed_1 = __importDefault(require("../../../tests/decorators/seed"));
|
|
@@ -31,11 +31,11 @@ let FakingRoleEventsTest = class FakingRoleEventsTest extends AbstractSpruceFixt
|
|
|
31
31
|
static async canGetRole(idx) {
|
|
32
32
|
const id = this.fakedRoles[idx].id;
|
|
33
33
|
const role = await this.emitGetRole(id);
|
|
34
|
-
|
|
34
|
+
test_utils_1.assert.isEqualDeep(role, this.fakedRoles[idx]);
|
|
35
35
|
}
|
|
36
36
|
static async throwsWithBadRole() {
|
|
37
|
-
const err = await
|
|
38
|
-
|
|
37
|
+
const err = await test_utils_1.assert.doesThrowAsync(() => this.emitGetRole((0, test_utils_2.generateId)()));
|
|
38
|
+
test_utils_2.errorAssert.assertError(err, 'NOT_FOUND');
|
|
39
39
|
}
|
|
40
40
|
static async listingRolesByLocationFiltersByOrg() {
|
|
41
41
|
await this.assertRolesMatchOrg(0);
|
|
@@ -51,11 +51,11 @@ let FakingRoleEventsTest = class FakingRoleEventsTest extends AbstractSpruceFixt
|
|
|
51
51
|
});
|
|
52
52
|
await this.afterEach();
|
|
53
53
|
await this.listRolesForOrg();
|
|
54
|
-
|
|
54
|
+
test_utils_1.assert.isEqual(hitCount, 0);
|
|
55
55
|
}
|
|
56
56
|
static async allRolesArePrivateButGuestToStart() {
|
|
57
57
|
for (const role of this.fakedRoles) {
|
|
58
|
-
|
|
58
|
+
test_utils_1.assert.isEqual(role.isPublic, role.base === 'guest');
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
static async listRolesCanTogglePrivate() {
|
|
@@ -71,15 +71,15 @@ let FakingRoleEventsTest = class FakingRoleEventsTest extends AbstractSpruceFixt
|
|
|
71
71
|
organizationId: this.org.id,
|
|
72
72
|
},
|
|
73
73
|
});
|
|
74
|
-
|
|
74
|
+
test_utils_1.assert.isLength(roles, expected);
|
|
75
75
|
}
|
|
76
76
|
static async assertRolesMatchOrg(idx) {
|
|
77
77
|
const roles = await this.roles.listRoles({
|
|
78
78
|
locationId: this.fakedLocations[idx].id,
|
|
79
79
|
shouldIncludeMetaRoles: true,
|
|
80
80
|
});
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
test_utils_1.assert.isLength(roles, spruce_core_schemas_1.BASE_ROLES_WITH_META.length);
|
|
82
|
+
test_utils_1.assert.isEqual(roles[0].organizationId, this.fakedLocations[idx].organizationId);
|
|
83
83
|
}
|
|
84
84
|
static async emitGetRole(id) {
|
|
85
85
|
const [{ role }] = await fake_1.default
|
|
@@ -93,7 +93,7 @@ let FakingRoleEventsTest = class FakingRoleEventsTest extends AbstractSpruceFixt
|
|
|
93
93
|
}
|
|
94
94
|
static async assertPersonGetsBackRoleWithbase(personId, base) {
|
|
95
95
|
const roles = await this.listRolesForOrg(personId);
|
|
96
|
-
|
|
96
|
+
test_utils_1.assert.isEqualDeep(roles[0], this.getFakedRole(base));
|
|
97
97
|
}
|
|
98
98
|
static getFakedRole(base) {
|
|
99
99
|
return this.fakedRoles.find((r) => r.base === base);
|
|
@@ -106,33 +106,33 @@ let FakingRoleEventsTest = class FakingRoleEventsTest extends AbstractSpruceFixt
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
__decorate([
|
|
109
|
-
(0,
|
|
109
|
+
(0, test_utils_1.test)()
|
|
110
110
|
], FakingRoleEventsTest, "canListOwners", null);
|
|
111
111
|
__decorate([
|
|
112
|
-
(0,
|
|
112
|
+
(0, test_utils_1.test)(),
|
|
113
113
|
(0, seed_1.default)('teammates', 1)
|
|
114
114
|
], FakingRoleEventsTest, "canListOtherRoles", null);
|
|
115
115
|
__decorate([
|
|
116
|
-
(0,
|
|
117
|
-
(0,
|
|
116
|
+
(0, test_utils_1.test)('can get role 1', 0),
|
|
117
|
+
(0, test_utils_1.test)('can get role 2', 1)
|
|
118
118
|
], FakingRoleEventsTest, "canGetRole", null);
|
|
119
119
|
__decorate([
|
|
120
|
-
(0,
|
|
120
|
+
(0, test_utils_1.test)()
|
|
121
121
|
], FakingRoleEventsTest, "throwsWithBadRole", null);
|
|
122
122
|
__decorate([
|
|
123
|
-
(0,
|
|
123
|
+
(0, test_utils_1.test)(),
|
|
124
124
|
(0, seed_1.default)('locations', 1),
|
|
125
125
|
(0, seed_1.default)('organizations', 1),
|
|
126
126
|
(0, seed_1.default)('locations', 1)
|
|
127
127
|
], FakingRoleEventsTest, "listingRolesByLocationFiltersByOrg", null);
|
|
128
128
|
__decorate([
|
|
129
|
-
(0,
|
|
129
|
+
(0, test_utils_1.test)()
|
|
130
130
|
], FakingRoleEventsTest, "settingListenerOnListRolesResetsNextTest", null);
|
|
131
131
|
__decorate([
|
|
132
|
-
(0,
|
|
132
|
+
(0, test_utils_1.test)()
|
|
133
133
|
], FakingRoleEventsTest, "allRolesArePrivateButGuestToStart", null);
|
|
134
134
|
__decorate([
|
|
135
|
-
(0,
|
|
135
|
+
(0, test_utils_1.test)()
|
|
136
136
|
], FakingRoleEventsTest, "listRolesCanTogglePrivate", null);
|
|
137
137
|
FakingRoleEventsTest = __decorate([
|
|
138
138
|
fake_1.default.login()
|
|
@@ -9,53 +9,53 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const test_1 = require("@sprucelabs/test");
|
|
13
12
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
13
|
+
const test_utils_2 = require("@sprucelabs/test-utils");
|
|
14
14
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
|
|
15
15
|
const fake_1 = __importDefault(require("../../../tests/decorators/fake"));
|
|
16
16
|
let FakingSkillEventsTest = class FakingSkillEventsTest extends AbstractSpruceFixtureTest_1.default {
|
|
17
17
|
static async canSeedSkill() {
|
|
18
18
|
const skill = await this.seedDemoSkill();
|
|
19
|
-
|
|
19
|
+
test_utils_1.assert.isEqual(skill.creators[0].personId, this.fakedPerson.id);
|
|
20
20
|
}
|
|
21
21
|
static async skillsGenerateUniqueValues() {
|
|
22
22
|
const skill1 = await this.seedDemoSkill();
|
|
23
23
|
const skill2 = await this.seedDemoSkill();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
test_utils_1.assert.isNotEqual(skill1.id, skill2.id);
|
|
25
|
+
test_utils_1.assert.isNotEqual(skill1.slug, skill2.slug);
|
|
26
|
+
test_utils_1.assert.isNotEqual(skill1.name, skill2.name);
|
|
27
|
+
test_utils_1.assert.isNotEqual(skill1.apiKey, skill2.apiKey);
|
|
28
28
|
}
|
|
29
29
|
static async canLoginAsCurrentSkillWithoutEnvSet() {
|
|
30
30
|
await this.skills.loginAsCurrentSkill();
|
|
31
31
|
}
|
|
32
32
|
static async doesNotMutateSkillEnvIfExists() {
|
|
33
|
-
this.lastEnvSkillId = process.env.SKILL_ID = (0,
|
|
34
|
-
this.lastEnvApiKey = process.env.SKILL_API_KEY = (0,
|
|
33
|
+
this.lastEnvSkillId = process.env.SKILL_ID = (0, test_utils_2.generateId)();
|
|
34
|
+
this.lastEnvApiKey = process.env.SKILL_API_KEY = (0, test_utils_2.generateId)();
|
|
35
35
|
}
|
|
36
36
|
static async doesNotMutateSkillEnvIfExistsCheck() {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
test_utils_1.assert.isEqual(this.lastEnvSkillId, process.env.SKILL_ID);
|
|
38
|
+
test_utils_1.assert.isEqual(this.lastEnvApiKey, process.env.SKILL_API_KEY);
|
|
39
39
|
}
|
|
40
40
|
static async seededSkillsAvailableLocally() {
|
|
41
41
|
const skill1 = await this.seedDemoSkill();
|
|
42
|
-
|
|
42
|
+
test_utils_1.assert.isEqualDeep(this.fakedSkills, [skill1]);
|
|
43
43
|
const skill2 = await this.seedDemoSkill();
|
|
44
|
-
|
|
44
|
+
test_utils_1.assert.isEqualDeep(this.fakedSkills, [skill2, skill1]);
|
|
45
45
|
}
|
|
46
46
|
static async authenticateThrowsWhenBadAuth() {
|
|
47
|
-
const err = await
|
|
48
|
-
|
|
47
|
+
const err = await test_utils_1.assert.doesThrowAsync(() => this.emitAuthenticateAsSkill('', ''));
|
|
48
|
+
test_utils_2.errorAssert.assertError(err, 'INVALID_AUTH_TOKEN');
|
|
49
49
|
}
|
|
50
50
|
static async authenticateThrowsWhenBadAuthId() {
|
|
51
51
|
const skill = await this.seedDemoSkill();
|
|
52
|
-
const err = await
|
|
53
|
-
|
|
52
|
+
const err = await test_utils_1.assert.doesThrowAsync(() => this.emitAuthenticateAsSkill(skill.apiKey, (0, test_utils_2.generateId)()));
|
|
53
|
+
test_utils_2.errorAssert.assertError(err, 'INVALID_AUTH_TOKEN');
|
|
54
54
|
}
|
|
55
55
|
static async canAuthenticateAsSkill() {
|
|
56
56
|
const skill = await this.seedDemoSkill();
|
|
57
57
|
const { type } = await this.emitAuthenticateAsSkill(skill.apiKey, skill.id);
|
|
58
|
-
|
|
58
|
+
test_utils_1.assert.isEqual(type, 'authenticated');
|
|
59
59
|
}
|
|
60
60
|
static async returnsTheExpectedSkill() {
|
|
61
61
|
const skill1 = await this.seedDemoSkill();
|
|
@@ -68,8 +68,8 @@ let FakingSkillEventsTest = class FakingSkillEventsTest extends AbstractSpruceFi
|
|
|
68
68
|
name: 'taco',
|
|
69
69
|
slug: 'bravo',
|
|
70
70
|
});
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
test_utils_1.assert.isEqual(skill1.name, 'taco');
|
|
72
|
+
test_utils_1.assert.isEqual(skill1.slug, 'bravo');
|
|
73
73
|
}
|
|
74
74
|
static async whoAmIReturnsSkill() {
|
|
75
75
|
const { client, skill } = await this.skills.loginAsDemoSkill({
|
|
@@ -85,8 +85,8 @@ let FakingSkillEventsTest = class FakingSkillEventsTest extends AbstractSpruceFi
|
|
|
85
85
|
await this.assertExpectedWhoAmIResults(client, skill);
|
|
86
86
|
}
|
|
87
87
|
static async returnsCurrentSkillIfEnvSet() {
|
|
88
|
-
const skillId = (0,
|
|
89
|
-
const apiKey = (0,
|
|
88
|
+
const skillId = (0, test_utils_2.generateId)();
|
|
89
|
+
const apiKey = (0, test_utils_2.generateId)();
|
|
90
90
|
process.env.SKILL_ID = skillId;
|
|
91
91
|
process.env.SKILL_API_KEY = apiKey;
|
|
92
92
|
const client = await this.mercury.connectToApi();
|
|
@@ -97,21 +97,21 @@ let FakingSkillEventsTest = class FakingSkillEventsTest extends AbstractSpruceFi
|
|
|
97
97
|
},
|
|
98
98
|
});
|
|
99
99
|
const { skill } = auth;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
test_utils_1.assert.isEqual(type, 'authenticated');
|
|
101
|
+
test_utils_1.assert.isEqual(skill === null || skill === void 0 ? void 0 : skill.id, skillId);
|
|
102
|
+
test_utils_1.assert.isEqual(skill === null || skill === void 0 ? void 0 : skill.apiKey, apiKey);
|
|
103
103
|
}
|
|
104
104
|
static async assertExpectedWhoAmIResults(client, skill) {
|
|
105
105
|
const [{ type, auth }] = await client.emitAndFlattenResponses('whoami::v2020_12_25');
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
test_utils_1.assert.isEqual(type, 'authenticated');
|
|
107
|
+
test_utils_1.assert.isEqualDeep(auth.skill, skill);
|
|
108
108
|
}
|
|
109
109
|
static async seedDemoSkill(values) {
|
|
110
110
|
return await this.skills.seedDemoSkill(values);
|
|
111
111
|
}
|
|
112
112
|
static async assertCanAuthAsSkill(skill1) {
|
|
113
113
|
const { auth } = await this.emitAuthenticateAsSkill(skill1.apiKey, skill1.id);
|
|
114
|
-
|
|
114
|
+
test_utils_1.assert.isEqualDeep(auth.skill, skill1);
|
|
115
115
|
}
|
|
116
116
|
static async emitAuthenticateAsSkill(apiKey, skillId) {
|
|
117
117
|
const [{ auth, type }] = await this.client.emitAndFlattenResponses('authenticate::v2020_12_25', {
|
|
@@ -127,46 +127,46 @@ let FakingSkillEventsTest = class FakingSkillEventsTest extends AbstractSpruceFi
|
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
__decorate([
|
|
130
|
-
(0,
|
|
130
|
+
(0, test_utils_1.test)()
|
|
131
131
|
], FakingSkillEventsTest, "canSeedSkill", null);
|
|
132
132
|
__decorate([
|
|
133
|
-
(0,
|
|
133
|
+
(0, test_utils_1.test)()
|
|
134
134
|
], FakingSkillEventsTest, "skillsGenerateUniqueValues", null);
|
|
135
135
|
__decorate([
|
|
136
|
-
(0,
|
|
136
|
+
(0, test_utils_1.test)()
|
|
137
137
|
], FakingSkillEventsTest, "canLoginAsCurrentSkillWithoutEnvSet", null);
|
|
138
138
|
__decorate([
|
|
139
|
-
(0,
|
|
139
|
+
(0, test_utils_1.test)()
|
|
140
140
|
], FakingSkillEventsTest, "doesNotMutateSkillEnvIfExists", null);
|
|
141
141
|
__decorate([
|
|
142
|
-
(0,
|
|
142
|
+
(0, test_utils_1.test)()
|
|
143
143
|
], FakingSkillEventsTest, "doesNotMutateSkillEnvIfExistsCheck", null);
|
|
144
144
|
__decorate([
|
|
145
|
-
(0,
|
|
145
|
+
(0, test_utils_1.test)()
|
|
146
146
|
], FakingSkillEventsTest, "seededSkillsAvailableLocally", null);
|
|
147
147
|
__decorate([
|
|
148
|
-
(0,
|
|
148
|
+
(0, test_utils_1.test)()
|
|
149
149
|
], FakingSkillEventsTest, "authenticateThrowsWhenBadAuth", null);
|
|
150
150
|
__decorate([
|
|
151
|
-
(0,
|
|
151
|
+
(0, test_utils_1.test)()
|
|
152
152
|
], FakingSkillEventsTest, "authenticateThrowsWhenBadAuthId", null);
|
|
153
153
|
__decorate([
|
|
154
|
-
(0,
|
|
154
|
+
(0, test_utils_1.test)()
|
|
155
155
|
], FakingSkillEventsTest, "canAuthenticateAsSkill", null);
|
|
156
156
|
__decorate([
|
|
157
|
-
(0,
|
|
157
|
+
(0, test_utils_1.test)()
|
|
158
158
|
], FakingSkillEventsTest, "returnsTheExpectedSkill", null);
|
|
159
159
|
__decorate([
|
|
160
|
-
(0,
|
|
160
|
+
(0, test_utils_1.test)()
|
|
161
161
|
], FakingSkillEventsTest, "skillSeedsWithPassedValues", null);
|
|
162
162
|
__decorate([
|
|
163
|
-
(0,
|
|
163
|
+
(0, test_utils_1.test)()
|
|
164
164
|
], FakingSkillEventsTest, "whoAmIReturnsSkill", null);
|
|
165
165
|
__decorate([
|
|
166
|
-
(0,
|
|
166
|
+
(0, test_utils_1.test)()
|
|
167
167
|
], FakingSkillEventsTest, "whoAmIReturnsSkillExpectedSkill", null);
|
|
168
168
|
__decorate([
|
|
169
|
-
(0,
|
|
169
|
+
(0, test_utils_1.test)()
|
|
170
170
|
], FakingSkillEventsTest, "returnsCurrentSkillIfEnvSet", null);
|
|
171
171
|
FakingSkillEventsTest = __decorate([
|
|
172
172
|
fake_1.default.login()
|
|
@@ -9,22 +9,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const test_1 = require("@sprucelabs/test");
|
|
13
12
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
13
|
+
const test_utils_2 = require("@sprucelabs/test-utils");
|
|
14
14
|
const __1 = require("../../..");
|
|
15
15
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
|
|
16
16
|
let UpdatePersonTest = class UpdatePersonTest extends AbstractSpruceFixtureTest_1.default {
|
|
17
17
|
static async badUpdateThrowsBadTarget() {
|
|
18
|
-
const err = await
|
|
18
|
+
const err = await test_utils_1.assert.doesThrowAsync(() => this.fakedClient.emitAndFlattenResponses('update-person::v2020_12_25', {
|
|
19
19
|
target: {
|
|
20
|
-
personId: (0,
|
|
20
|
+
personId: (0, test_utils_2.generateId)(),
|
|
21
21
|
},
|
|
22
22
|
}));
|
|
23
|
-
|
|
23
|
+
test_utils_2.errorAssert.assertError(err, 'INVALID_TARGET');
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
__decorate([
|
|
27
|
-
(0,
|
|
27
|
+
(0, test_utils_1.test)()
|
|
28
28
|
], UpdatePersonTest, "badUpdateThrowsBadTarget", null);
|
|
29
29
|
UpdatePersonTest = __decorate([
|
|
30
30
|
__1.fake.login()
|
|
@@ -33,8 +33,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
const schema_1 = require("@sprucelabs/schema");
|
|
36
|
-
const test_1 = require("@sprucelabs/test");
|
|
37
36
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
37
|
+
const test_utils_2 = require("@sprucelabs/test-utils");
|
|
38
38
|
const __1 = require("../../..");
|
|
39
39
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../tests/AbstractSpruceFixtureTest"));
|
|
40
40
|
const fake_1 = __importStar(require("../../../tests/decorators/fake"));
|
|
@@ -55,21 +55,21 @@ let UsingFakeDecoratorsTest = class UsingFakeDecoratorsTest extends AbstractSpru
|
|
|
55
55
|
await this.client.emitAndFlattenResponses('whoami::v2020_12_25');
|
|
56
56
|
}
|
|
57
57
|
static async resetsFakedOwners() {
|
|
58
|
-
|
|
58
|
+
test_utils_1.assert.isEqualDeep(this.fakedOwners, []);
|
|
59
59
|
}
|
|
60
60
|
static async canGetClient() {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
test_utils_1.assert.isEqual(MercuryFixture_1.default.getDefaultClient(), fake_1.default.getClient());
|
|
62
|
+
test_utils_1.assert.isEqual(this.fakedPerson, fake_1.default.getPerson());
|
|
63
63
|
}
|
|
64
64
|
static async skillCallsHooks() {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
test_utils_1.assert.isTrue(this.wasBeforeAllInvoked);
|
|
66
|
+
test_utils_1.assert.isTrue(this.wasBeforeEachInvoked);
|
|
67
67
|
}
|
|
68
68
|
static async canSeedOrganization() {
|
|
69
69
|
const org = await this.organizations.seedDemoOrganization({
|
|
70
70
|
name: 'Test org',
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
test_utils_1.assert.isEqual(org.name, 'Test org');
|
|
73
73
|
}
|
|
74
74
|
static async seedingLocationSeedsToExpectedOrg(orgIdx) {
|
|
75
75
|
const id = this.fakedOrganizations[orgIdx].id;
|
|
@@ -77,7 +77,7 @@ let UsingFakeDecoratorsTest = class UsingFakeDecoratorsTest extends AbstractSpru
|
|
|
77
77
|
name: 'Test location',
|
|
78
78
|
organizationId: id,
|
|
79
79
|
});
|
|
80
|
-
|
|
80
|
+
test_utils_1.assert.isEqual(id, location.organizationId);
|
|
81
81
|
}
|
|
82
82
|
static async canSeedAndListLocations(orgIdx) {
|
|
83
83
|
const id = this.fakedOrganizations[orgIdx].id;
|
|
@@ -87,13 +87,13 @@ let UsingFakeDecoratorsTest = class UsingFakeDecoratorsTest extends AbstractSpru
|
|
|
87
87
|
},
|
|
88
88
|
});
|
|
89
89
|
const expected = this.fakedLocations.filter((l) => l.organizationId === id);
|
|
90
|
-
|
|
90
|
+
test_utils_1.assert.isEqualDeep(locations, expected);
|
|
91
91
|
}
|
|
92
92
|
static async canSeedTeammates(target) {
|
|
93
93
|
let total = 3;
|
|
94
94
|
const { people, fakedRecords } = await this.assertFakedPeople(target, total);
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
test_utils_1.assert.doesNotInclude(people, this.fakedPerson);
|
|
96
|
+
test_utils_1.assert.isEqualDeep(people, fakedRecords);
|
|
97
97
|
}
|
|
98
98
|
static async canSeedOwners() {
|
|
99
99
|
await this.assertFakedPeople('owners', 4);
|
|
@@ -101,16 +101,16 @@ let UsingFakeDecoratorsTest = class UsingFakeDecoratorsTest extends AbstractSpru
|
|
|
101
101
|
static async whoAmIReturnsExpectedPerson() {
|
|
102
102
|
const phone = (0, schema_1.formatPhoneNumber)('555-111-1111');
|
|
103
103
|
const { person, client } = await this.people.loginAsDemoPerson(phone);
|
|
104
|
-
|
|
104
|
+
test_utils_1.assert.isEqual(person.phone, phone);
|
|
105
105
|
const [{ auth }] = await client.emitAndFlattenResponses('whoami::v2020_12_25');
|
|
106
|
-
|
|
106
|
+
test_utils_1.assert.isEqualDeep(auth.person, person);
|
|
107
107
|
}
|
|
108
108
|
static async canSkillBeAnonLogin() {
|
|
109
109
|
const client = await this.mercury.connectToApi({
|
|
110
110
|
shouldReUseClient: false,
|
|
111
111
|
});
|
|
112
112
|
const [{ type }] = await client.emitAndFlattenResponses('whoami::v2020_12_25');
|
|
113
|
-
|
|
113
|
+
test_utils_1.assert.isEqualDeep(type, 'anonymous');
|
|
114
114
|
}
|
|
115
115
|
static async canListTeammatesByLocation() {
|
|
116
116
|
const [{ people }] = await this.client.emitAndFlattenResponses('list-people::v2020_12_25', {
|
|
@@ -119,13 +119,13 @@ let UsingFakeDecoratorsTest = class UsingFakeDecoratorsTest extends AbstractSpru
|
|
|
119
119
|
locationId: this.fakedLocations[0].id,
|
|
120
120
|
},
|
|
121
121
|
});
|
|
122
|
-
|
|
122
|
+
test_utils_1.assert.isLength(people, 5);
|
|
123
123
|
}
|
|
124
124
|
static async setsFakedOwners() {
|
|
125
|
-
|
|
125
|
+
test_utils_1.assert.isEqual(this.fakedPerson, this.fakedOwners[0]);
|
|
126
126
|
}
|
|
127
127
|
static someThingsThrowWhenNotFaked() {
|
|
128
|
-
|
|
128
|
+
test_utils_1.assert.doesThrow(() => this.fakedLocations);
|
|
129
129
|
}
|
|
130
130
|
static async deletingOrgAndLocationDoesNotCrash() {
|
|
131
131
|
await this.client.emit('delete-organization::v2020_12_25', {
|
|
@@ -137,11 +137,11 @@ let UsingFakeDecoratorsTest = class UsingFakeDecoratorsTest extends AbstractSpru
|
|
|
137
137
|
static canBeUsedWithSeedDecorator() { }
|
|
138
138
|
static async canGetLocationById(idx) {
|
|
139
139
|
const location = await this.emitGetLocationEvent(this.fakedLocations[idx].id);
|
|
140
|
-
|
|
140
|
+
test_utils_1.assert.isEqualDeep(location, this.fakedLocations[idx]);
|
|
141
141
|
}
|
|
142
142
|
static async throwsAsExpectedWithBadLocation() {
|
|
143
|
-
const err = await
|
|
144
|
-
|
|
143
|
+
const err = await test_utils_1.assert.doesThrowAsync(() => this.emitGetLocationEvent((0, test_utils_2.generateId)()));
|
|
144
|
+
test_utils_2.errorAssert.assertError(err, 'INVALID_TARGET');
|
|
145
145
|
}
|
|
146
146
|
static async canFilterByManyRolesAtOnceWhenListingPeople() {
|
|
147
147
|
const [{ people }] = await this.client.emitAndFlattenResponses('list-people::v2020_12_25', {
|
|
@@ -149,10 +149,10 @@ let UsingFakeDecoratorsTest = class UsingFakeDecoratorsTest extends AbstractSpru
|
|
|
149
149
|
roleBases: ['teammate', 'manager'],
|
|
150
150
|
},
|
|
151
151
|
});
|
|
152
|
-
|
|
152
|
+
test_utils_1.assert.isLength(people, 2);
|
|
153
153
|
}
|
|
154
154
|
static async listingPeopleThrowsWhenDoingSomethingNotSupported(payload) {
|
|
155
|
-
await
|
|
155
|
+
await test_utils_1.assert.doesThrowAsync(() => this.client.emitAndFlattenResponses('list-people::v2020_12_25', {
|
|
156
156
|
payload,
|
|
157
157
|
}));
|
|
158
158
|
}
|
|
@@ -177,15 +177,15 @@ let UsingFakeDecoratorsTest = class UsingFakeDecoratorsTest extends AbstractSpru
|
|
|
177
177
|
};
|
|
178
178
|
});
|
|
179
179
|
const results = await this.emitWhoAmI();
|
|
180
|
-
|
|
180
|
+
test_utils_1.assert.isLength(results, 1);
|
|
181
181
|
}
|
|
182
182
|
static async thisWhoAmIShouldStillWork() {
|
|
183
183
|
const [{ auth }] = await this.emitWhoAmI();
|
|
184
184
|
const { client } = await this.views.loginAsDemoPerson();
|
|
185
|
-
|
|
185
|
+
test_utils_1.assert.isEqualDeep(DummyStore_1.DummyStore.lastFakedOwner, auth.person);
|
|
186
186
|
//@ts-ignore
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
test_utils_1.assert.isEqualDeep(auth.person, client.auth.person);
|
|
188
|
+
test_utils_1.assert.isEqualDeep(auth.person, this.fakedPerson);
|
|
189
189
|
}
|
|
190
190
|
static async emitWhoAmI() {
|
|
191
191
|
return this.client.emitAndFlattenResponses('whoami::v2020_12_25');
|
|
@@ -193,15 +193,15 @@ let UsingFakeDecoratorsTest = class UsingFakeDecoratorsTest extends AbstractSpru
|
|
|
193
193
|
static async assertFakedPeople(target, total) {
|
|
194
194
|
//@ts-ignore
|
|
195
195
|
const fakedRecords = this[`${(0, fake_1.fakeTargetToPropName)(target)}`];
|
|
196
|
-
|
|
196
|
+
test_utils_1.assert.isLength(fakedRecords, total);
|
|
197
197
|
const people = await this.people.listPeople({
|
|
198
198
|
locationId: this.fakedLocations[0].id,
|
|
199
199
|
roleBases: [(0, fake_1.pluralToSingular)(target)],
|
|
200
200
|
organizationId: this.fakedLocations[0].organizationId,
|
|
201
201
|
});
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
test_utils_1.assert.isLength(people, total);
|
|
203
|
+
test_utils_1.assert.isTruthy(fakedRecords[0].firstName);
|
|
204
|
+
test_utils_1.assert.isNotEqual(fakedRecords[0].casualName, 'friend');
|
|
205
205
|
return { people, fakedRecords };
|
|
206
206
|
}
|
|
207
207
|
};
|
|
@@ -211,35 +211,35 @@ __decorate([
|
|
|
211
211
|
(0, __1.seed)('dummies', 1)
|
|
212
212
|
], UsingFakeDecoratorsTest, "beforeEach", null);
|
|
213
213
|
__decorate([
|
|
214
|
-
(0,
|
|
214
|
+
(0, test_utils_1.test)()
|
|
215
215
|
], UsingFakeDecoratorsTest, "resetsFakedOwners", null);
|
|
216
216
|
__decorate([
|
|
217
|
-
(0,
|
|
217
|
+
(0, test_utils_1.test)()
|
|
218
218
|
], UsingFakeDecoratorsTest, "canGetClient", null);
|
|
219
219
|
__decorate([
|
|
220
|
-
(0,
|
|
220
|
+
(0, test_utils_1.test)()
|
|
221
221
|
], UsingFakeDecoratorsTest, "skillCallsHooks", null);
|
|
222
222
|
__decorate([
|
|
223
|
-
(0,
|
|
223
|
+
(0, test_utils_1.test)()
|
|
224
224
|
], UsingFakeDecoratorsTest, "canSeedOrganization", null);
|
|
225
225
|
__decorate([
|
|
226
|
-
(0,
|
|
227
|
-
(0,
|
|
226
|
+
(0, test_utils_1.test)('can seed location to org 1', 0),
|
|
227
|
+
(0, test_utils_1.test)('can seed location to org 2', 1),
|
|
228
228
|
(0, __1.seed)('organizations', 2)
|
|
229
229
|
], UsingFakeDecoratorsTest, "seedingLocationSeedsToExpectedOrg", null);
|
|
230
230
|
__decorate([
|
|
231
|
-
(0,
|
|
232
|
-
(0,
|
|
231
|
+
(0, test_utils_1.test)('list locations by org 1', 0),
|
|
232
|
+
(0, test_utils_1.test)('list locations by org 0', 1),
|
|
233
233
|
(0, __1.seed)('organizations', 1),
|
|
234
234
|
(0, __1.seed)('locations', 2),
|
|
235
235
|
(0, __1.seed)('organizations', 1),
|
|
236
236
|
(0, __1.seed)('locations', 2)
|
|
237
237
|
], UsingFakeDecoratorsTest, "canSeedAndListLocations", null);
|
|
238
238
|
__decorate([
|
|
239
|
-
(0,
|
|
240
|
-
(0,
|
|
241
|
-
(0,
|
|
242
|
-
(0,
|
|
239
|
+
(0, test_utils_1.test)('can seed teammates', 'teammates'),
|
|
240
|
+
(0, test_utils_1.test)('can seed managers', 'managers'),
|
|
241
|
+
(0, test_utils_1.test)('can seed guests', 'guests'),
|
|
242
|
+
(0, test_utils_1.test)('can seed groupManagers', 'groupManagers'),
|
|
243
243
|
(0, __1.seed)('locations', 1),
|
|
244
244
|
(0, __1.seed)('teammates', 3),
|
|
245
245
|
(0, __1.seed)('managers', 3),
|
|
@@ -247,65 +247,65 @@ __decorate([
|
|
|
247
247
|
(0, __1.seed)('groupManagers', 3)
|
|
248
248
|
], UsingFakeDecoratorsTest, "canSeedTeammates", null);
|
|
249
249
|
__decorate([
|
|
250
|
-
(0,
|
|
250
|
+
(0, test_utils_1.test)(),
|
|
251
251
|
(0, __1.seed)('locations', 1),
|
|
252
252
|
(0, __1.seed)('owners', 3)
|
|
253
253
|
], UsingFakeDecoratorsTest, "canSeedOwners", null);
|
|
254
254
|
__decorate([
|
|
255
|
-
(0,
|
|
255
|
+
(0, test_utils_1.test)(),
|
|
256
256
|
(0, __1.seed)('locations', 1)
|
|
257
257
|
], UsingFakeDecoratorsTest, "whoAmIReturnsExpectedPerson", null);
|
|
258
258
|
__decorate([
|
|
259
|
-
(0,
|
|
259
|
+
(0, test_utils_1.test)()
|
|
260
260
|
], UsingFakeDecoratorsTest, "canSkillBeAnonLogin", null);
|
|
261
261
|
__decorate([
|
|
262
|
-
(0,
|
|
262
|
+
(0, test_utils_1.test)(),
|
|
263
263
|
(0, __1.seed)('locations', 1),
|
|
264
264
|
(0, __1.seed)('teammates', 4)
|
|
265
265
|
], UsingFakeDecoratorsTest, "canListTeammatesByLocation", null);
|
|
266
266
|
__decorate([
|
|
267
|
-
(0,
|
|
267
|
+
(0, test_utils_1.test)(),
|
|
268
268
|
(0, __1.seed)('locations', 1)
|
|
269
269
|
], UsingFakeDecoratorsTest, "setsFakedOwners", null);
|
|
270
270
|
__decorate([
|
|
271
|
-
(0,
|
|
271
|
+
(0, test_utils_1.test)()
|
|
272
272
|
], UsingFakeDecoratorsTest, "someThingsThrowWhenNotFaked", null);
|
|
273
273
|
__decorate([
|
|
274
|
-
(0,
|
|
274
|
+
(0, test_utils_1.test)()
|
|
275
275
|
], UsingFakeDecoratorsTest, "deletingOrgAndLocationDoesNotCrash", null);
|
|
276
276
|
__decorate([
|
|
277
|
-
(0,
|
|
277
|
+
(0, test_utils_1.test)(),
|
|
278
278
|
(0, __1.seed)('good')
|
|
279
279
|
], UsingFakeDecoratorsTest, "canBeUsedWithSeedDecorator", null);
|
|
280
280
|
__decorate([
|
|
281
|
-
(0,
|
|
282
|
-
(0,
|
|
281
|
+
(0, test_utils_1.test)('can get location by id 1', 0),
|
|
282
|
+
(0, test_utils_1.test)('can get location by id 2', 1),
|
|
283
283
|
(0, __1.seed)('locations', 3)
|
|
284
284
|
], UsingFakeDecoratorsTest, "canGetLocationById", null);
|
|
285
285
|
__decorate([
|
|
286
|
-
(0,
|
|
286
|
+
(0, test_utils_1.test)()
|
|
287
287
|
], UsingFakeDecoratorsTest, "throwsAsExpectedWithBadLocation", null);
|
|
288
288
|
__decorate([
|
|
289
|
-
(0,
|
|
289
|
+
(0, test_utils_1.test)(),
|
|
290
290
|
(0, __1.seed)('locations', 1),
|
|
291
291
|
(0, __1.seed)('teammates', 1),
|
|
292
292
|
(0, __1.seed)('managers', 1)
|
|
293
293
|
], UsingFakeDecoratorsTest, "canFilterByManyRolesAtOnceWhenListingPeople", null);
|
|
294
294
|
__decorate([
|
|
295
|
-
(0,
|
|
296
|
-
(0,
|
|
295
|
+
(0, test_utils_1.test)('listing by people by role id throws', { roleIds: [] }),
|
|
296
|
+
(0, test_utils_1.test)('listing by people by person id throws', { personIds: [] })
|
|
297
297
|
], UsingFakeDecoratorsTest, "listingPeopleThrowsWhenDoingSomethingNotSupported", null);
|
|
298
298
|
__decorate([
|
|
299
|
-
(0,
|
|
299
|
+
(0, test_utils_1.test)()
|
|
300
300
|
], UsingFakeDecoratorsTest, "throwingInRequestPinDoesNotCrashNextTest", null);
|
|
301
301
|
__decorate([
|
|
302
|
-
(0,
|
|
302
|
+
(0, test_utils_1.test)()
|
|
303
303
|
], UsingFakeDecoratorsTest, "thisTestShouldNotCrashBecauseTestBeforeIt", null);
|
|
304
304
|
__decorate([
|
|
305
|
-
(0,
|
|
305
|
+
(0, test_utils_1.test)()
|
|
306
306
|
], UsingFakeDecoratorsTest, "shouldBeAbleToOffListenersAndNotBreakEverything", null);
|
|
307
307
|
__decorate([
|
|
308
|
-
(0,
|
|
308
|
+
(0, test_utils_1.test)()
|
|
309
309
|
], UsingFakeDecoratorsTest, "thisWhoAmIShouldStillWork", null);
|
|
310
310
|
UsingFakeDecoratorsTest = __decorate([
|
|
311
311
|
fake_1.default.login('555-000-0001')
|