@sprucelabs/spruce-test-fixtures 62.1.0 → 62.2.1
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 +4 -0
- package/build/__tests__/behavioral/views/ViewFixture.test.js +22 -0
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.js +29 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/tests/SpyViewControllerFactory.d.ts +4 -0
- package/build/esm/tests/SpyViewControllerFactory.js +6 -0
- package/build/esm/tests/fixtures/ViewFixture.js +2 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -1
- package/build/tests/SpyViewControllerFactory.d.ts +4 -0
- package/build/tests/SpyViewControllerFactory.js +9 -0
- package/build/tests/fixtures/ViewFixture.js +2 -0
- package/package.json +5 -5
@@ -54,6 +54,10 @@ export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
|
54
54
|
protected static mutesLogs(): Promise<void>;
|
55
55
|
protected static buildVcPluginExposedInFixture(): Promise<void>;
|
56
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;
|
57
61
|
private static ViewFixture;
|
58
62
|
private static buildLoadOptions;
|
59
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 : '');
|
@@ -471,6 +472,18 @@ let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest_1.
|
|
471
472
|
test_utils_1.assert.isEqual(passedName, name);
|
472
473
|
test_utils_1.assert.isEqual(passedPlugin, plugin);
|
473
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
|
+
}
|
474
487
|
static ViewFixture() {
|
475
488
|
return this.Fixture('view', {
|
476
489
|
controllerMap: {
|
@@ -673,6 +686,15 @@ __decorate([
|
|
673
686
|
__decorate([
|
674
687
|
(0, test_utils_1.test)()
|
675
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);
|
676
698
|
ViewFixtureTest = __decorate([
|
677
699
|
fake_1.default.login(DEMO_NUMBER_FORMATTED)
|
678
700
|
], ViewFixtureTest);
|
@@ -54,6 +54,10 @@ export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
|
54
54
|
protected static mutesLogs(): Promise<void>;
|
55
55
|
protected static buildVcPluginExposedInFixture(): Promise<void>;
|
56
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;
|
57
61
|
private static ViewFixture;
|
58
62
|
private static buildLoadOptions;
|
59
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 : '');
|
@@ -554,6 +555,24 @@ let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
|
554
555
|
assert.isEqual(passedPlugin, plugin);
|
555
556
|
});
|
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
|
+
}
|
557
576
|
static ViewFixture() {
|
558
577
|
return this.Fixture('view', {
|
559
578
|
controllerMap: {
|
@@ -760,6 +779,15 @@ __decorate([
|
|
760
779
|
__decorate([
|
761
780
|
test()
|
762
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);
|
763
791
|
ViewFixtureTest = __decorate([
|
764
792
|
fake.login(DEMO_NUMBER_FORMATTED)
|
765
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
|
*/
|
@@ -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 {
|
@@ -163,6 +164,7 @@ class ViewFixture {
|
|
163
164
|
}
|
164
165
|
static beforeEach() {
|
165
166
|
return __awaiter(this, void 0, void 0, function* () {
|
167
|
+
ViewControllerFactory.Class = SpyViewControllerFactory;
|
166
168
|
SwipeViewControllerImpl.swipeDelay = 0;
|
167
169
|
if (this.shouldAutomaticallyResetAuthenticator) {
|
168
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
|
*/
|
@@ -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;
|
@@ -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 {
|
@@ -156,6 +157,7 @@ class ViewFixture {
|
|
156
157
|
this.resetAuth();
|
157
158
|
}
|
158
159
|
static async beforeEach() {
|
160
|
+
heartwood_view_controllers_1.ViewControllerFactory.Class = SpyViewControllerFactory_1.default;
|
159
161
|
heartwood_view_controllers_1.SwipeViewControllerImpl.swipeDelay = 0;
|
160
162
|
if (this.shouldAutomaticallyResetAuthenticator) {
|
161
163
|
this.resetAuth();
|
package/package.json
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
"@sprucelabs/spruce-test-fixtures"
|
14
14
|
]
|
15
15
|
},
|
16
|
-
"version": "62.1
|
16
|
+
"version": "62.2.1",
|
17
17
|
"files": [
|
18
18
|
"build/**/*",
|
19
19
|
"!build/__tests__",
|
@@ -63,15 +63,15 @@
|
|
63
63
|
"dependencies": {
|
64
64
|
"@sprucelabs/data-stores": "^28.1.47",
|
65
65
|
"@sprucelabs/error": "^6.0.55",
|
66
|
-
"@sprucelabs/heartwood-view-controllers": "^110.4.
|
66
|
+
"@sprucelabs/heartwood-view-controllers": "^110.4.19",
|
67
67
|
"@sprucelabs/mercury-client": "^42.0.128",
|
68
|
-
"@sprucelabs/mercury-core-events": "^24.0.
|
68
|
+
"@sprucelabs/mercury-core-events": "^24.0.122",
|
69
69
|
"@sprucelabs/mercury-event-emitter": "^42.0.128",
|
70
70
|
"@sprucelabs/schema": "^30.0.98",
|
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.1
|
74
|
+
"@sprucelabs/spruce-skill-booter": "^62.2.1",
|
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": "8ff9fcfb30b8286b8ea489ab714a1a050a1f3344"
|
118
118
|
}
|