@sprucelabs/spruce-test-fixtures 60.1.134 → 60.1.135
Sign up to get free protection for your applications and to get access to all the features.
- package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +1 -0
- package/build/__tests__/behavioral/faking/FakeDecorator.test.js +7 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +1 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +9 -0
- package/build/esm/tests/decorators/fake.js +8 -5
- package/build/tests/decorators/fake.js +8 -5
- package/package.json +3 -3
@@ -31,6 +31,7 @@ export default class FakeDecoratorTest extends AbstractFakeDecoratorTest {
|
|
31
31
|
protected static canLoginAsPersonAndGetThemBack(phone: string): Promise<void>;
|
32
32
|
protected static sendingBadChallengeThrows(): Promise<void>;
|
33
33
|
protected static fakesSkillLifecycleEvents(): Promise<void>;
|
34
|
+
protected static callingRegisterProxyTokenOnAnonClientDoesNotThrough(): Promise<void>;
|
34
35
|
private static fakeLoginAndListRoles;
|
35
36
|
private static seedAndGetNewestOrganization;
|
36
37
|
private static seedAndGetNewestLocation;
|
@@ -247,6 +247,10 @@ class FakeDecoratorTest extends AbstractFakeDecoratorTest_1.default {
|
|
247
247
|
},
|
248
248
|
});
|
249
249
|
}
|
250
|
+
static async callingRegisterProxyTokenOnAnonClientDoesNotThrough() {
|
251
|
+
const client = await this.mercury.connectToApi({ shouldReUseClient: false });
|
252
|
+
await client.emitAndFlattenResponses('register-proxy-token::v2020_12_25');
|
253
|
+
}
|
250
254
|
static async fakeLoginAndListRoles(orgIdx) {
|
251
255
|
await this.fakeLoginAndRecords('organizations', 2);
|
252
256
|
const [{ roles }] = await this.client.emitAndFlattenResponses('list-roles::v2020_12_25', {
|
@@ -409,3 +413,6 @@ __decorate([
|
|
409
413
|
__decorate([
|
410
414
|
(0, test_utils_1.test)()
|
411
415
|
], FakeDecoratorTest, "fakesSkillLifecycleEvents", null);
|
416
|
+
__decorate([
|
417
|
+
(0, test_utils_1.test)()
|
418
|
+
], FakeDecoratorTest, "callingRegisterProxyTokenOnAnonClientDoesNotThrough", null);
|
@@ -31,6 +31,7 @@ export default class FakeDecoratorTest extends AbstractFakeDecoratorTest {
|
|
31
31
|
protected static canLoginAsPersonAndGetThemBack(phone: string): Promise<void>;
|
32
32
|
protected static sendingBadChallengeThrows(): Promise<void>;
|
33
33
|
protected static fakesSkillLifecycleEvents(): Promise<void>;
|
34
|
+
protected static callingRegisterProxyTokenOnAnonClientDoesNotThrough(): Promise<void>;
|
34
35
|
private static fakeLoginAndListRoles;
|
35
36
|
private static seedAndGetNewestOrganization;
|
36
37
|
private static seedAndGetNewestLocation;
|
@@ -285,6 +285,12 @@ export default class FakeDecoratorTest extends AbstractFakeDecoratorTest {
|
|
285
285
|
});
|
286
286
|
});
|
287
287
|
}
|
288
|
+
static callingRegisterProxyTokenOnAnonClientDoesNotThrough() {
|
289
|
+
return __awaiter(this, void 0, void 0, function* () {
|
290
|
+
const client = yield this.mercury.connectToApi({ shouldReUseClient: false });
|
291
|
+
yield client.emitAndFlattenResponses('register-proxy-token::v2020_12_25');
|
292
|
+
});
|
293
|
+
}
|
288
294
|
static fakeLoginAndListRoles(orgIdx) {
|
289
295
|
return __awaiter(this, void 0, void 0, function* () {
|
290
296
|
yield this.fakeLoginAndRecords('organizations', 2);
|
@@ -468,3 +474,6 @@ __decorate([
|
|
468
474
|
__decorate([
|
469
475
|
test()
|
470
476
|
], FakeDecoratorTest, "fakesSkillLifecycleEvents", null);
|
477
|
+
__decorate([
|
478
|
+
test()
|
479
|
+
], FakeDecoratorTest, "callingRegisterProxyTokenOnAnonClientDoesNotThrough", null);
|
@@ -604,12 +604,15 @@ function fakeWhoAmI(Class) {
|
|
604
604
|
}
|
605
605
|
function fakeRegisterProxyToken(Class) {
|
606
606
|
return __awaiter(this, void 0, void 0, function* () {
|
607
|
-
yield eventFaker.on('register-proxy-token::v2020_12_25', (
|
607
|
+
yield eventFaker.on('register-proxy-token::v2020_12_25', (targeAndPayload) => {
|
608
|
+
const { source } = targeAndPayload !== null && targeAndPayload !== void 0 ? targeAndPayload : {};
|
608
609
|
const token = generateId();
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
610
|
+
if (source === null || source === void 0 ? void 0 : source.personId) {
|
611
|
+
Class.fakedProxyTokens.push({
|
612
|
+
personId: source.personId,
|
613
|
+
token,
|
614
|
+
});
|
615
|
+
}
|
613
616
|
return {
|
614
617
|
token,
|
615
618
|
};
|
@@ -555,12 +555,15 @@ async function fakeWhoAmI(Class) {
|
|
555
555
|
});
|
556
556
|
}
|
557
557
|
async function fakeRegisterProxyToken(Class) {
|
558
|
-
await eventFaker_1.default.on('register-proxy-token::v2020_12_25', (
|
558
|
+
await eventFaker_1.default.on('register-proxy-token::v2020_12_25', (targeAndPayload) => {
|
559
|
+
const { source } = targeAndPayload !== null && targeAndPayload !== void 0 ? targeAndPayload : {};
|
559
560
|
const token = (0, test_utils_2.generateId)();
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
561
|
+
if (source === null || source === void 0 ? void 0 : source.personId) {
|
562
|
+
Class.fakedProxyTokens.push({
|
563
|
+
personId: source.personId,
|
564
|
+
token,
|
565
|
+
});
|
566
|
+
}
|
564
567
|
return {
|
565
568
|
token,
|
566
569
|
};
|
package/package.json
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
"@sprucelabs/spruce-test-fixtures"
|
14
14
|
]
|
15
15
|
},
|
16
|
-
"version": "60.1.
|
16
|
+
"version": "60.1.135",
|
17
17
|
"files": [
|
18
18
|
"build/**/*",
|
19
19
|
"!build/__tests__",
|
@@ -72,7 +72,7 @@
|
|
72
72
|
"@sprucelabs/spruce-core-schemas": "^39.0.170",
|
73
73
|
"@sprucelabs/spruce-event-utils": "^38.0.195",
|
74
74
|
"@sprucelabs/spruce-permission-utils": "^7.0.322",
|
75
|
-
"@sprucelabs/spruce-skill-booter": "^60.1.
|
75
|
+
"@sprucelabs/spruce-skill-booter": "^60.1.135",
|
76
76
|
"@sprucelabs/spruce-skill-utils": "^30.1.56",
|
77
77
|
"@sprucelabs/test-utils": "^4.0.93",
|
78
78
|
"dotenv": "^16.3.1",
|
@@ -132,5 +132,5 @@
|
|
132
132
|
]
|
133
133
|
]
|
134
134
|
},
|
135
|
-
"gitHead": "
|
135
|
+
"gitHead": "a00fe9c68447aaf3cdd3749ec85d613a3fd36019"
|
136
136
|
}
|