@sprucelabs/heartwood-view-controllers 117.1.16 → 117.2.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.
@@ -1,6 +1,7 @@
1
1
  import ActiveRecordCardViewController from '../viewControllers/activeRecord/ActiveRecordCard.vc';
2
2
  export default class MockActiveRecordCard extends ActiveRecordCardViewController {
3
3
  private rebuildSlidesCount;
4
+ private refreshCount;
4
5
  getSearchFormVc(): import("..").FormViewController<{
5
6
  id: string;
6
7
  fields: {
@@ -15,6 +16,9 @@ export default class MockActiveRecordCard extends ActiveRecordCardViewController
15
16
  assertRowSelected(id: string): void;
16
17
  getPagerVc(): import("..").PagerViewController;
17
18
  assertTotalPages(expected: number): void;
19
+ assertIsLoaded(): void;
20
+ assertRefreshCount(expected: number): void;
21
+ refresh(): Promise<void>;
18
22
  assertCurrentPage(expected: number): void;
19
23
  assertPagerNotConfigured(): void;
20
24
  assertRendersPager(): void;
@@ -1,3 +1,12 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import { assert } from '@sprucelabs/test-utils';
2
11
  import renderUtil from '../utilities/render.utility.js';
3
12
  import ActiveRecordCardViewController from '../viewControllers/activeRecord/ActiveRecordCard.vc.js';
@@ -9,6 +18,7 @@ export default class MockActiveRecordCard extends ActiveRecordCardViewController
9
18
  constructor() {
10
19
  super(...arguments);
11
20
  this.rebuildSlidesCount = 0;
21
+ this.refreshCount = 0;
12
22
  }
13
23
  getSearchFormVc() {
14
24
  return this.searchFormVc;
@@ -52,6 +62,21 @@ export default class MockActiveRecordCard extends ActiveRecordCardViewController
52
62
  }
53
63
  this.assertTotalSlides(expected);
54
64
  }
65
+ assertIsLoaded() {
66
+ assert.isTrue(this.getIsLoaded(), `Your active record card is not loaded! Try 'this.activeRecordVc.load()' in your view's 'load(...)' method.`);
67
+ }
68
+ assertRefreshCount(expected) {
69
+ assert.isEqual(this.refreshCount, expected, `Your active record card has been refreshed the expected times. Try 'this.activeRecordVc.refresh()'.`);
70
+ }
71
+ refresh() {
72
+ const _super = Object.create(null, {
73
+ refresh: { get: () => super.refresh }
74
+ });
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ this.refreshCount++;
77
+ yield _super.refresh.call(this);
78
+ });
79
+ }
55
80
  assertCurrentPage(expected) {
56
81
  assert.isTruthy(this.swipeVc, `You have not enabled paging in your ActiveRecordCard!`);
57
82
  pagerAssert.cardRendersPager(this.swipeVc);
@@ -274,6 +274,8 @@ declare const vcAssert: {
274
274
  */
275
275
  assertCheckboxTogglesRowEnabled(listVc: ViewController<List>, row: string | number): Promise<void>;
276
276
  assertCardFooterIsDisabled(vc: ViewController<Card>): void;
277
+ assertCardFooterIsNotBusy(vc: ViewController<Card>): void;
278
+ assertCardFooterIsBusy(vc: ViewController<Card>): void;
277
279
  assertCardFooterIsEnabled(vc: ViewController<Card>): void;
278
280
  /**
279
281
  * @deprecated vcAssert.assertRowIsStyle(...) -> listAssert.rowIsStyle(...)
@@ -1079,6 +1079,16 @@ const vcAssert = {
1079
1079
  const model = renderUtil.render(vc);
1080
1080
  assert.isFalse((_a = model.footer) === null || _a === void 0 ? void 0 : _a.isEnabled, `I expected your footer to be disabled, try setting '{ footer: { isEnabled: false } }' or 'cardVc.disableFooter()'`);
1081
1081
  },
1082
+ assertCardFooterIsNotBusy(vc) {
1083
+ var _a;
1084
+ const model = renderUtil.render(vc);
1085
+ assert.isFalsy((_a = model.footer) === null || _a === void 0 ? void 0 : _a.isBusy, `I expected your footer to not be busy, try setting '{ footer: { isBusy: false } }' or 'cardVc.setFooterIsBusy(false)'`);
1086
+ },
1087
+ assertCardFooterIsBusy(vc) {
1088
+ var _a;
1089
+ const model = renderUtil.render(vc);
1090
+ assert.isTrue((_a = model.footer) === null || _a === void 0 ? void 0 : _a.isBusy, `I expected your footer to be busy, try setting '{ footer: { isBusy: true } }' or 'cardVc.setFooterIsBusy(true)'`);
1091
+ },
1082
1092
  assertCardFooterIsEnabled(vc) {
1083
1093
  var _a;
1084
1094
  const model = renderUtil.render(vc);
@@ -115,6 +115,8 @@ declare const vcAssertUtil: {
115
115
  assertSkillViewScopedBy(vc: import("../..").SkillViewController, scopedBy: import("../..").ScopedBy | import("../..").ScopeFlag[]): void;
116
116
  assertCheckboxTogglesRowEnabled(listVc: import("../..").ViewController<import("../..").List>, row: string | number): Promise<void>;
117
117
  assertCardFooterIsDisabled(vc: import("../..").ViewController<import("../..").Card>): void;
118
+ assertCardFooterIsNotBusy(vc: import("../..").ViewController<import("../..").Card>): void;
119
+ assertCardFooterIsBusy(vc: import("../..").ViewController<import("../..").Card>): void;
118
120
  assertCardFooterIsEnabled(vc: import("../..").ViewController<import("../..").Card>): void;
119
121
  assertRowIsStyle(vc: import("../..").ViewController<import("../..").List>, row: string | number, style: import("../..").RowStyle): void;
120
122
  };
@@ -1,6 +1,7 @@
1
1
  import ActiveRecordCardViewController from '../viewControllers/activeRecord/ActiveRecordCard.vc';
2
2
  export default class MockActiveRecordCard extends ActiveRecordCardViewController {
3
3
  private rebuildSlidesCount;
4
+ private refreshCount;
4
5
  getSearchFormVc(): import("..").FormViewController<{
5
6
  id: string;
6
7
  fields: {
@@ -15,6 +16,9 @@ export default class MockActiveRecordCard extends ActiveRecordCardViewController
15
16
  assertRowSelected(id: string): void;
16
17
  getPagerVc(): import("..").PagerViewController;
17
18
  assertTotalPages(expected: number): void;
19
+ assertIsLoaded(): void;
20
+ assertRefreshCount(expected: number): void;
21
+ refresh(): Promise<void>;
18
22
  assertCurrentPage(expected: number): void;
19
23
  assertPagerNotConfigured(): void;
20
24
  assertRendersPager(): void;
@@ -47,6 +47,7 @@ class MockActiveRecordCard extends ActiveRecordCard_vc_1.default {
47
47
  constructor() {
48
48
  super(...arguments);
49
49
  this.rebuildSlidesCount = 0;
50
+ this.refreshCount = 0;
50
51
  }
51
52
  getSearchFormVc() {
52
53
  return this.searchFormVc;
@@ -90,6 +91,16 @@ class MockActiveRecordCard extends ActiveRecordCard_vc_1.default {
90
91
  }
91
92
  this.assertTotalSlides(expected);
92
93
  }
94
+ assertIsLoaded() {
95
+ test_utils_1.assert.isTrue(this.getIsLoaded(), `Your active record card is not loaded! Try 'this.activeRecordVc.load()' in your view's 'load(...)' method.`);
96
+ }
97
+ assertRefreshCount(expected) {
98
+ test_utils_1.assert.isEqual(this.refreshCount, expected, `Your active record card has been refreshed the expected times. Try 'this.activeRecordVc.refresh()'.`);
99
+ }
100
+ async refresh() {
101
+ this.refreshCount++;
102
+ await super.refresh();
103
+ }
93
104
  assertCurrentPage(expected) {
94
105
  test_utils_1.assert.isTruthy(this.swipeVc, `You have not enabled paging in your ActiveRecordCard!`);
95
106
  pagerAssert_1.default.cardRendersPager(this.swipeVc);
@@ -274,6 +274,8 @@ declare const vcAssert: {
274
274
  */
275
275
  assertCheckboxTogglesRowEnabled(listVc: ViewController<List>, row: string | number): Promise<void>;
276
276
  assertCardFooterIsDisabled(vc: ViewController<Card>): void;
277
+ assertCardFooterIsNotBusy(vc: ViewController<Card>): void;
278
+ assertCardFooterIsBusy(vc: ViewController<Card>): void;
277
279
  assertCardFooterIsEnabled(vc: ViewController<Card>): void;
278
280
  /**
279
281
  * @deprecated vcAssert.assertRowIsStyle(...) -> listAssert.rowIsStyle(...)
@@ -1028,6 +1028,14 @@ const vcAssert = {
1028
1028
  const model = render_utility_1.default.render(vc);
1029
1029
  test_utils_1.assert.isFalse(model.footer?.isEnabled, `I expected your footer to be disabled, try setting '{ footer: { isEnabled: false } }' or 'cardVc.disableFooter()'`);
1030
1030
  },
1031
+ assertCardFooterIsNotBusy(vc) {
1032
+ const model = render_utility_1.default.render(vc);
1033
+ test_utils_1.assert.isFalsy(model.footer?.isBusy, `I expected your footer to not be busy, try setting '{ footer: { isBusy: false } }' or 'cardVc.setFooterIsBusy(false)'`);
1034
+ },
1035
+ assertCardFooterIsBusy(vc) {
1036
+ const model = render_utility_1.default.render(vc);
1037
+ test_utils_1.assert.isTrue(model.footer?.isBusy, `I expected your footer to be busy, try setting '{ footer: { isBusy: true } }' or 'cardVc.setFooterIsBusy(true)'`);
1038
+ },
1031
1039
  assertCardFooterIsEnabled(vc) {
1032
1040
  const model = render_utility_1.default.render(vc);
1033
1041
  test_utils_1.assert.isTrue(model.footer?.isEnabled !== false, `I expected your footer to be enabled, try setting '{ footer: { isEnabled: true } }' or 'cardVc.enableFooter()'`);
@@ -115,6 +115,8 @@ declare const vcAssertUtil: {
115
115
  assertSkillViewScopedBy(vc: import("../..").SkillViewController, scopedBy: import("../..").ScopedBy | import("../..").ScopeFlag[]): void;
116
116
  assertCheckboxTogglesRowEnabled(listVc: import("../..").ViewController<import("../..").List>, row: string | number): Promise<void>;
117
117
  assertCardFooterIsDisabled(vc: import("../..").ViewController<import("../..").Card>): void;
118
+ assertCardFooterIsNotBusy(vc: import("../..").ViewController<import("../..").Card>): void;
119
+ assertCardFooterIsBusy(vc: import("../..").ViewController<import("../..").Card>): void;
118
120
  assertCardFooterIsEnabled(vc: import("../..").ViewController<import("../..").Card>): void;
119
121
  assertRowIsStyle(vc: import("../..").ViewController<import("../..").List>, row: string | number, style: import("../..").RowStyle): void;
120
122
  };
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "sideEffects": false,
14
14
  "license": "MIT",
15
15
  "description": "All the power of Heartwood in one, convenient package.",
16
- "version": "117.1.16",
16
+ "version": "117.2.0",
17
17
  "skill": {
18
18
  "namespace": "HeartwoodViewControllers",
19
19
  "commandOverrides": {