@sprucelabs/spruce-test-fixtures 62.0.129 → 62.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/build/__tests__/behavioral/views/ViewFixture.test.d.ts +5 -0
- package/build/__tests__/behavioral/views/ViewFixture.test.js +39 -0
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.js +48 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/tests/AbstractSpruceFixtureTest.d.ts +3 -1
- package/build/esm/tests/AbstractSpruceFixtureTest.js +7 -0
- package/build/esm/tests/SpyViewControllerFactory.d.ts +4 -0
- package/build/esm/tests/SpyViewControllerFactory.js +6 -0
- package/build/esm/tests/fixtures/ViewFixture.d.ts +1 -0
- package/build/esm/tests/fixtures/ViewFixture.js +5 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -1
- package/build/tests/AbstractSpruceFixtureTest.d.ts +3 -1
- package/build/tests/AbstractSpruceFixtureTest.js +7 -0
- package/build/tests/SpyViewControllerFactory.d.ts +4 -0
- package/build/tests/SpyViewControllerFactory.js +9 -0
- package/build/tests/fixtures/ViewFixture.d.ts +1 -0
- package/build/tests/fixtures/ViewFixture.js +5 -0
- package/package.json +3 -3
@@ -53,6 +53,11 @@ export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
|
53
53
|
protected static newDeviceBeforeEach(): Promise<void>;
|
54
54
|
protected static mutesLogs(): Promise<void>;
|
55
55
|
protected static buildVcPluginExposedInFixture(): Promise<void>;
|
56
|
+
protected static addPluginExposedInFixure(): Promise<void>;
|
57
|
+
protected static getFactoryReturnsSpyFactory(): Promise<void>;
|
58
|
+
protected static spyFactoryResetForEachTest(): Promise<void>;
|
59
|
+
protected static getFactoryReturnsSpyFactoryForNextTest(): Promise<void>;
|
60
|
+
private static assertSpyFactoryUsed;
|
56
61
|
private static ViewFixture;
|
57
62
|
private static buildLoadOptions;
|
58
63
|
private static ScopedByOrgVc;
|
@@ -21,6 +21,7 @@ const fake_1 = __importDefault(require("../../../tests/decorators/fake"));
|
|
21
21
|
const Fake_svc_1 = __importDefault(require("../../../tests/Fake.svc"));
|
22
22
|
const SpyScope_1 = __importDefault(require("../../../tests/fixtures/SpyScope"));
|
23
23
|
const ViewFixture_1 = __importDefault(require("../../../tests/fixtures/ViewFixture"));
|
24
|
+
const SpyViewControllerFactory_1 = __importDefault(require("../../../tests/SpyViewControllerFactory"));
|
24
25
|
const EventFaker_1 = __importDefault(require("../../support/EventFaker"));
|
25
26
|
const FakeThemeManager_1 = __importDefault(require("../../support/FakeThemeManager"));
|
26
27
|
const DEMO_NUMBER_FORMATTED = (0, schema_1.formatPhoneNumber)(constants_1.DEMO_NUMBER !== null && constants_1.DEMO_NUMBER !== void 0 ? constants_1.DEMO_NUMBER : '');
|
@@ -457,6 +458,32 @@ let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest_1.
|
|
457
458
|
test_utils_1.assert.isEqual(PassedClass, SpyVcPlugin);
|
458
459
|
test_utils_1.assert.isEqual(plugin, response);
|
459
460
|
}
|
461
|
+
static async addPluginExposedInFixure() {
|
462
|
+
const factory = this.fixture.getFactory();
|
463
|
+
const name = (0, test_utils_2.generateId)();
|
464
|
+
let passedName;
|
465
|
+
let passedPlugin;
|
466
|
+
const plugin = this.fixture.BuildPlugin(SpyVcPlugin);
|
467
|
+
factory.addPlugin = (named, plugin) => {
|
468
|
+
passedName = named;
|
469
|
+
passedPlugin = plugin;
|
470
|
+
};
|
471
|
+
this.fixture.addPlugin(name, plugin);
|
472
|
+
test_utils_1.assert.isEqual(passedName, name);
|
473
|
+
test_utils_1.assert.isEqual(passedPlugin, plugin);
|
474
|
+
}
|
475
|
+
static async getFactoryReturnsSpyFactory() {
|
476
|
+
this.assertSpyFactoryUsed();
|
477
|
+
}
|
478
|
+
static async spyFactoryResetForEachTest() {
|
479
|
+
delete heartwood_view_controllers_1.ViewControllerFactory.Class;
|
480
|
+
}
|
481
|
+
static async getFactoryReturnsSpyFactoryForNextTest() {
|
482
|
+
this.assertSpyFactoryUsed();
|
483
|
+
}
|
484
|
+
static assertSpyFactoryUsed() {
|
485
|
+
test_utils_1.assert.isInstanceOf(this.fixture.getFactory(), SpyViewControllerFactory_1.default);
|
486
|
+
}
|
460
487
|
static ViewFixture() {
|
461
488
|
return this.Fixture('view', {
|
462
489
|
controllerMap: {
|
@@ -656,6 +683,18 @@ __decorate([
|
|
656
683
|
__decorate([
|
657
684
|
(0, test_utils_1.test)()
|
658
685
|
], ViewFixtureTest, "buildVcPluginExposedInFixture", null);
|
686
|
+
__decorate([
|
687
|
+
(0, test_utils_1.test)()
|
688
|
+
], ViewFixtureTest, "addPluginExposedInFixure", null);
|
689
|
+
__decorate([
|
690
|
+
(0, test_utils_1.test)()
|
691
|
+
], ViewFixtureTest, "getFactoryReturnsSpyFactory", null);
|
692
|
+
__decorate([
|
693
|
+
(0, test_utils_1.test)()
|
694
|
+
], ViewFixtureTest, "spyFactoryResetForEachTest", null);
|
695
|
+
__decorate([
|
696
|
+
(0, test_utils_1.test)()
|
697
|
+
], ViewFixtureTest, "getFactoryReturnsSpyFactoryForNextTest", null);
|
659
698
|
ViewFixtureTest = __decorate([
|
660
699
|
fake_1.default.login(DEMO_NUMBER_FORMATTED)
|
661
700
|
], ViewFixtureTest);
|
@@ -53,6 +53,11 @@ export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
|
53
53
|
protected static newDeviceBeforeEach(): Promise<void>;
|
54
54
|
protected static mutesLogs(): Promise<void>;
|
55
55
|
protected static buildVcPluginExposedInFixture(): Promise<void>;
|
56
|
+
protected static addPluginExposedInFixure(): Promise<void>;
|
57
|
+
protected static getFactoryReturnsSpyFactory(): Promise<void>;
|
58
|
+
protected static spyFactoryResetForEachTest(): Promise<void>;
|
59
|
+
protected static getFactoryReturnsSpyFactoryForNextTest(): Promise<void>;
|
60
|
+
private static assertSpyFactoryUsed;
|
56
61
|
private static ViewFixture;
|
57
62
|
private static buildLoadOptions;
|
58
63
|
private static ScopedByOrgVc;
|
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
13
13
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
14
14
|
});
|
15
15
|
};
|
16
|
-
import { AbstractSkillViewController, AbstractViewController, ActiveRecordListViewController, AuthenticatorImpl, formAssert, SwipeViewControllerImpl, vcAssert, } from '@sprucelabs/heartwood-view-controllers';
|
16
|
+
import { AbstractSkillViewController, AbstractViewController, ActiveRecordListViewController, AuthenticatorImpl, formAssert, SwipeViewControllerImpl, vcAssert, ViewControllerFactory, } from '@sprucelabs/heartwood-view-controllers';
|
17
17
|
import { formatPhoneNumber } from '@sprucelabs/schema';
|
18
18
|
import { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
|
19
19
|
import { assert, test } from '@sprucelabs/test-utils';
|
@@ -25,6 +25,7 @@ import fake from '../../../tests/decorators/fake.js';
|
|
25
25
|
import FakeSkillViewController from '../../../tests/Fake.svc.js';
|
26
26
|
import SpyScope from '../../../tests/fixtures/SpyScope.js';
|
27
27
|
import ViewFixture from '../../../tests/fixtures/ViewFixture.js';
|
28
|
+
import SpyViewControllerFactory from '../../../tests/SpyViewControllerFactory.js';
|
28
29
|
import EventFaker from '../../support/EventFaker.js';
|
29
30
|
import FakeThemeManager from '../../support/FakeThemeManager.js';
|
30
31
|
const DEMO_NUMBER_FORMATTED = formatPhoneNumber(DEMO_NUMBER !== null && DEMO_NUMBER !== void 0 ? DEMO_NUMBER : '');
|
@@ -538,6 +539,40 @@ let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
|
538
539
|
assert.isEqual(plugin, response);
|
539
540
|
});
|
540
541
|
}
|
542
|
+
static addPluginExposedInFixure() {
|
543
|
+
return __awaiter(this, void 0, void 0, function* () {
|
544
|
+
const factory = this.fixture.getFactory();
|
545
|
+
const name = generateId();
|
546
|
+
let passedName;
|
547
|
+
let passedPlugin;
|
548
|
+
const plugin = this.fixture.BuildPlugin(SpyVcPlugin);
|
549
|
+
factory.addPlugin = (named, plugin) => {
|
550
|
+
passedName = named;
|
551
|
+
passedPlugin = plugin;
|
552
|
+
};
|
553
|
+
this.fixture.addPlugin(name, plugin);
|
554
|
+
assert.isEqual(passedName, name);
|
555
|
+
assert.isEqual(passedPlugin, plugin);
|
556
|
+
});
|
557
|
+
}
|
558
|
+
static getFactoryReturnsSpyFactory() {
|
559
|
+
return __awaiter(this, void 0, void 0, function* () {
|
560
|
+
this.assertSpyFactoryUsed();
|
561
|
+
});
|
562
|
+
}
|
563
|
+
static spyFactoryResetForEachTest() {
|
564
|
+
return __awaiter(this, void 0, void 0, function* () {
|
565
|
+
delete ViewControllerFactory.Class;
|
566
|
+
});
|
567
|
+
}
|
568
|
+
static getFactoryReturnsSpyFactoryForNextTest() {
|
569
|
+
return __awaiter(this, void 0, void 0, function* () {
|
570
|
+
this.assertSpyFactoryUsed();
|
571
|
+
});
|
572
|
+
}
|
573
|
+
static assertSpyFactoryUsed() {
|
574
|
+
assert.isInstanceOf(this.fixture.getFactory(), SpyViewControllerFactory);
|
575
|
+
}
|
541
576
|
static ViewFixture() {
|
542
577
|
return this.Fixture('view', {
|
543
578
|
controllerMap: {
|
@@ -741,6 +776,18 @@ __decorate([
|
|
741
776
|
__decorate([
|
742
777
|
test()
|
743
778
|
], ViewFixtureTest, "buildVcPluginExposedInFixture", null);
|
779
|
+
__decorate([
|
780
|
+
test()
|
781
|
+
], ViewFixtureTest, "addPluginExposedInFixure", null);
|
782
|
+
__decorate([
|
783
|
+
test()
|
784
|
+
], ViewFixtureTest, "getFactoryReturnsSpyFactory", null);
|
785
|
+
__decorate([
|
786
|
+
test()
|
787
|
+
], ViewFixtureTest, "spyFactoryResetForEachTest", null);
|
788
|
+
__decorate([
|
789
|
+
test()
|
790
|
+
], ViewFixtureTest, "getFactoryReturnsSpyFactoryForNextTest", null);
|
744
791
|
ViewFixtureTest = __decorate([
|
745
792
|
fake.login(DEMO_NUMBER_FORMATTED)
|
746
793
|
], ViewFixtureTest);
|
package/build/esm/index.d.ts
CHANGED
@@ -23,6 +23,7 @@ export { default as ClientProxyDecorator } from './ClientProxyDecorator';
|
|
23
23
|
export { default as FakeThemeManager } from './__tests__/support/FakeThemeManager';
|
24
24
|
export { default as SpyScope } from './tests/fixtures/SpyScope';
|
25
25
|
export { default as FakeAuthorizer } from './tests/FakeAuthorizer';
|
26
|
+
export { default as SpyViewControllerFactory } from './tests/SpyViewControllerFactory';
|
26
27
|
/**
|
27
28
|
* @deprecated phoneNumberIncrementer -> phoneNumberIncrementor
|
28
29
|
*/
|
package/build/esm/index.js
CHANGED
@@ -23,6 +23,7 @@ export { default as ClientProxyDecorator } from './ClientProxyDecorator.js';
|
|
23
23
|
export { default as FakeThemeManager } from './__tests__/support/FakeThemeManager.js';
|
24
24
|
export { default as SpyScope } from './tests/fixtures/SpyScope.js';
|
25
25
|
export { default as FakeAuthorizer } from './tests/FakeAuthorizer.js';
|
26
|
+
export { default as SpyViewControllerFactory } from './tests/SpyViewControllerFactory.js';
|
26
27
|
/**
|
27
28
|
* @deprecated phoneNumberIncrementer -> phoneNumberIncrementor
|
28
29
|
*/
|
@@ -16,7 +16,6 @@ import StoreFixture from './fixtures/StoreFixture';
|
|
16
16
|
import ViewFixture from './fixtures/ViewFixture';
|
17
17
|
export default abstract class AbstractSpruceFixtureTest extends AbstractSkillTest {
|
18
18
|
static fakedPerson: Person;
|
19
|
-
static fakedClient: MercuryClient;
|
20
19
|
static fakedPeople: Person[];
|
21
20
|
static fakedTeammates: Person[];
|
22
21
|
static fakedOwners: Person[];
|
@@ -28,6 +27,7 @@ export default abstract class AbstractSpruceFixtureTest extends AbstractSkillTes
|
|
28
27
|
private static _fakedOrganizations;
|
29
28
|
private static _fakedLocations;
|
30
29
|
static cwd: string;
|
30
|
+
static _fakedClient?: MercuryClient;
|
31
31
|
private static _views?;
|
32
32
|
private static _roles?;
|
33
33
|
private static _locations?;
|
@@ -76,6 +76,8 @@ export default abstract class AbstractSpruceFixtureTest extends AbstractSkillTes
|
|
76
76
|
executionPromise: Promise<void>;
|
77
77
|
}>;
|
78
78
|
protected static SkillFromTestDir(key: string, options?: SkillFactoryOptions | undefined): Promise<Skill>;
|
79
|
+
static get fakedClient(): MercuryClient;
|
80
|
+
static set fakedClient(client: MercuryClient);
|
79
81
|
static get fakedOrganizations(): Organization[];
|
80
82
|
static set fakedOrganizations(orgs: Organization[]);
|
81
83
|
static get fakedLocations(): Location[];
|
@@ -125,6 +125,13 @@ class AbstractSpruceFixtureTest extends AbstractSkillTest {
|
|
125
125
|
return skill;
|
126
126
|
});
|
127
127
|
}
|
128
|
+
static get fakedClient() {
|
129
|
+
assert.isTruthy(this._fakedClient, `You gotta @fake.login() on your test class to get the test client.`);
|
130
|
+
return this._fakedClient;
|
131
|
+
}
|
132
|
+
static set fakedClient(client) {
|
133
|
+
this._fakedClient = client;
|
134
|
+
}
|
128
135
|
static get fakedOrganizations() {
|
129
136
|
return this._fakedOrganizations;
|
130
137
|
}
|
@@ -44,6 +44,7 @@ export default class ViewFixture {
|
|
44
44
|
proxyDecorator: ClientProxyDecorator;
|
45
45
|
permissions: PermissionFixture;
|
46
46
|
});
|
47
|
+
addPlugin(name: string, plugin: ViewControllerPlugin): void;
|
47
48
|
getFactory(): ViewControllerFactory;
|
48
49
|
BuildPlugin<P extends ViewControllerPlugin>(Plugin: new (options: ViewControllerPluginOptions) => P): P;
|
49
50
|
getMaps(): import("../../utilities/SpyMapUtil").SpyMapUtil;
|
@@ -17,6 +17,7 @@ import spyMapUtil from '../../utilities/SpyMapUtil.js';
|
|
17
17
|
import vcDiskUtil from '../../utilities/vcDisk.utility.js';
|
18
18
|
import FakeSkillViewController from '../Fake.svc.js';
|
19
19
|
import TestRouter from '../routers/TestRouter.js';
|
20
|
+
import SpyViewControllerFactory from '../SpyViewControllerFactory.js';
|
20
21
|
import { doesScopeIncludeLocation, doesScopeIncludeOrganization, } from './scopeUtils.js';
|
21
22
|
import SpyScope from './SpyScope.js';
|
22
23
|
class ViewFixture {
|
@@ -48,6 +49,9 @@ class ViewFixture {
|
|
48
49
|
organizations: this.orgs,
|
49
50
|
});
|
50
51
|
}
|
52
|
+
addPlugin(name, plugin) {
|
53
|
+
this.getFactory().addPlugin(name, plugin);
|
54
|
+
}
|
51
55
|
getFactory() {
|
52
56
|
return ViewFixture.getSharedFactory({
|
53
57
|
namespace: this.namespace,
|
@@ -160,6 +164,7 @@ class ViewFixture {
|
|
160
164
|
}
|
161
165
|
static beforeEach() {
|
162
166
|
return __awaiter(this, void 0, void 0, function* () {
|
167
|
+
ViewControllerFactory.Class = SpyViewControllerFactory;
|
163
168
|
SwipeViewControllerImpl.swipeDelay = 0;
|
164
169
|
if (this.shouldAutomaticallyResetAuthenticator) {
|
165
170
|
this.resetAuth();
|
package/build/index.d.ts
CHANGED
@@ -23,6 +23,7 @@ export { default as ClientProxyDecorator } from './ClientProxyDecorator';
|
|
23
23
|
export { default as FakeThemeManager } from './__tests__/support/FakeThemeManager';
|
24
24
|
export { default as SpyScope } from './tests/fixtures/SpyScope';
|
25
25
|
export { default as FakeAuthorizer } from './tests/FakeAuthorizer';
|
26
|
+
export { default as SpyViewControllerFactory } from './tests/SpyViewControllerFactory';
|
26
27
|
/**
|
27
28
|
* @deprecated phoneNumberIncrementer -> phoneNumberIncrementor
|
28
29
|
*/
|
package/build/index.js
CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
18
18
|
};
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
20
|
-
exports.phoneNumberIncrementor = exports.phoneNumberIncrementer = exports.FakeAuthorizer = exports.SpyScope = exports.FakeThemeManager = exports.ClientProxyDecorator = exports.eventFaker = exports.fake = exports.install = exports.login = exports.seed = exports.TestRouter = exports.vcDiskUtil = exports.FakeSkillViewController = exports.MercuryFixture = exports.ViewControllerFixture = exports.RoleFixture = exports.ViewFixture = exports.LocationFixture = exports.SkillFixture = exports.PersonFixture = exports.StoreFixture = exports.OrganizationFixture = exports.AbstractSpruceFixtureTest = void 0;
|
20
|
+
exports.phoneNumberIncrementor = exports.phoneNumberIncrementer = exports.SpyViewControllerFactory = exports.FakeAuthorizer = exports.SpyScope = exports.FakeThemeManager = exports.ClientProxyDecorator = exports.eventFaker = exports.fake = exports.install = exports.login = exports.seed = exports.TestRouter = exports.vcDiskUtil = exports.FakeSkillViewController = exports.MercuryFixture = exports.ViewControllerFixture = exports.RoleFixture = exports.ViewFixture = exports.LocationFixture = exports.SkillFixture = exports.PersonFixture = exports.StoreFixture = exports.OrganizationFixture = exports.AbstractSpruceFixtureTest = void 0;
|
21
21
|
var AbstractSpruceFixtureTest_1 = require("./tests/AbstractSpruceFixtureTest");
|
22
22
|
Object.defineProperty(exports, "AbstractSpruceFixtureTest", { enumerable: true, get: function () { return __importDefault(AbstractSpruceFixtureTest_1).default; } });
|
23
23
|
__exportStar(require("./types/fixture.types"), exports);
|
@@ -65,6 +65,8 @@ var SpyScope_1 = require("./tests/fixtures/SpyScope");
|
|
65
65
|
Object.defineProperty(exports, "SpyScope", { enumerable: true, get: function () { return __importDefault(SpyScope_1).default; } });
|
66
66
|
var FakeAuthorizer_1 = require("./tests/FakeAuthorizer");
|
67
67
|
Object.defineProperty(exports, "FakeAuthorizer", { enumerable: true, get: function () { return __importDefault(FakeAuthorizer_1).default; } });
|
68
|
+
var SpyViewControllerFactory_1 = require("./tests/SpyViewControllerFactory");
|
69
|
+
Object.defineProperty(exports, "SpyViewControllerFactory", { enumerable: true, get: function () { return __importDefault(SpyViewControllerFactory_1).default; } });
|
68
70
|
/**
|
69
71
|
* @deprecated phoneNumberIncrementer -> phoneNumberIncrementor
|
70
72
|
*/
|
@@ -16,7 +16,6 @@ import StoreFixture from './fixtures/StoreFixture';
|
|
16
16
|
import ViewFixture from './fixtures/ViewFixture';
|
17
17
|
export default abstract class AbstractSpruceFixtureTest extends AbstractSkillTest {
|
18
18
|
static fakedPerson: Person;
|
19
|
-
static fakedClient: MercuryClient;
|
20
19
|
static fakedPeople: Person[];
|
21
20
|
static fakedTeammates: Person[];
|
22
21
|
static fakedOwners: Person[];
|
@@ -28,6 +27,7 @@ export default abstract class AbstractSpruceFixtureTest extends AbstractSkillTes
|
|
28
27
|
private static _fakedOrganizations;
|
29
28
|
private static _fakedLocations;
|
30
29
|
static cwd: string;
|
30
|
+
static _fakedClient?: MercuryClient;
|
31
31
|
private static _views?;
|
32
32
|
private static _roles?;
|
33
33
|
private static _locations?;
|
@@ -76,6 +76,8 @@ export default abstract class AbstractSpruceFixtureTest extends AbstractSkillTes
|
|
76
76
|
executionPromise: Promise<void>;
|
77
77
|
}>;
|
78
78
|
protected static SkillFromTestDir(key: string, options?: SkillFactoryOptions | undefined): Promise<Skill>;
|
79
|
+
static get fakedClient(): MercuryClient;
|
80
|
+
static set fakedClient(client: MercuryClient);
|
79
81
|
static get fakedOrganizations(): Organization[];
|
80
82
|
static set fakedOrganizations(orgs: Organization[]);
|
81
83
|
static get fakedLocations(): Location[];
|
@@ -92,6 +92,13 @@ class AbstractSpruceFixtureTest extends spruce_skill_booter_1.AbstractSkillTest
|
|
92
92
|
this._fixtures = undefined;
|
93
93
|
return skill;
|
94
94
|
}
|
95
|
+
static get fakedClient() {
|
96
|
+
test_utils_1.assert.isTruthy(this._fakedClient, `You gotta @fake.login() on your test class to get the test client.`);
|
97
|
+
return this._fakedClient;
|
98
|
+
}
|
99
|
+
static set fakedClient(client) {
|
100
|
+
this._fakedClient = client;
|
101
|
+
}
|
95
102
|
static get fakedOrganizations() {
|
96
103
|
return this._fakedOrganizations;
|
97
104
|
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
|
4
|
+
class SpyViewControllerFactory extends heartwood_view_controllers_1.ViewControllerFactory {
|
5
|
+
getPlugins() {
|
6
|
+
return this.plugins;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
exports.default = SpyViewControllerFactory;
|
@@ -44,6 +44,7 @@ export default class ViewFixture {
|
|
44
44
|
proxyDecorator: ClientProxyDecorator;
|
45
45
|
permissions: PermissionFixture;
|
46
46
|
});
|
47
|
+
addPlugin(name: string, plugin: ViewControllerPlugin): void;
|
47
48
|
getFactory(): ViewControllerFactory;
|
48
49
|
BuildPlugin<P extends ViewControllerPlugin>(Plugin: new (options: ViewControllerPluginOptions) => P): P;
|
49
50
|
getMaps(): import("../../utilities/SpyMapUtil").SpyMapUtil;
|
@@ -13,6 +13,7 @@ const SpyMapUtil_1 = __importDefault(require("../../utilities/SpyMapUtil"));
|
|
13
13
|
const vcDisk_utility_1 = __importDefault(require("../../utilities/vcDisk.utility"));
|
14
14
|
const Fake_svc_1 = __importDefault(require("../Fake.svc"));
|
15
15
|
const TestRouter_1 = __importDefault(require("../routers/TestRouter"));
|
16
|
+
const SpyViewControllerFactory_1 = __importDefault(require("../SpyViewControllerFactory"));
|
16
17
|
const scopeUtils_1 = require("./scopeUtils");
|
17
18
|
const SpyScope_1 = __importDefault(require("./SpyScope"));
|
18
19
|
class ViewFixture {
|
@@ -44,6 +45,9 @@ class ViewFixture {
|
|
44
45
|
organizations: this.orgs,
|
45
46
|
});
|
46
47
|
}
|
48
|
+
addPlugin(name, plugin) {
|
49
|
+
this.getFactory().addPlugin(name, plugin);
|
50
|
+
}
|
47
51
|
getFactory() {
|
48
52
|
return ViewFixture.getSharedFactory({
|
49
53
|
namespace: this.namespace,
|
@@ -153,6 +157,7 @@ class ViewFixture {
|
|
153
157
|
this.resetAuth();
|
154
158
|
}
|
155
159
|
static async beforeEach() {
|
160
|
+
heartwood_view_controllers_1.ViewControllerFactory.Class = SpyViewControllerFactory_1.default;
|
156
161
|
heartwood_view_controllers_1.SwipeViewControllerImpl.swipeDelay = 0;
|
157
162
|
if (this.shouldAutomaticallyResetAuthenticator) {
|
158
163
|
this.resetAuth();
|
package/package.json
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
"@sprucelabs/spruce-test-fixtures"
|
14
14
|
]
|
15
15
|
},
|
16
|
-
"version": "62.0
|
16
|
+
"version": "62.2.0",
|
17
17
|
"files": [
|
18
18
|
"build/**/*",
|
19
19
|
"!build/__tests__",
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"@sprucelabs/spruce-core-schemas": "^40.1.38",
|
72
72
|
"@sprucelabs/spruce-event-utils": "^40.0.107",
|
73
73
|
"@sprucelabs/spruce-permission-utils": "^8.0.158",
|
74
|
-
"@sprucelabs/spruce-skill-booter": "^62.0
|
74
|
+
"@sprucelabs/spruce-skill-booter": "^62.2.0",
|
75
75
|
"@sprucelabs/spruce-skill-utils": "^31.0.109",
|
76
76
|
"@sprucelabs/test-utils": "^5.0.85",
|
77
77
|
"dotenv": "^16.4.5",
|
@@ -114,5 +114,5 @@
|
|
114
114
|
"^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
|
115
115
|
}
|
116
116
|
},
|
117
|
-
"gitHead": "
|
117
|
+
"gitHead": "254fb52f745d3e86781088ed19f4368568bc907d"
|
118
118
|
}
|