@sprucelabs/heartwood-view-controllers 126.0.1 → 126.1.0
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.
package/README.md
CHANGED
|
@@ -18,4 +18,4 @@ Spruce XP Documentation
|
|
|
18
18
|
<a href="https://developer.spruce.ai/#/"><img width="250" src="https://raw.githubusercontent.com/sprucelabsai/heartwood-view-controllers/master/docs/images/read-full-docs.png" /></a>
|
|
19
19
|
</p>
|
|
20
20
|
### Dependencies
|
|
21
|
-
[Arkit diagram here](docs/dependencies.md).
|
|
21
|
+
[Arkit diagram here](docs/dependencies.md).
|
|
@@ -11,6 +11,7 @@ declare const navigationAssert: {
|
|
|
11
11
|
};
|
|
12
12
|
}): void;
|
|
13
13
|
rendersButtons(vc: ViewController<Navigation>, ids: string[]): void;
|
|
14
|
+
doesNotRendersButton(vc: ViewController<Navigation>, id: string): void;
|
|
14
15
|
rendersButtonLabels(vc: ViewController<Navigation>): void;
|
|
15
16
|
skillViewRendersNavigation(vc: Pick<SkillViewController, "renderNavigation">, msg?: string): ViewController<import("@sprucelabs/mercury-types").SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Navigation>;
|
|
16
17
|
appRendersNavigation(vc: Pick<AppController, "renderNavigation">): ViewController<import("@sprucelabs/mercury-types").SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Navigation>;
|
|
@@ -19,6 +19,24 @@ const navigationAssert = {
|
|
|
19
19
|
assertOptions({ vc, buttons: ids }, ['vc', 'buttons']);
|
|
20
20
|
ids.forEach((id) => this.rendersButton(vc, id));
|
|
21
21
|
},
|
|
22
|
+
doesNotRendersButton(vc, id) {
|
|
23
|
+
var _a;
|
|
24
|
+
assertOptions({ vc, buttons: id }, ['vc', 'buttons']);
|
|
25
|
+
const model = renderUtil.render(vc);
|
|
26
|
+
const buttons = (_a = model.buttons) === null || _a === void 0 ? void 0 : _a.reduce((acc, b) => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
if (b.dropdown) {
|
|
29
|
+
return [
|
|
30
|
+
...acc,
|
|
31
|
+
b,
|
|
32
|
+
...((_b = (_a = b === null || b === void 0 ? void 0 : b.dropdown) === null || _a === void 0 ? void 0 : _a.items) !== null && _b !== void 0 ? _b : []),
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
return [...acc, b];
|
|
36
|
+
}, []);
|
|
37
|
+
const button = buttons === null || buttons === void 0 ? void 0 : buttons.find((b) => b.id === id);
|
|
38
|
+
assert.isFalsy(button, `I found a button with the id "${id}" in your navigation but I should not have!`);
|
|
39
|
+
},
|
|
22
40
|
rendersButtonLabels(vc) {
|
|
23
41
|
const model = renderUtil.render(vc);
|
|
24
42
|
assert.isTrue(model.shouldRenderButtonLabels, `Your navigation should render button labels but it is not! Try shouldRenderButtonLabels: true`);
|
|
@@ -11,6 +11,7 @@ declare const navigationAssert: {
|
|
|
11
11
|
};
|
|
12
12
|
}): void;
|
|
13
13
|
rendersButtons(vc: ViewController<Navigation>, ids: string[]): void;
|
|
14
|
+
doesNotRendersButton(vc: ViewController<Navigation>, id: string): void;
|
|
14
15
|
rendersButtonLabels(vc: ViewController<Navigation>): void;
|
|
15
16
|
skillViewRendersNavigation(vc: Pick<SkillViewController, "renderNavigation">, msg?: string): ViewController<import("@sprucelabs/mercury-types").SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Navigation>;
|
|
16
17
|
appRendersNavigation(vc: Pick<AppController, "renderNavigation">): ViewController<import("@sprucelabs/mercury-types").SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Navigation>;
|
|
@@ -24,6 +24,22 @@ const navigationAssert = {
|
|
|
24
24
|
(0, schema_1.assertOptions)({ vc, buttons: ids }, ['vc', 'buttons']);
|
|
25
25
|
ids.forEach((id) => this.rendersButton(vc, id));
|
|
26
26
|
},
|
|
27
|
+
doesNotRendersButton(vc, id) {
|
|
28
|
+
(0, schema_1.assertOptions)({ vc, buttons: id }, ['vc', 'buttons']);
|
|
29
|
+
const model = render_utility_1.default.render(vc);
|
|
30
|
+
const buttons = model.buttons?.reduce((acc, b) => {
|
|
31
|
+
if (b.dropdown) {
|
|
32
|
+
return [
|
|
33
|
+
...acc,
|
|
34
|
+
b,
|
|
35
|
+
...(b?.dropdown?.items ?? []),
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
return [...acc, b];
|
|
39
|
+
}, []);
|
|
40
|
+
const button = buttons?.find((b) => b.id === id);
|
|
41
|
+
test_utils_1.assert.isFalsy(button, `I found a button with the id "${id}" in your navigation but I should not have!`);
|
|
42
|
+
},
|
|
27
43
|
rendersButtonLabels(vc) {
|
|
28
44
|
const model = render_utility_1.default.render(vc);
|
|
29
45
|
test_utils_1.assert.isTrue(model.shouldRenderButtonLabels, `Your navigation should render button labels but it is not! Try shouldRenderButtonLabels: true`);
|
package/package.json
CHANGED