@sprucelabs/spruce-test-fixtures 62.2.3 → 62.2.4
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 → viewFixture/ViewFixture.test.d.ts} +2 -2
- package/build/__tests__/behavioral/views/{ViewFixture.test.js → viewFixture/ViewFixture.test.js} +12 -12
- package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +5 -0
- package/build/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +29 -0
- package/build/esm/__tests__/behavioral/views/{ViewFixture.test.d.ts → viewFixture/ViewFixture.test.d.ts} +2 -2
- package/build/esm/__tests__/behavioral/views/{ViewFixture.test.js → viewFixture/ViewFixture.test.js} +12 -12
- package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/views/viewFixture/ViewFixtureLetsYouOverrideViewControllerFactory.test.js +39 -0
- package/build/esm/tests/fixtures/ViewFixture.js +3 -1
- package/build/tests/fixtures/ViewFixture.js +3 -1
- package/package.json +3 -3
package/build/__tests__/behavioral/views/{ViewFixture.test.d.ts → viewFixture/ViewFixture.test.d.ts}
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AbstractSkillViewController, AbstractViewController, Card, SkillViewControllerLoadOptions, SpruceSchemas } from '@sprucelabs/heartwood-view-controllers';
|
2
|
-
import AbstractSpruceFixtureTest from '
|
2
|
+
import AbstractSpruceFixtureTest from '../../../../tests/AbstractSpruceFixtureTest';
|
3
3
|
export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
4
4
|
private static fixture;
|
5
5
|
private static fixtureNoOptions;
|
@@ -55,7 +55,7 @@ export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
|
55
55
|
protected static buildVcPluginExposedInFixture(): Promise<void>;
|
56
56
|
protected static addPluginExposedInFixure(): Promise<void>;
|
57
57
|
protected static getFactoryReturnsSpyFactory(): Promise<void>;
|
58
|
-
protected static
|
58
|
+
protected static spyFactoryResetForEachTestIfDeleted(): Promise<void>;
|
59
59
|
protected static getFactoryReturnsSpyFactoryForNextTest(): Promise<void>;
|
60
60
|
private static assertSpyFactoryUsed;
|
61
61
|
private static ViewFixture;
|
package/build/__tests__/behavioral/views/{ViewFixture.test.js → viewFixture/ViewFixture.test.js}
RENAMED
@@ -14,16 +14,16 @@ const schema_1 = require("@sprucelabs/schema");
|
|
14
14
|
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
15
15
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
16
16
|
const test_utils_2 = require("@sprucelabs/test-utils");
|
17
|
-
const __1 = require("
|
18
|
-
const AbstractSpruceFixtureTest_1 = __importDefault(require("
|
19
|
-
const constants_1 = require("
|
20
|
-
const fake_1 = __importDefault(require("
|
21
|
-
const Fake_svc_1 = __importDefault(require("
|
22
|
-
const SpyScope_1 = __importDefault(require("
|
23
|
-
const ViewFixture_1 = __importDefault(require("
|
24
|
-
const SpyViewControllerFactory_1 = __importDefault(require("
|
25
|
-
const EventFaker_1 = __importDefault(require("
|
26
|
-
const FakeThemeManager_1 = __importDefault(require("
|
17
|
+
const __1 = require("../../../..");
|
18
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../../tests/AbstractSpruceFixtureTest"));
|
19
|
+
const constants_1 = require("../../../../tests/constants");
|
20
|
+
const fake_1 = __importDefault(require("../../../../tests/decorators/fake"));
|
21
|
+
const Fake_svc_1 = __importDefault(require("../../../../tests/Fake.svc"));
|
22
|
+
const SpyScope_1 = __importDefault(require("../../../../tests/fixtures/SpyScope"));
|
23
|
+
const ViewFixture_1 = __importDefault(require("../../../../tests/fixtures/ViewFixture"));
|
24
|
+
const SpyViewControllerFactory_1 = __importDefault(require("../../../../tests/SpyViewControllerFactory"));
|
25
|
+
const EventFaker_1 = __importDefault(require("../../../support/EventFaker"));
|
26
|
+
const FakeThemeManager_1 = __importDefault(require("../../../support/FakeThemeManager"));
|
27
27
|
const DEMO_NUMBER_FORMATTED = (0, schema_1.formatPhoneNumber)(constants_1.DEMO_NUMBER !== null && constants_1.DEMO_NUMBER !== void 0 ? constants_1.DEMO_NUMBER : '');
|
28
28
|
let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest_1.default {
|
29
29
|
static async beforeEach() {
|
@@ -475,7 +475,7 @@ let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest_1.
|
|
475
475
|
static async getFactoryReturnsSpyFactory() {
|
476
476
|
this.assertSpyFactoryUsed();
|
477
477
|
}
|
478
|
-
static async
|
478
|
+
static async spyFactoryResetForEachTestIfDeleted() {
|
479
479
|
delete heartwood_view_controllers_1.ViewControllerFactory.Class;
|
480
480
|
}
|
481
481
|
static async getFactoryReturnsSpyFactoryForNextTest() {
|
@@ -691,7 +691,7 @@ __decorate([
|
|
691
691
|
], ViewFixtureTest, "getFactoryReturnsSpyFactory", null);
|
692
692
|
__decorate([
|
693
693
|
(0, test_utils_1.test)()
|
694
|
-
], ViewFixtureTest, "
|
694
|
+
], ViewFixtureTest, "spyFactoryResetForEachTestIfDeleted", null);
|
695
695
|
__decorate([
|
696
696
|
(0, test_utils_1.test)()
|
697
697
|
], ViewFixtureTest, "getFactoryReturnsSpyFactoryForNextTest", null);
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../../../tests/AbstractSpruceFixtureTest';
|
2
|
+
export default class ViewFixtureLetsYouOverrideViewControllerFactoryTest extends AbstractSpruceFixtureTest {
|
3
|
+
protected static beforeEach(): Promise<void>;
|
4
|
+
protected static canCreateViewFixtureLetsYouOverrideViewControllerFactory(): Promise<void>;
|
5
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
|
13
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
14
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../../../tests/AbstractSpruceFixtureTest"));
|
15
|
+
class ViewFixtureLetsYouOverrideViewControllerFactoryTest extends AbstractSpruceFixtureTest_1.default {
|
16
|
+
static async beforeEach() {
|
17
|
+
await super.beforeEach();
|
18
|
+
}
|
19
|
+
static async canCreateViewFixtureLetsYouOverrideViewControllerFactory() {
|
20
|
+
test_utils_1.assert.isEqual(heartwood_view_controllers_1.ViewControllerFactory.Class, MySpyViewControllerFactory);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
exports.default = ViewFixtureLetsYouOverrideViewControllerFactoryTest;
|
24
|
+
__decorate([
|
25
|
+
(0, test_utils_1.test)()
|
26
|
+
], ViewFixtureLetsYouOverrideViewControllerFactoryTest, "canCreateViewFixtureLetsYouOverrideViewControllerFactory", null);
|
27
|
+
class MySpyViewControllerFactory extends heartwood_view_controllers_1.ViewControllerFactory {
|
28
|
+
}
|
29
|
+
heartwood_view_controllers_1.ViewControllerFactory.Class = MySpyViewControllerFactory;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AbstractSkillViewController, AbstractViewController, Card, SkillViewControllerLoadOptions, SpruceSchemas } from '@sprucelabs/heartwood-view-controllers';
|
2
|
-
import AbstractSpruceFixtureTest from '
|
2
|
+
import AbstractSpruceFixtureTest from '../../../../tests/AbstractSpruceFixtureTest';
|
3
3
|
export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
4
4
|
private static fixture;
|
5
5
|
private static fixtureNoOptions;
|
@@ -55,7 +55,7 @@ export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
|
55
55
|
protected static buildVcPluginExposedInFixture(): Promise<void>;
|
56
56
|
protected static addPluginExposedInFixure(): Promise<void>;
|
57
57
|
protected static getFactoryReturnsSpyFactory(): Promise<void>;
|
58
|
-
protected static
|
58
|
+
protected static spyFactoryResetForEachTestIfDeleted(): Promise<void>;
|
59
59
|
protected static getFactoryReturnsSpyFactoryForNextTest(): Promise<void>;
|
60
60
|
private static assertSpyFactoryUsed;
|
61
61
|
private static ViewFixture;
|
package/build/esm/__tests__/behavioral/views/{ViewFixture.test.js → viewFixture/ViewFixture.test.js}
RENAMED
@@ -18,16 +18,16 @@ import { formatPhoneNumber } from '@sprucelabs/schema';
|
|
18
18
|
import { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
|
19
19
|
import { assert, test } from '@sprucelabs/test-utils';
|
20
20
|
import { errorAssert, generateId } from '@sprucelabs/test-utils';
|
21
|
-
import { ClientProxyDecorator, seed } from '
|
22
|
-
import AbstractSpruceFixtureTest from '
|
23
|
-
import { DEMO_NUMBER_VIEW_FIXTURE, DEMO_NUMBER, DEMO_NUMBER_VIEW_FIXTURE_2, DEMO_NUMBER_VIEW_FIXTURE_CLIENT_2, } from '
|
24
|
-
import fake from '
|
25
|
-
import FakeSkillViewController from '
|
26
|
-
import SpyScope from '
|
27
|
-
import ViewFixture from '
|
28
|
-
import SpyViewControllerFactory from '
|
29
|
-
import EventFaker from '
|
30
|
-
import FakeThemeManager from '
|
21
|
+
import { ClientProxyDecorator, seed } from '../../../../index.js';
|
22
|
+
import AbstractSpruceFixtureTest from '../../../../tests/AbstractSpruceFixtureTest.js';
|
23
|
+
import { DEMO_NUMBER_VIEW_FIXTURE, DEMO_NUMBER, DEMO_NUMBER_VIEW_FIXTURE_2, DEMO_NUMBER_VIEW_FIXTURE_CLIENT_2, } from '../../../../tests/constants.js';
|
24
|
+
import fake from '../../../../tests/decorators/fake.js';
|
25
|
+
import FakeSkillViewController from '../../../../tests/Fake.svc.js';
|
26
|
+
import SpyScope from '../../../../tests/fixtures/SpyScope.js';
|
27
|
+
import ViewFixture from '../../../../tests/fixtures/ViewFixture.js';
|
28
|
+
import SpyViewControllerFactory from '../../../../tests/SpyViewControllerFactory.js';
|
29
|
+
import EventFaker from '../../../support/EventFaker.js';
|
30
|
+
import FakeThemeManager from '../../../support/FakeThemeManager.js';
|
31
31
|
const DEMO_NUMBER_FORMATTED = formatPhoneNumber(DEMO_NUMBER !== null && DEMO_NUMBER !== void 0 ? DEMO_NUMBER : '');
|
32
32
|
let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
33
33
|
static beforeEach() {
|
@@ -560,7 +560,7 @@ let ViewFixtureTest = class ViewFixtureTest extends AbstractSpruceFixtureTest {
|
|
560
560
|
this.assertSpyFactoryUsed();
|
561
561
|
});
|
562
562
|
}
|
563
|
-
static
|
563
|
+
static spyFactoryResetForEachTestIfDeleted() {
|
564
564
|
return __awaiter(this, void 0, void 0, function* () {
|
565
565
|
delete ViewControllerFactory.Class;
|
566
566
|
});
|
@@ -784,7 +784,7 @@ __decorate([
|
|
784
784
|
], ViewFixtureTest, "getFactoryReturnsSpyFactory", null);
|
785
785
|
__decorate([
|
786
786
|
test()
|
787
|
-
], ViewFixtureTest, "
|
787
|
+
], ViewFixtureTest, "spyFactoryResetForEachTestIfDeleted", null);
|
788
788
|
__decorate([
|
789
789
|
test()
|
790
790
|
], ViewFixtureTest, "getFactoryReturnsSpyFactoryForNextTest", null);
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../../../tests/AbstractSpruceFixtureTest';
|
2
|
+
export default class ViewFixtureLetsYouOverrideViewControllerFactoryTest extends AbstractSpruceFixtureTest {
|
3
|
+
protected static beforeEach(): Promise<void>;
|
4
|
+
protected static canCreateViewFixtureLetsYouOverrideViewControllerFactory(): Promise<void>;
|
5
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
14
|
+
});
|
15
|
+
};
|
16
|
+
import { ViewControllerFactory } from '@sprucelabs/heartwood-view-controllers';
|
17
|
+
import { test, assert } from '@sprucelabs/test-utils';
|
18
|
+
import AbstractSpruceFixtureTest from '../../../../tests/AbstractSpruceFixtureTest.js';
|
19
|
+
export default class ViewFixtureLetsYouOverrideViewControllerFactoryTest extends AbstractSpruceFixtureTest {
|
20
|
+
static beforeEach() {
|
21
|
+
const _super = Object.create(null, {
|
22
|
+
beforeEach: { get: () => super.beforeEach }
|
23
|
+
});
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
25
|
+
yield _super.beforeEach.call(this);
|
26
|
+
});
|
27
|
+
}
|
28
|
+
static canCreateViewFixtureLetsYouOverrideViewControllerFactory() {
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
30
|
+
assert.isEqual(ViewControllerFactory.Class, MySpyViewControllerFactory);
|
31
|
+
});
|
32
|
+
}
|
33
|
+
}
|
34
|
+
__decorate([
|
35
|
+
test()
|
36
|
+
], ViewFixtureLetsYouOverrideViewControllerFactoryTest, "canCreateViewFixtureLetsYouOverrideViewControllerFactory", null);
|
37
|
+
class MySpyViewControllerFactory extends ViewControllerFactory {
|
38
|
+
}
|
39
|
+
ViewControllerFactory.Class = MySpyViewControllerFactory;
|
@@ -164,7 +164,9 @@ class ViewFixture {
|
|
164
164
|
}
|
165
165
|
static beforeEach() {
|
166
166
|
return __awaiter(this, void 0, void 0, function* () {
|
167
|
-
ViewControllerFactory.Class
|
167
|
+
if (!ViewControllerFactory.Class) {
|
168
|
+
ViewControllerFactory.Class = SpyViewControllerFactory;
|
169
|
+
}
|
168
170
|
SwipeViewControllerImpl.swipeDelay = 0;
|
169
171
|
if (this.shouldAutomaticallyResetAuthenticator) {
|
170
172
|
this.resetAuth();
|
@@ -157,7 +157,9 @@ class ViewFixture {
|
|
157
157
|
this.resetAuth();
|
158
158
|
}
|
159
159
|
static async beforeEach() {
|
160
|
-
heartwood_view_controllers_1.ViewControllerFactory.Class
|
160
|
+
if (!heartwood_view_controllers_1.ViewControllerFactory.Class) {
|
161
|
+
heartwood_view_controllers_1.ViewControllerFactory.Class = SpyViewControllerFactory_1.default;
|
162
|
+
}
|
161
163
|
heartwood_view_controllers_1.SwipeViewControllerImpl.swipeDelay = 0;
|
162
164
|
if (this.shouldAutomaticallyResetAuthenticator) {
|
163
165
|
this.resetAuth();
|
package/package.json
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
"@sprucelabs/spruce-test-fixtures"
|
14
14
|
]
|
15
15
|
},
|
16
|
-
"version": "62.2.
|
16
|
+
"version": "62.2.4",
|
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.160",
|
74
|
-
"@sprucelabs/spruce-skill-booter": "^62.2.
|
74
|
+
"@sprucelabs/spruce-skill-booter": "^62.2.4",
|
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": "b15bf4edcbe852ce1e7e2f66e0dd928b445c04bb"
|
118
118
|
}
|