@sprucelabs/spruce-test-fixtures 61.0.2 → 61.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,6 +52,7 @@ export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
52
52
  protected static deviceIsSetOnFixtureAndFactory(): Promise<void>;
53
53
  protected static newDeviceBeforeEach(): Promise<void>;
54
54
  protected static mutesLogs(): Promise<void>;
55
+ protected static buildVcPluginExposedInFixture(): Promise<void>;
55
56
  private static ViewFixture;
56
57
  private static buildLoadOptions;
57
58
  private static ScopedByOrgVc;
@@ -439,6 +439,22 @@ let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest_1.
439
439
  log.error('hey');
440
440
  log.warn('hey');
441
441
  }
442
+ static async buildVcPluginExposedInFixture() {
443
+ const factory = this.fixture.getFactory();
444
+ let wasHit = false;
445
+ let PassedClass;
446
+ let response = {};
447
+ //@ts-ignore
448
+ factory.BuildPlugin = (Class) => {
449
+ wasHit = true;
450
+ PassedClass = Class;
451
+ return response;
452
+ };
453
+ const plugin = this.fixture.BuildPlugin(SpyVcPlugin);
454
+ test_utils_1.assert.isTrue(wasHit);
455
+ test_utils_1.assert.isEqual(PassedClass, SpyVcPlugin);
456
+ test_utils_1.assert.isEqual(plugin, response);
457
+ }
442
458
  static ViewFixture() {
443
459
  return this.Fixture('view', {
444
460
  controllerMap: {
@@ -635,6 +651,9 @@ __decorate([
635
651
  __decorate([
636
652
  (0, test_utils_1.test)()
637
653
  ], ViewFixtureTest, "mutesLogs", null);
654
+ __decorate([
655
+ (0, test_utils_1.test)()
656
+ ], ViewFixtureTest, "buildVcPluginExposedInFixture", null);
638
657
  ViewFixtureTest = __decorate([
639
658
  fake_1.default.login(DEMO_NUMBER_FORMATTED)
640
659
  ], ViewFixtureTest);
@@ -697,3 +716,5 @@ class ClientSvc extends heartwood_view_controllers_1.AbstractSkillViewController
697
716
  };
698
717
  }
699
718
  }
719
+ class SpyVcPlugin {
720
+ }
@@ -52,6 +52,7 @@ export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
52
52
  protected static deviceIsSetOnFixtureAndFactory(): Promise<void>;
53
53
  protected static newDeviceBeforeEach(): Promise<void>;
54
54
  protected static mutesLogs(): Promise<void>;
55
+ protected static buildVcPluginExposedInFixture(): Promise<void>;
55
56
  private static ViewFixture;
56
57
  private static buildLoadOptions;
57
58
  private static ScopedByOrgVc;
@@ -518,6 +518,24 @@ let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest {
518
518
  log.warn('hey');
519
519
  });
520
520
  }
521
+ static buildVcPluginExposedInFixture() {
522
+ return __awaiter(this, void 0, void 0, function* () {
523
+ const factory = this.fixture.getFactory();
524
+ let wasHit = false;
525
+ let PassedClass;
526
+ let response = {};
527
+ //@ts-ignore
528
+ factory.BuildPlugin = (Class) => {
529
+ wasHit = true;
530
+ PassedClass = Class;
531
+ return response;
532
+ };
533
+ const plugin = this.fixture.BuildPlugin(SpyVcPlugin);
534
+ assert.isTrue(wasHit);
535
+ assert.isEqual(PassedClass, SpyVcPlugin);
536
+ assert.isEqual(plugin, response);
537
+ });
538
+ }
521
539
  static ViewFixture() {
522
540
  return this.Fixture('view', {
523
541
  controllerMap: {
@@ -718,6 +736,9 @@ __decorate([
718
736
  __decorate([
719
737
  test()
720
738
  ], ViewFixtureTest, "mutesLogs", null);
739
+ __decorate([
740
+ test()
741
+ ], ViewFixtureTest, "buildVcPluginExposedInFixture", null);
721
742
  ViewFixtureTest = __decorate([
722
743
  fake.login(DEMO_NUMBER_FORMATTED)
723
744
  ], ViewFixtureTest);
@@ -782,3 +803,5 @@ class ClientSvc extends AbstractSkillViewController {
782
803
  };
783
804
  }
784
805
  }
806
+ class SpyVcPlugin {
807
+ }
@@ -1,5 +1,5 @@
1
1
  import { Locale } from '@sprucelabs/calendar-utils';
2
- import { ControllerOptions, Scope, SkillViewController, SpyDevice, ViewControllerFactory, ViewControllerId, ViewController, ViewControllerConstructor } from '@sprucelabs/heartwood-view-controllers';
2
+ import { ControllerOptions, Scope, SkillViewController, SpyDevice, ViewControllerFactory, ViewControllerId, ViewController, ViewControllerConstructor, ViewControllerPluginOptions, ViewControllerPlugin } from '@sprucelabs/heartwood-view-controllers';
3
3
  import { MercuryClient } from '@sprucelabs/mercury-client';
4
4
  import { SpruceSchemas } from '@sprucelabs/spruce-core-schemas';
5
5
  import { ClientProxyDecorator } from '../..';
@@ -45,6 +45,7 @@ export default class ViewFixture {
45
45
  permissions: PermissionFixture;
46
46
  });
47
47
  getFactory(): ViewControllerFactory;
48
+ BuildPlugin<P extends ViewControllerPlugin>(Plugin: new (options: ViewControllerPluginOptions) => P): P;
48
49
  getMaps(): import("../../utilities/SpyMapUtil").SpyMapUtil;
49
50
  render<VC extends ViewController<any>>(vc: VC): ReturnType<VC['render']>;
50
51
  private static getSharedFactory;
@@ -55,6 +55,9 @@ class ViewFixture {
55
55
  connectToApi: this.connectToApi,
56
56
  });
57
57
  }
58
+ BuildPlugin(Plugin) {
59
+ return this.getFactory().BuildPlugin(Plugin);
60
+ }
58
61
  getMaps() {
59
62
  return spyMapUtil;
60
63
  }
@@ -1,5 +1,5 @@
1
1
  import { Locale } from '@sprucelabs/calendar-utils';
2
- import { ControllerOptions, Scope, SkillViewController, SpyDevice, ViewControllerFactory, ViewControllerId, ViewController, ViewControllerConstructor } from '@sprucelabs/heartwood-view-controllers';
2
+ import { ControllerOptions, Scope, SkillViewController, SpyDevice, ViewControllerFactory, ViewControllerId, ViewController, ViewControllerConstructor, ViewControllerPluginOptions, ViewControllerPlugin } from '@sprucelabs/heartwood-view-controllers';
3
3
  import { MercuryClient } from '@sprucelabs/mercury-client';
4
4
  import { SpruceSchemas } from '@sprucelabs/spruce-core-schemas';
5
5
  import { ClientProxyDecorator } from '../..';
@@ -45,6 +45,7 @@ export default class ViewFixture {
45
45
  permissions: PermissionFixture;
46
46
  });
47
47
  getFactory(): ViewControllerFactory;
48
+ BuildPlugin<P extends ViewControllerPlugin>(Plugin: new (options: ViewControllerPluginOptions) => P): P;
48
49
  getMaps(): import("../../utilities/SpyMapUtil").SpyMapUtil;
49
50
  render<VC extends ViewController<any>>(vc: VC): ReturnType<VC['render']>;
50
51
  private static getSharedFactory;
@@ -51,6 +51,9 @@ class ViewFixture {
51
51
  connectToApi: this.connectToApi,
52
52
  });
53
53
  }
54
+ BuildPlugin(Plugin) {
55
+ return this.getFactory().BuildPlugin(Plugin);
56
+ }
54
57
  getMaps() {
55
58
  return SpyMapUtil_1.default;
56
59
  }
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "@sprucelabs/spruce-test-fixtures"
14
14
  ]
15
15
  },
16
- "version": "61.0.2",
16
+ "version": "61.1.0",
17
17
  "files": [
18
18
  "build/**/*",
19
19
  "!build/__tests__",
@@ -72,7 +72,7 @@
72
72
  "@sprucelabs/spruce-core-schemas": "^39.0.265",
73
73
  "@sprucelabs/spruce-event-utils": "^38.1.10",
74
74
  "@sprucelabs/spruce-permission-utils": "^7.0.541",
75
- "@sprucelabs/spruce-skill-booter": "^61.0.2",
75
+ "@sprucelabs/spruce-skill-booter": "^61.1.0",
76
76
  "@sprucelabs/spruce-skill-utils": "^30.3.27",
77
77
  "@sprucelabs/test-utils": "^4.0.129",
78
78
  "dotenv": "^16.4.5",
@@ -132,5 +132,5 @@
132
132
  ]
133
133
  ]
134
134
  },
135
- "gitHead": "d613d4e53298dff6ab268d96c9c774abf89d34f0"
135
+ "gitHead": "90d89e7ef6ea3a436c1713ae73c2bc979888461e"
136
136
  }