@ohos-ports/focuson-lenstest 1.44.3-beta.1

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.
Files changed (88) hide show
  1. package/README.md +6 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +18 -0
  4. package/dist/src/DataDrivenFixedOptionDropDownAndDetails.spec.d.ts +1 -0
  5. package/dist/src/DataDrivenFixedOptionDropDownAndDetails.spec.js +70 -0
  6. package/dist/src/DatePicker.spec.d.ts +1 -0
  7. package/dist/src/DatePicker.spec.js +315 -0
  8. package/dist/src/DisplayStringWithLookup.spec.d.ts +1 -0
  9. package/dist/src/DisplayStringWithLookup.spec.js +42 -0
  10. package/dist/src/Label.spec.d.ts +1 -0
  11. package/dist/src/Label.spec.js +79 -0
  12. package/dist/src/Lens.spec.d.ts +1 -0
  13. package/dist/src/Lens.spec.js +164 -0
  14. package/dist/src/LensFixture.d.ts +28 -0
  15. package/dist/src/LensFixture.js +15 -0
  16. package/dist/src/LensState.spec.d.ts +1 -0
  17. package/dist/src/LensState.spec.js +100 -0
  18. package/dist/src/MonthYearDataPickerWithLength.spec.d.ts +1 -0
  19. package/dist/src/MonthYearDataPickerWithLength.spec.js +21 -0
  20. package/dist/src/WithTextLayout.spec.d.ts +1 -0
  21. package/dist/src/WithTextLayout.spec.js +29 -0
  22. package/dist/src/actions.spec.d.ts +1 -0
  23. package/dist/src/actions.spec.js +40 -0
  24. package/dist/src/composition.spec.d.ts +1 -0
  25. package/dist/src/composition.spec.js +28 -0
  26. package/dist/src/context.fixture.d.ts +6 -0
  27. package/dist/src/context.fixture.js +9 -0
  28. package/dist/src/dateutils.spec.d.ts +1 -0
  29. package/dist/src/dateutils.spec.js +166 -0
  30. package/dist/src/deleteState.spec.d.ts +1 -0
  31. package/dist/src/deleteState.spec.js +36 -0
  32. package/dist/src/dropdown.spec.d.ts +1 -0
  33. package/dist/src/dropdown.spec.js +46 -0
  34. package/dist/src/enzymeAdapterSetup.d.ts +1 -0
  35. package/dist/src/enzymeAdapterSetup.js +12 -0
  36. package/dist/src/fetcher.fixture.d.ts +38 -0
  37. package/dist/src/fetcher.fixture.js +20 -0
  38. package/dist/src/fetchers.spec.d.ts +1 -0
  39. package/dist/src/fetchers.spec.js +346 -0
  40. package/dist/src/focusedPage.spec.d.ts +1 -0
  41. package/dist/src/focusedPage.spec.js +70 -0
  42. package/dist/src/labelAnd.spec.d.ts +1 -0
  43. package/dist/src/labelAnd.spec.js +105 -0
  44. package/dist/src/labelAndDateInput.spec.d.ts +1 -0
  45. package/dist/src/labelAndDateInput.spec.js +26 -0
  46. package/dist/src/lenspath.spec.d.ts +1 -0
  47. package/dist/src/lenspath.spec.js +171 -0
  48. package/dist/src/memoisation.spec.d.ts +1 -0
  49. package/dist/src/memoisation.spec.js +11 -0
  50. package/dist/src/messages.spec.d.ts +1 -0
  51. package/dist/src/messages.spec.js +34 -0
  52. package/dist/src/modalButton.integration.spec.d.ts +23 -0
  53. package/dist/src/modalButton.integration.spec.js +299 -0
  54. package/dist/src/modalButton.spec.d.ts +1 -0
  55. package/dist/src/modalButton.spec.js +147 -0
  56. package/dist/src/newFetchers.spec.d.ts +1 -0
  57. package/dist/src/newFetchers.spec.js +214 -0
  58. package/dist/src/optics.spec.d.ts +2 -0
  59. package/dist/src/optics.spec.js +195 -0
  60. package/dist/src/page.fixture.d.ts +30 -0
  61. package/dist/src/page.fixture.js +55 -0
  62. package/dist/src/pageSelection.spec.d.ts +1 -0
  63. package/dist/src/pageSelection.spec.js +146 -0
  64. package/dist/src/post.spec.d.ts +1 -0
  65. package/dist/src/post.spec.js +84 -0
  66. package/dist/src/postButton.spec.d.ts +2 -0
  67. package/dist/src/postButton.spec.js +26 -0
  68. package/dist/src/preMutate.spec.d.ts +1 -0
  69. package/dist/src/preMutate.spec.js +63 -0
  70. package/dist/src/radioButton.spec.d.ts +1 -0
  71. package/dist/src/radioButton.spec.js +48 -0
  72. package/dist/src/restButton.spec.d.ts +13 -0
  73. package/dist/src/restButton.spec.js +95 -0
  74. package/dist/src/selectedItem.spec.d.ts +1 -0
  75. package/dist/src/selectedItem.spec.js +50 -0
  76. package/dist/src/stateAndFromApiTagFetcher.spec.d.ts +1 -0
  77. package/dist/src/stateAndFromApiTagFetcher.spec.js +59 -0
  78. package/dist/src/table.spec.d.ts +1 -0
  79. package/dist/src/table.spec.js +215 -0
  80. package/dist/src/tagFetcher.fixture.d.ts +7 -0
  81. package/dist/src/tagFetcher.fixture.js +16 -0
  82. package/dist/src/tagFetcher.spec.d.ts +1 -0
  83. package/dist/src/tagFetcher.spec.js +67 -0
  84. package/dist/src/template.spec.d.ts +1 -0
  85. package/dist/src/template.spec.js +58 -0
  86. package/dist/src/utils.spec.d.ts +1 -0
  87. package/dist/src/utils.spec.js +61 -0
  88. package/package.json +96 -0
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@focuson/utils");
4
+ const dateutils_1 = require("@focuson/utils/src/dateutils");
5
+ function quickParser(s) { return new Date(Date.parse(s)); }
6
+ describe("isSameDate", () => {
7
+ function check(s1, s2) {
8
+ return (0, utils_1.isSameDay)(quickParser(s1), quickParser(s2));
9
+ }
10
+ it("should return true if the same date", () => {
11
+ expect(check('2002-01-02', '2002-01-02')).toEqual(true);
12
+ });
13
+ it("should return false if not", () => {
14
+ expect(check('2002-01-02', '2003-01-02')).toEqual(false);
15
+ expect(check('2002-01-02', '2002-05-02')).toEqual(false);
16
+ expect(check('2002-01-02', '2002-01-06')).toEqual(false);
17
+ });
18
+ });
19
+ describe('after', () => {
20
+ it("should return true if the date is after the hh:mm text string when NOT Daylight saving time", () => {
21
+ const dateInfo = {
22
+ now: '2022-07-01T05:25:32.077Z',
23
+ dates: {
24
+ today: '01-07-2022',
25
+ serverNow: '2022-07-01T06:25:32.077Z',
26
+ serversHoursOffsetFromGMT: 0
27
+ }
28
+ };
29
+ //9:14 on the browser is 10:14 on the server which is before 10:15
30
+ expect((0, utils_1.after)('04 Nov 2022 09:14:00 GMT', '10:15', dateInfo)).toEqual(false);
31
+ //9:16 on the browser is 10:16 on the server which is after 10:15
32
+ expect((0, utils_1.after)('04 Nov 2022 09:16:00 GMT', '10:15', dateInfo)).toEqual(true);
33
+ //10:14 on the browser is 11:14 on the server which is after 10:15
34
+ expect((0, utils_1.after)('04 Nov 2022 10:14:00 GMT', '10:15', dateInfo)).toEqual(true);
35
+ });
36
+ it("should return true if the date is after the hh:mm text string when Daylight saving time", () => {
37
+ const dateInfo = {
38
+ now: '2022-07-01T05:25:32.077Z',
39
+ dates: {
40
+ today: '01-07-2022',
41
+ serverNow: '2022-07-01T06:25:32.077Z',
42
+ serversHoursOffsetFromGMT: 1
43
+ }
44
+ };
45
+ //8:14 on the browser is 9:14 on the server GMT with is 9:14 GMT which is 10:14 BST which is before 10:15
46
+ expect((0, utils_1.after)('04 Nov 2022 08:14:00 GMT', '10:15', dateInfo)).toEqual(false);
47
+ //8:14 on the browser is 9:14 on the server GMT with is 10:14 GMT which is 11:14 BST which is before 10:15
48
+ expect((0, utils_1.after)('04 Nov 2022 09:14:00 GMT', '10:15', dateInfo)).toEqual(true);
49
+ expect((0, utils_1.after)('04 Nov 2022 09:14:00 GMT', '10:15', dateInfo)).toEqual(true);
50
+ });
51
+ // it ( "should return false if the date is garbage", () => {
52
+ // fail ()
53
+ //
54
+ // } )
55
+ });
56
+ describe('millisecondsBetweenServerAndBrowser', () => {
57
+ function check(now, serverNow) {
58
+ return (0, utils_1.millisecondsBetweenServerAndBrowser)({ now, dates: { today: '01-07-2022', serverNow, serversHoursOffsetFromGMT: 0 } });
59
+ }
60
+ it('should be the number of milliseconds between the now and the dates/serverNow in the dateinfo', () => {
61
+ expect(check('2022-07-01T05:25:32.077Z', '2022-07-01T05:25:32.077Z')).toEqual(0);
62
+ expect(check('2022-07-01T05:25:32.077Z', '2022-07-01T06:25:32.077Z')).toEqual(-3600000);
63
+ expect(check('2022-07-02T05:25:32.077Z', '2022-07-01T05:25:32.077Z')).toEqual(24 * 3600000);
64
+ });
65
+ });
66
+ describe('timeOnServer', () => {
67
+ const dateInfo = { now: '2022-07-01T05:25:32.077Z', dates: { today: '01-07-2022', serverNow: '2022-07-01T06:25:32.077Z', serversHoursOffsetFromGMT: 0 } };
68
+ it('should turn the browser time into server time', () => {
69
+ expect((0, utils_1.timeOnServerinGMT)('2022-07-01T05:25:32.077Z', dateInfo)).toEqual('Fri, 01 Jul 2022 06:25:32 GMT');
70
+ expect((0, utils_1.timeOnServerinGMT)('2022-07-01T06:20:32.077Z', dateInfo)).toEqual('Fri, 01 Jul 2022 07:20:32 GMT');
71
+ });
72
+ });
73
+ describe('getHoursAndMinutes', () => {
74
+ it('should return the hours and minutes from a utcString', () => {
75
+ expect((0, utils_1.getHoursAndMinutes)('Fri, 01 Jul 2022 07:20:32 GMT')).toEqual([7, 20]);
76
+ });
77
+ });
78
+ describe("startEndDateAndLength", () => {
79
+ describe("calculateLength", () => {
80
+ it("should calculate the months between the dates with mm/yyyy", () => {
81
+ expect((0, dateutils_1.calculateLength)("10-2022", "10-2022", 0)).toEqual("0");
82
+ expect((0, dateutils_1.calculateLength)("10-2022", "10-2022", 1)).toEqual("1");
83
+ expect((0, dateutils_1.calculateLength)("09-2022", "10-2022", 0)).toEqual("1");
84
+ expect((0, dateutils_1.calculateLength)("09-2020", "10-2022", 0)).toEqual("25");
85
+ expect((0, dateutils_1.calculateLength)("09-2020", "10-2022", 10)).toEqual("35");
86
+ expect((0, dateutils_1.calculateLength)("10-2022", "09-2020", 0)).toEqual("-25");
87
+ });
88
+ it("should calculate the months between the dates with mm-yyyy", () => {
89
+ expect((0, dateutils_1.calculateLength)("09/2022", "10/2022", 0)).toEqual("1");
90
+ expect((0, dateutils_1.calculateLength)("09/2020", "10/2022", 0)).toEqual("25");
91
+ expect((0, dateutils_1.calculateLength)("10/2022", "09/2020", 0)).toEqual("-25");
92
+ });
93
+ });
94
+ describe("setStartDate", () => {
95
+ it("should set the date when everything is undefined", () => {
96
+ expect((0, utils_1.setStartDate)({}, "08-2022")).toEqual({ startDate: '08-2022' });
97
+ });
98
+ it("should set the date when date is already defined", () => {
99
+ expect((0, utils_1.setStartDate)({ startDate: '07-2022' }, "08-2022")).toEqual({ startDate: '08-2022' });
100
+ });
101
+ it("should set the date when length is zero, and end date is not defined", () => {
102
+ expect((0, utils_1.setStartDate)({ startDate: '07-2022', length: "0" }, "08-2022")).toEqual({ startDate: '08-2022', length: "0", endDate: '7/2022' });
103
+ });
104
+ it("should set the date when length is one, and end date is not defined", () => {
105
+ expect((0, utils_1.setStartDate)({ startDate: '07-2022', length: "1" }, "08-2022")).toEqual({ startDate: '08-2022', length: "1", endDate: '8/2022' });
106
+ });
107
+ it("should set the date when length is two, and end date is not defined", () => {
108
+ expect((0, utils_1.setStartDate)({ startDate: '07-2022', length: "2" }, "08-2022")).toEqual({ startDate: '08-2022', length: "2", endDate: '9/2022' });
109
+ });
110
+ it("should set the date when length is undefined, and end date is defined", () => {
111
+ expect((0, utils_1.setStartDate)({ startDate: '07-2022', endDate: '09-2022' }, "08-2022")).toEqual({ startDate: '08-2022', length: "0", endDate: '09-2022' });
112
+ expect((0, utils_1.setStartDate)({ startDate: '07-2022', endDate: '09-2022' }, "06-2022")).toEqual({ startDate: '06-2022', length: "2", endDate: '09-2022' });
113
+ });
114
+ it("should set the date when length is defined, and end date is defined", () => {
115
+ expect((0, utils_1.setStartDate)({ startDate: '07-2022', length: "2", endDate: '08-2022' }, "08-2022")).toEqual({ startDate: '08-2022', length: "2", endDate: '9/2022' });
116
+ });
117
+ });
118
+ describe("setEndDate", () => {
119
+ it("should set the date when everything is undefined", () => {
120
+ expect((0, dateutils_1.setEndDate)({}, "09-2022")).toEqual({ endDate: '09-2022' });
121
+ });
122
+ it("should set the date when date is already defined", () => {
123
+ expect((0, dateutils_1.setEndDate)({ endDate: '07-2022' }, "09-2022")).toEqual({ endDate: '09-2022' });
124
+ });
125
+ it("should set the date when length is zero, and start date is not defined", () => {
126
+ expect((0, dateutils_1.setEndDate)({ endDate: '07-2022', length: "0" }, "09-2022")).toEqual({ startDate: '10/2022', length: "0", endDate: '09-2022' });
127
+ });
128
+ it("should set the date when length is one, and start date is not defined", () => {
129
+ expect((0, dateutils_1.setEndDate)({ endDate: '07-2022', length: "1" }, "09-2022")).toEqual({ startDate: '9/2022', length: "1", endDate: '09-2022' });
130
+ });
131
+ it("should set the date when length is two, and start date is not defined", () => {
132
+ expect((0, dateutils_1.setEndDate)({ endDate: '07-2022', length: "2" }, "09-2022")).toEqual({ startDate: '8/2022', length: "2", endDate: '09-2022' });
133
+ });
134
+ it("should set the date when length is undefined, and start date is defined", () => {
135
+ expect((0, dateutils_1.setEndDate)({ startDate: '08-2022', endDate: '07-2022' }, "09-2022")).toEqual({ startDate: '08-2022', length: "2", endDate: '09-2022' });
136
+ });
137
+ it("should set the date when length is defined, and start date is defined", () => {
138
+ expect((0, dateutils_1.setEndDate)({ startDate: '07-2022', length: "2", endDate: '08-2022' }, "10-2022")).toEqual({ startDate: '07-2022', length: "4", endDate: '10-2022' });
139
+ });
140
+ });
141
+ describe("setLength", () => {
142
+ it("should set the length when everything is undefined", () => {
143
+ expect((0, utils_1.setLength)({}, "2")).toEqual({ length: "2" });
144
+ });
145
+ it("should set the length when length is already defined", () => {
146
+ expect((0, utils_1.setLength)({ length: "12" }, "2")).toEqual({ length: "2" });
147
+ });
148
+ it("should set the length when length is one, and end date is not defined", () => {
149
+ expect((0, utils_1.setLength)({ startDate: '08-2022' }, "1")).toEqual({ startDate: '08-2022', length: "1", endDate: '8/2022' });
150
+ });
151
+ it("should set the length when length is two, and start date is not defined", () => {
152
+ expect((0, utils_1.setLength)({ startDate: '08-2022' }, "2")).toEqual({ startDate: '08-2022', length: "2", endDate: '9/2022' });
153
+ });
154
+ it("should set the length when the start date is undefined and the end date is defined", () => {
155
+ expect((0, utils_1.setLength)({ endDate: '09-2022' }, "2")).toEqual({ startDate: '8/2022', length: "2", endDate: '09-2022' });
156
+ });
157
+ it("should set the length when the start date is defined and the end date is defined", () => {
158
+ expect((0, utils_1.setLength)({ startDate: '08-2022', length: "2", endDate: '11-2022' }, "1")).toEqual({ startDate: '08-2022', length: "1", endDate: '8/2022' });
159
+ expect((0, utils_1.setLength)({ startDate: '08-2022', length: "2", endDate: '11-2022' }, "2")).toEqual({ startDate: '08-2022', length: "2", endDate: '9/2022' });
160
+ });
161
+ it("delete the endDate when the length is undefined or zero", () => {
162
+ expect((0, utils_1.setLength)({ startDate: '08-2022', length: "2", endDate: '11-2022' }, undefined)).toEqual({ startDate: '08-2022' });
163
+ expect((0, utils_1.setLength)({ startDate: '08-2022', length: "2", endDate: '11-2022' }, "0")).toEqual({ startDate: '08-2022' });
164
+ });
165
+ });
166
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const state_1 = require("@focuson/state");
5
+ const enzyme_1 = require("enzyme");
6
+ const form_components_1 = require("@focuson/form_components");
7
+ const enzymeAdapterSetup_1 = require("./enzymeAdapterSetup");
8
+ (0, enzymeAdapterSetup_1.enzymeSetup)();
9
+ function displayAndGetButton(s, setMain, fn) {
10
+ const comp = (0, enzyme_1.shallow)(fn((0, state_1.lensState)(s, setMain, 'DeleteState', {})));
11
+ return comp.find("button");
12
+ }
13
+ describe("delete state button", () => {
14
+ it("should render", () => {
15
+ const comp = displayAndGetButton({}, s => { }, s => (0, jsx_runtime_1.jsx)(form_components_1.DeleteStateButton, { id: 'someId', label: 'someLabel', states: [s.focusOn("a"), s.focusOn("b")] }));
16
+ expect(comp.html()).toEqual("<button id=\"someId\" aria-errormessage=\"someId.error\" aria-invalid=\"false\" class=\"button\">someLabel</button>");
17
+ });
18
+ it("shouldnot do anything when 0 deletes and clicked", () => {
19
+ let remembered = undefined;
20
+ const comp = displayAndGetButton({ a: 1, b: 2, c: 3 }, s => remembered = s, s => (0, jsx_runtime_1.jsx)(form_components_1.DeleteStateButton, { id: 'someId', label: 'someLabel', states: [] }));
21
+ comp.simulate('click');
22
+ expect(remembered).toEqual(undefined);
23
+ });
24
+ it("should delete the state when clicked - 1 deletes", () => {
25
+ let remembered = {};
26
+ const comp = displayAndGetButton({ a: 1, b: 2, c: 3 }, s => remembered = s, s => (0, jsx_runtime_1.jsx)(form_components_1.DeleteStateButton, { id: 'someId', label: 'someLabel', states: [s.focusOn("a")] }));
27
+ comp.simulate('click');
28
+ expect(remembered).toEqual({ b: 2, c: 3 });
29
+ });
30
+ it("should delete the state when clicked - 2 deletes", () => {
31
+ let remembered = {};
32
+ const comp = displayAndGetButton({ a: 1, b: 2, c: 3 }, s => remembered = s, s => (0, jsx_runtime_1.jsx)(form_components_1.DeleteStateButton, { id: 'someId', label: 'someLabel', states: [s.focusOn("a"), s.focusOn("b")] }));
33
+ comp.simulate('click');
34
+ expect(remembered).toEqual({ c: 3 });
35
+ });
36
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const enzymeAdapterSetup_1 = require("./enzymeAdapterSetup");
5
+ const enzyme_1 = require("enzyme");
6
+ const form_components_1 = require("@focuson/form_components");
7
+ const state_1 = require("@focuson/state");
8
+ const context_fixture_1 = require("./context.fixture");
9
+ (0, enzymeAdapterSetup_1.enzymeSetup)();
10
+ function dropDown(label, s, setMain) {
11
+ return (0, enzyme_1.mount)((0, jsx_runtime_1.jsx)(form_components_1.LabelAndDropdown, { label: label, enums: { a: 'A', b: 'B' }, state: (0, state_1.lensState)(s, setMain, 'desc', (0, context_fixture_1.context)()).focusOn('data'), id: 'someId', allButtons: {} }));
12
+ }
13
+ const emptyS = {
14
+ tags: {},
15
+ restCommands: [],
16
+ messages: [],
17
+ pageSelection: []
18
+ };
19
+ describe("Label and dropdown", () => {
20
+ it("should display when the data is undefined", () => {
21
+ expect(dropDown('someLabel', emptyS, () => { }).html()).toEqual('<div class="dropdown-container ">' +
22
+ '<label for="someId" class="input-label">someLabel</label>' +
23
+ '<div class="">' +
24
+ '<select class="select invalid" data-validationmessage="someLabel" id="someId"><option value="a">A</option><option value="b">B</option></select></div></div>');
25
+ });
26
+ it("should display when the data is null", () => {
27
+ expect(dropDown('someLabel', Object.assign(Object.assign({}, emptyS), { data: null }), () => { }).html()).toEqual('<div class="dropdown-container "><label for="someId" class="input-label">someLabel</label><div class=""><select class="select invalid" data-validationmessage="someLabel" id="someId"><option value="a">A</option><option value="b">B</option></select></div></div>');
28
+ });
29
+ it("should display when the data is set", () => {
30
+ expect(dropDown('someLabel', Object.assign(Object.assign({}, emptyS), { data: 'a' }), () => { }).html()).toEqual('<div class="dropdown-container "><label for="someId" class="input-label">someLabel</label><div class=""><select class="select " data-validationmessage="someLabel" id="someId"><option value="a">A</option><option value="b">B</option></select></div></div>');
31
+ });
32
+ it("should display when the data is set to something that isn't in the enum", () => {
33
+ expect(dropDown('someLabel', Object.assign(Object.assign({}, emptyS), { data: 'someData' }), () => { }).html()).toEqual('<div class="dropdown-container "><label for="someId" class="input-label">someLabel</label><div class=""><select class="select invalid" data-validationmessage="someLabel" id="someId"><option value="a">A</option><option value="b">B</option></select></div></div>');
34
+ });
35
+ it("select items", () => {
36
+ var remembered = {};
37
+ const dd = dropDown('someLabel', Object.assign(Object.assign({}, emptyS), { data: 'someData' }), s => remembered = s);
38
+ dd.find('select').at(0).simulate('change', { target: { value: 'a', name: 'A' } });
39
+ expect(remembered).toEqual(Object.assign(Object.assign({}, emptyS), { "data": "a" }));
40
+ dd.find('select').at(0).simulate('change', { target: { value: 'b', name: 'B' } });
41
+ expect(remembered).toEqual(Object.assign(Object.assign({}, emptyS), { "data": "b" }));
42
+ });
43
+ it("have a label that displays data using {} ", () => {
44
+ expect(dropDown('label : {/data}', Object.assign(Object.assign({}, emptyS), { data: 'someData' }), () => { }).html()).toEqual('<div class="dropdown-container "><label for="someId" class="input-label">label : someData</label><div class=""><select class="select invalid" data-validationmessage="label : {/data}" id="someId"><option value="a">A</option><option value="b">B</option></select></div></div>');
45
+ });
46
+ });
@@ -0,0 +1 @@
1
+ export declare function enzymeSetup(): void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.enzymeSetup = enzymeSetup;
7
+ //Copyright (c)2020-2022 Philip Rice. <br />Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the Software), to dealin the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: <br />The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED AS
8
+ const enzyme_1 = require("enzyme");
9
+ const enzyme_adapter_react_16_1 = __importDefault(require("enzyme-adapter-react-16"));
10
+ function enzymeSetup() {
11
+ (0, enzyme_1.configure)({ adapter: new enzyme_adapter_react_16_1.default() });
12
+ }
@@ -0,0 +1,38 @@
1
+ export interface SiteMap {
2
+ [entity: string]: Entity;
3
+ }
4
+ export interface Entity {
5
+ things: {
6
+ [thingname: string]: Thing;
7
+ };
8
+ api: {
9
+ [apiname: string]: Api;
10
+ };
11
+ }
12
+ export interface Api {
13
+ name: string;
14
+ description: string;
15
+ }
16
+ export interface Thing {
17
+ name: string;
18
+ description: string;
19
+ }
20
+ export interface ApiData {
21
+ api?: Api;
22
+ source?: string[];
23
+ status?: string;
24
+ desc?: string;
25
+ }
26
+ export interface State {
27
+ sitemap?: SiteMap;
28
+ entity?: Entity;
29
+ apiData?: ApiData;
30
+ thing?: Thing;
31
+ selectionState?: {
32
+ tag: string;
33
+ selectedEntity: string;
34
+ selectedThing: string;
35
+ selectedApi: string;
36
+ apiView: 'desc' | 'src' | 'status';
37
+ };
38
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function entity(e) {
4
+ return ({
5
+ things: {
6
+ t1: { name: `${e}1`, description: `${e}d1` },
7
+ t2: { name: `${e}2`, description: `${e}d2` }
8
+ },
9
+ api: {
10
+ a1: { name: `${e}1`, description: `${e}d1` },
11
+ a2: { name: `${e}2`, description: `${e}d2` }
12
+ }
13
+ });
14
+ }
15
+ function siteMapLoader(bookmark) {
16
+ return Promise.resolve({
17
+ "be": entity("be"),
18
+ "uk": entity("uk")
19
+ });
20
+ }
@@ -0,0 +1 @@
1
+ export {};