@sprucelabs/spruce-test-fixtures 60.1.134 → 60.1.136

Sign up to get free protection for your applications and to get access to all the features.
@@ -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', ({ source }) => {
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
- Class.fakedProxyTokens.push({
610
- personId: source.personId,
611
- token,
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', ({ source }) => {
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
- Class.fakedProxyTokens.push({
561
- personId: source.personId,
562
- token,
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.134",
16
+ "version": "60.1.136",
17
17
  "files": [
18
18
  "build/**/*",
19
19
  "!build/__tests__",
@@ -62,27 +62,27 @@
62
62
  "lint.tsc": "tsc -p . --noEmit"
63
63
  },
64
64
  "dependencies": {
65
- "@sprucelabs/data-stores": "^26.4.4",
65
+ "@sprucelabs/data-stores": "^26.4.5",
66
66
  "@sprucelabs/error": "^5.1.57",
67
- "@sprucelabs/heartwood-view-controllers": "^108.30.2",
68
- "@sprucelabs/mercury-client": "^41.0.191",
69
- "@sprucelabs/mercury-core-events": "^22.1.1",
70
- "@sprucelabs/mercury-event-emitter": "^41.0.191",
67
+ "@sprucelabs/heartwood-view-controllers": "^108.32.1",
68
+ "@sprucelabs/mercury-client": "^41.0.192",
69
+ "@sprucelabs/mercury-core-events": "^22.1.2",
70
+ "@sprucelabs/mercury-event-emitter": "^41.0.192",
71
71
  "@sprucelabs/schema": "^29.3.7",
72
72
  "@sprucelabs/spruce-core-schemas": "^39.0.170",
73
- "@sprucelabs/spruce-event-utils": "^38.0.195",
74
- "@sprucelabs/spruce-permission-utils": "^7.0.322",
75
- "@sprucelabs/spruce-skill-booter": "^60.1.134",
76
- "@sprucelabs/spruce-skill-utils": "^30.1.56",
73
+ "@sprucelabs/spruce-event-utils": "^38.0.196",
74
+ "@sprucelabs/spruce-permission-utils": "^7.0.323",
75
+ "@sprucelabs/spruce-skill-booter": "^60.1.136",
76
+ "@sprucelabs/spruce-skill-utils": "^30.1.57",
77
77
  "@sprucelabs/test-utils": "^4.0.93",
78
78
  "dotenv": "^16.3.1",
79
79
  "unique-names-generator": "^4.7.1"
80
80
  },
81
81
  "devDependencies": {
82
- "@sprucelabs/esm-postbuild": "^5.0.117",
82
+ "@sprucelabs/esm-postbuild": "^5.0.118",
83
83
  "@sprucelabs/jest-json-reporter": "^7.0.139",
84
84
  "@sprucelabs/jest-sheets-reporter": "^3.0.26",
85
- "@sprucelabs/mercury-types": "^46.0.164",
85
+ "@sprucelabs/mercury-types": "^46.0.165",
86
86
  "@sprucelabs/resolve-path-aliases": "^1.1.275",
87
87
  "@sprucelabs/semantic-release": "^4.0.8",
88
88
  "@sprucelabs/test": "^8.0.39",
@@ -132,5 +132,5 @@
132
132
  ]
133
133
  ]
134
134
  },
135
- "gitHead": "e12b36ebb476c199514b8de5b059e2adf86ee1bc"
135
+ "gitHead": "9865bc72bcfc789f6af58cc341a4896ba24cb6d0"
136
136
  }