@sprucelabs/spruce-heartwood-utils 8.2.2 → 8.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,5 +17,4 @@ export interface AssertRendersRemoteCardsOptions<Svc extends SkillViewController
|
|
|
17
17
|
declare const remoteVcAssert: {
|
|
18
18
|
assertSkillViewRendersRemoteCards<Svc extends SkillViewController<Record<string, any>> = SkillViewController<Record<string, any>>>(options: AssertRendersRemoteCardsOptions<Svc>): Promise<void>;
|
|
19
19
|
};
|
|
20
|
-
export declare function generateId(): string;
|
|
21
20
|
export default remoteVcAssert;
|
|
@@ -11,7 +11,7 @@ import { AbstractViewController, vcAssert, } from '@sprucelabs/heartwood-view-co
|
|
|
11
11
|
import { assertOptions } from '@sprucelabs/schema';
|
|
12
12
|
import { eventFaker, } from '@sprucelabs/spruce-test-fixtures';
|
|
13
13
|
import { assert } from '@sprucelabs/test';
|
|
14
|
-
import
|
|
14
|
+
import { generateId } from '@sprucelabs/test-utils';
|
|
15
15
|
const remoteVcAssert = {
|
|
16
16
|
assertSkillViewRendersRemoteCards(options) {
|
|
17
17
|
var _a;
|
|
@@ -125,9 +125,6 @@ function generateVcSource(options) {
|
|
|
125
125
|
`TestEventViewController${count}.id = '${vcId}'`,
|
|
126
126
|
].join('\n\n');
|
|
127
127
|
}
|
|
128
|
-
export function generateId() {
|
|
129
|
-
return slug(`${Math.round(new Date().getTime() * (Math.random() * 100))}`);
|
|
130
|
-
}
|
|
131
128
|
class ThrowingErrorCardVc extends AbstractViewController {
|
|
132
129
|
constructor(options) {
|
|
133
130
|
super(options);
|
|
@@ -17,5 +17,4 @@ export interface AssertRendersRemoteCardsOptions<Svc extends SkillViewController
|
|
|
17
17
|
declare const remoteVcAssert: {
|
|
18
18
|
assertSkillViewRendersRemoteCards<Svc extends SkillViewController<Record<string, any>> = SkillViewController<Record<string, any>>>(options: AssertRendersRemoteCardsOptions<Svc>): Promise<void>;
|
|
19
19
|
};
|
|
20
|
-
export declare function generateId(): string;
|
|
21
20
|
export default remoteVcAssert;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateId = void 0;
|
|
7
3
|
const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
|
|
8
4
|
const schema_1 = require("@sprucelabs/schema");
|
|
9
5
|
const spruce_test_fixtures_1 = require("@sprucelabs/spruce-test-fixtures");
|
|
10
6
|
const test_1 = require("@sprucelabs/test");
|
|
11
|
-
const
|
|
7
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
12
8
|
const remoteVcAssert = {
|
|
13
9
|
async assertSkillViewRendersRemoteCards(options) {
|
|
14
10
|
var _a;
|
|
@@ -19,8 +15,8 @@ const remoteVcAssert = {
|
|
|
19
15
|
]);
|
|
20
16
|
const factory = views.getFactory();
|
|
21
17
|
factory.setController('heartwood.error-card', ThrowingErrorCardVc);
|
|
22
|
-
const vc1Id = generateId();
|
|
23
|
-
const vc2Id = generateId();
|
|
18
|
+
const vc1Id = (0, test_utils_1.generateId)();
|
|
19
|
+
const vc2Id = (0, test_utils_1.generateId)();
|
|
24
20
|
let wasHit = false;
|
|
25
21
|
let passedTarget;
|
|
26
22
|
let passedPayload;
|
|
@@ -49,7 +45,7 @@ const remoteVcAssert = {
|
|
|
49
45
|
`heartwood({ TestEventViewController1, TestEventViewController2 })`,
|
|
50
46
|
].join('\n');
|
|
51
47
|
return {
|
|
52
|
-
id: generateId(),
|
|
48
|
+
id: (0, test_utils_1.generateId)(),
|
|
53
49
|
ids: [vc1Id, vc2Id],
|
|
54
50
|
source,
|
|
55
51
|
};
|
|
@@ -120,10 +116,6 @@ function generateVcSource(options) {
|
|
|
120
116
|
`TestEventViewController${count}.id = '${vcId}'`,
|
|
121
117
|
].join('\n\n');
|
|
122
118
|
}
|
|
123
|
-
function generateId() {
|
|
124
|
-
return (0, slug_1.default)(`${Math.round(new Date().getTime() * (Math.random() * 100))}`);
|
|
125
|
-
}
|
|
126
|
-
exports.generateId = generateId;
|
|
127
119
|
class ThrowingErrorCardVc extends heartwood_view_controllers_1.AbstractViewController {
|
|
128
120
|
constructor(options) {
|
|
129
121
|
super(options);
|