lightview 1.8.1-b → 2.0.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/.agent/workflows/daisyui-component-migration.md +155 -0
- package/.codacy/cli.sh +149 -0
- package/.codacy/codacy.yaml +15 -0
- package/.github/instructions/codacy.instructions.md +72 -0
- package/.wranglerignore +21 -0
- package/README.md +1331 -21
- package/_headers +4 -0
- package/build.js +70 -0
- package/components/actions/button.js +151 -0
- package/components/actions/dropdown.js +120 -0
- package/components/actions/modal.js +146 -0
- package/components/actions/swap.js +118 -0
- package/components/daisyui.js +288 -0
- package/components/data-display/accordion.js +128 -0
- package/components/data-display/alert.js +112 -0
- package/components/data-display/avatar.js +170 -0
- package/components/data-display/badge.js +82 -0
- package/components/data-display/card.js +151 -0
- package/components/data-display/carousel.js +94 -0
- package/components/data-display/chart.js +220 -0
- package/components/data-display/chat.js +128 -0
- package/components/data-display/collapse.js +103 -0
- package/components/data-display/countdown.js +69 -0
- package/components/data-display/diff.js +111 -0
- package/components/data-display/kbd.js +65 -0
- package/components/data-display/loading.js +75 -0
- package/components/data-display/progress.js +79 -0
- package/components/data-display/radial-progress.js +88 -0
- package/components/data-display/skeleton.js +66 -0
- package/components/data-display/stats.js +159 -0
- package/components/data-display/table.js +146 -0
- package/components/data-display/timeline.js +146 -0
- package/components/data-display/toast.js +72 -0
- package/components/data-display/tooltip.js +74 -0
- package/components/data-input/checkbox.js +253 -0
- package/components/data-input/file-input.js +224 -0
- package/components/data-input/input.js +264 -0
- package/components/data-input/radio.js +338 -0
- package/components/data-input/range.js +204 -0
- package/components/data-input/rating.js +219 -0
- package/components/data-input/select.js +287 -0
- package/components/data-input/textarea.js +287 -0
- package/components/data-input/toggle.js +201 -0
- package/components/index.js +137 -0
- package/components/layout/divider.js +72 -0
- package/components/layout/drawer.js +142 -0
- package/components/layout/footer.js +100 -0
- package/components/layout/hero.js +109 -0
- package/components/layout/indicator.js +90 -0
- package/components/layout/join.js +78 -0
- package/components/layout/navbar.js +110 -0
- package/components/navigation/breadcrumbs.js +91 -0
- package/components/navigation/dock.js +103 -0
- package/components/navigation/menu.js +126 -0
- package/components/navigation/pagination.js +105 -0
- package/components/navigation/steps.js +89 -0
- package/components/navigation/tabs.css +177 -0
- package/components/navigation/tabs.js +123 -0
- package/components/theme/theme-switch.css +65 -0
- package/components/theme/theme-switch.js +177 -0
- package/docs/about.html +164 -0
- package/docs/api/computed.html +184 -0
- package/docs/api/effects.html +173 -0
- package/docs/api/elements.html +180 -0
- package/docs/api/enhance.html +225 -0
- package/docs/api/hypermedia.html +165 -0
- package/docs/api/index.html +178 -0
- package/docs/api/nav.html +18 -0
- package/docs/api/signals.html +136 -0
- package/docs/api/state.html +217 -0
- package/docs/assets/images/logo-favicon.svg +42 -0
- package/docs/assets/images/logo-static.svg +40 -0
- package/docs/assets/images/logo.svg +66 -0
- package/docs/assets/js/examplify.js +395 -0
- package/docs/assets/styles/site.css +1102 -0
- package/docs/assets/styles/themes.css +236 -0
- package/docs/components/accordion.html +439 -0
- package/docs/components/alert.html +528 -0
- package/docs/components/avatar.html +586 -0
- package/docs/components/badge.html +531 -0
- package/docs/components/breadcrumbs.html +278 -0
- package/docs/components/button.html +579 -0
- package/docs/components/card.html +561 -0
- package/docs/components/carousel.html +286 -0
- package/docs/components/chart-area.html +702 -0
- package/docs/components/chart-bar.html +782 -0
- package/docs/components/chart-column.html +735 -0
- package/docs/components/chart-line.html +794 -0
- package/docs/components/chart-pie.html +823 -0
- package/docs/components/chart.html +612 -0
- package/docs/components/chat.html +547 -0
- package/docs/components/checkbox.html +641 -0
- package/docs/components/collapse.html +536 -0
- package/docs/components/component-nav.html +53 -0
- package/docs/components/countdown.html +470 -0
- package/docs/components/diff.html +245 -0
- package/docs/components/divider.html +240 -0
- package/docs/components/dock.html +277 -0
- package/docs/components/drawer.html +515 -0
- package/docs/components/dropdown.html +479 -0
- package/docs/components/file-input.html +591 -0
- package/docs/components/footer.html +301 -0
- package/docs/components/gallery.html +504 -0
- package/docs/components/hero.html +264 -0
- package/docs/components/index.css +840 -0
- package/docs/components/index.html +735 -0
- package/docs/components/indicator.html +342 -0
- package/docs/components/input.html +644 -0
- package/docs/components/join.html +285 -0
- package/docs/components/kbd.html +322 -0
- package/docs/components/loading.html +521 -0
- package/docs/components/menu.html +461 -0
- package/docs/components/modal.html +639 -0
- package/docs/components/navbar.html +321 -0
- package/docs/components/pagination.html +279 -0
- package/docs/components/progress.html +514 -0
- package/docs/components/radial-progress.html +434 -0
- package/docs/components/radio.html +655 -0
- package/docs/components/range.html +611 -0
- package/docs/components/rating.html +642 -0
- package/docs/components/select.html +696 -0
- package/docs/components/sidebar-setup.js +93 -0
- package/docs/components/skeleton.html +447 -0
- package/docs/components/spinner.html +68 -0
- package/docs/components/stats.html +486 -0
- package/docs/components/steps.html +356 -0
- package/docs/components/swap.html +517 -0
- package/docs/components/switch.html +68 -0
- package/docs/components/table.html +668 -0
- package/docs/components/tabs.html +506 -0
- package/docs/components/text-input.html +68 -0
- package/docs/components/textarea.html +603 -0
- package/docs/components/timeline.html +487 -0
- package/docs/components/toast.html +474 -0
- package/docs/components/toggle.html +564 -0
- package/docs/components/tooltip.html +423 -0
- package/docs/examples/getting-started-example.html +40 -0
- package/docs/examples/index.html +93 -0
- package/docs/getting-started/index.html +739 -0
- package/docs/getting-started/reviews.html +23 -0
- package/docs/getting-started/reviews.odom +108 -0
- package/docs/getting-started/reviews.vdom +84 -0
- package/docs/index.html +134 -0
- package/docs/playground.html +416 -0
- package/docs/router.html +285 -0
- package/docs/styles/index.html +190 -0
- package/functions/_middleware.js +32 -0
- package/index.html +309 -0
- package/lightview-router.js +364 -0
- package/lightview-x.js +1577 -0
- package/lightview.js +658 -1109
- package/lightview.js.backup +793 -0
- package/middleware/locale.js +25 -0
- package/middleware/markdown.js +44 -0
- package/middleware/notFound.js +37 -0
- package/package.json +27 -41
- package/watch.js +92 -0
- package/wrangler.toml +12 -0
- package/.idea/lightview.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/LICENSE +0 -21
- package/codepen-no-tabs-embed.css +0 -2
- package/components/chart/chart.html +0 -17
- package/components/chart/example.html +0 -32
- package/components/chart.html +0 -83
- package/components/components.js +0 -113
- package/components/gantt/example.html +0 -22
- package/components/gantt/gantt.html +0 -42
- package/components/gauge/example.html +0 -28
- package/components/gauge/gauge.html +0 -20
- package/components/gauge.html +0 -60
- package/components/orgchart/example.html +0 -25
- package/components/orgchart/orgchart.html +0 -41
- package/components/repl/code-editor.html +0 -64
- package/components/repl/editor.html +0 -37
- package/components/repl/editorjs-inline-tool/index.js +0 -3
- package/components/repl/editorjs-inline-tool/inline-tools.js +0 -28
- package/components/repl/editorjs-inline-tool/tool.js +0 -175
- package/components/repl/repl-with-wysiwyg.html +0 -355
- package/components/repl/repl.html +0 -345
- package/components/repl/sup.js +0 -44
- package/components/repl/wysiwyg-repl.html +0 -258
- package/components/timeline/example.html +0 -33
- package/components/timeline/timeline.html +0 -44
- package/components/timeline.html +0 -81
- package/examples/anchor.html +0 -11
- package/examples/chart.html +0 -34
- package/examples/counter.html +0 -26
- package/examples/counter.test.mjs +0 -47
- package/examples/counter2.html +0 -26
- package/examples/directives.html +0 -79
- package/examples/foreign.html +0 -50
- package/examples/forgeinform.html +0 -98
- package/examples/form.html +0 -61
- package/examples/gauge.html +0 -18
- package/examples/invalid-template-literals.html +0 -44
- package/examples/medium/remote.html +0 -60
- package/examples/message.html +0 -18
- package/examples/nested.html +0 -11
- package/examples/object-bound-form.html +0 -34
- package/examples/remote-server.js +0 -51
- package/examples/remote.html +0 -34
- package/examples/remote.json +0 -1
- package/examples/scratch.html +0 -69
- package/examples/sensors/index.html +0 -30
- package/examples/sensors/sensor-server.js +0 -30
- package/examples/shared.html +0 -41
- package/examples/template.html +0 -33
- package/examples/timeline.html +0 -21
- package/examples/todo.html +0 -38
- package/examples/top.html +0 -10
- package/examples/types.html +0 -94
- package/examples/xor.html +0 -62
- package/jest-puppeteer.config.js +0 -5
- package/jest.config.json +0 -12
- package/sites/client.html +0 -48
- package/sites/index.html +0 -247
- package/test/basic.html +0 -93
- package/test/basic.test.mjs +0 -315
- package/test/extended.html +0 -29
- package/test/extended.test.mjs +0 -448
- package/types.js +0 -534
- package/unsplash.key +0 -1
package/test/extended.test.mjs
DELETED
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
import 'expect-puppeteer';
|
|
2
|
-
function reviver(property,value) {
|
|
3
|
-
if(value==="@-Infinity") return -Infinity;
|
|
4
|
-
if(value==="@Infinity") return Infinity;
|
|
5
|
-
if(value==="@NaN") return NaN;
|
|
6
|
-
return value;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
describe('Lightview - Variables', () => {
|
|
10
|
-
beforeAll(async () => {
|
|
11
|
-
await page.goto('http://localhost:8080/test/extended.html');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
test('should be titled "Extended"', async () => {
|
|
15
|
-
await expect(page.title()).resolves.toMatch('Extended');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test('strictarray - should be array', async () => {
|
|
19
|
-
const result = await page.evaluate(() => {
|
|
20
|
-
return document.body.getVariableValue("strictarray")
|
|
21
|
-
});
|
|
22
|
-
expect(Array.isArray(result)).toBe(true);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test('strictarray - should set', async () => {
|
|
26
|
-
const result = await page.evaluate(() => {
|
|
27
|
-
try {
|
|
28
|
-
document.body.setVariableValue("strictarray",[]);
|
|
29
|
-
} catch(e) {
|
|
30
|
-
return e;
|
|
31
|
-
}
|
|
32
|
-
return document.body.getVariableValue("strictarray")
|
|
33
|
-
});
|
|
34
|
-
expect(Array.isArray(result)).toBe(true);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
test('strictarray - should allow null', async () => {
|
|
38
|
-
const result = await page.evaluate(() => {
|
|
39
|
-
try {
|
|
40
|
-
document.body.setVariableValue("strictarray",undefined);
|
|
41
|
-
document.body.setVariableValue("strictarray",null);
|
|
42
|
-
} catch(e) {
|
|
43
|
-
return e;
|
|
44
|
-
}
|
|
45
|
-
return document.body.getVariableValue("strictarray")
|
|
46
|
-
});
|
|
47
|
-
expect(result).toBe(null);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
test('strictarray - should throw', async () => {
|
|
51
|
-
const result = await page.evaluate(() => {
|
|
52
|
-
try {
|
|
53
|
-
document.body.setVariableValue("strictarray","false");
|
|
54
|
-
} catch(e) {
|
|
55
|
-
return e.message;
|
|
56
|
-
}
|
|
57
|
-
return document.body.getVariableValue("strictarray");
|
|
58
|
-
});
|
|
59
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
60
|
-
expect(name).toBe("strictarray");
|
|
61
|
-
expect(validityState.typeMismatch).toBe(true);
|
|
62
|
-
expect(validityState.value).toBe("false");
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test('strictboolean - should be boolean', async () => {
|
|
66
|
-
const result = await page.evaluate(() => {
|
|
67
|
-
return document.body.getVariableValue("strictboolean")
|
|
68
|
-
});
|
|
69
|
-
expect(result).toBe(true);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
test('strictboolean - should set', async () => {
|
|
73
|
-
const result = await page.evaluate(() => {
|
|
74
|
-
try {
|
|
75
|
-
document.body.setVariableValue("strictboolean",false);
|
|
76
|
-
} catch(e) {
|
|
77
|
-
return e.message;
|
|
78
|
-
}
|
|
79
|
-
return document.body.getVariableValue("strictboolean")
|
|
80
|
-
});
|
|
81
|
-
expect(result).toBe(false);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
test('strictboolean - should allow null', async () => {
|
|
85
|
-
const result = await page.evaluate(() => {
|
|
86
|
-
try {
|
|
87
|
-
document.body.setVariableValue("strictboolean",undefined);
|
|
88
|
-
document.body.setVariableValue("strictboolean",null);
|
|
89
|
-
} catch(e) {
|
|
90
|
-
return e.message;
|
|
91
|
-
}
|
|
92
|
-
return document.body.getVariableValue("strictboolean")
|
|
93
|
-
});
|
|
94
|
-
expect(result).toBe(null);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
test('strictboolean - should throw', async () => {
|
|
98
|
-
const result = await page.evaluate(() => {
|
|
99
|
-
try {
|
|
100
|
-
document.body.setVariableValue("strictboolean","true");
|
|
101
|
-
} catch(e) {
|
|
102
|
-
return e.message;
|
|
103
|
-
}
|
|
104
|
-
return document.body.getVariableValue("strictboolean");
|
|
105
|
-
});
|
|
106
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
107
|
-
expect(name).toBe("strictboolean");
|
|
108
|
-
expect(validityState.typeMismatch).toBe(true);
|
|
109
|
-
expect(validityState.value).toBe("true");
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
test('strictnumber - should be number', async () => {
|
|
113
|
-
const result = await page.evaluate(() => {
|
|
114
|
-
return document.body.getVariableValue("strictnumber")
|
|
115
|
-
});
|
|
116
|
-
expect(result).toBe(0);
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
test('strictnumber - should set', async () => {
|
|
120
|
-
const result = await page.evaluate(() => {
|
|
121
|
-
try {
|
|
122
|
-
document.body.setVariableValue("strictnumber",1);
|
|
123
|
-
} catch(e) {
|
|
124
|
-
return e.message;
|
|
125
|
-
}
|
|
126
|
-
return document.body.getVariableValue("strictnumber")
|
|
127
|
-
});
|
|
128
|
-
expect(result).toBe(1);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
test('strictnumber - should allow null', async () => {
|
|
132
|
-
const result = await page.evaluate(() => {
|
|
133
|
-
try {
|
|
134
|
-
document.body.setVariableValue("strictnumber",undefined);
|
|
135
|
-
document.body.setVariableValue("strictnumber",null);
|
|
136
|
-
} catch(e) {
|
|
137
|
-
return e.message;
|
|
138
|
-
}
|
|
139
|
-
return document.body.getVariableValue("strictnumber")
|
|
140
|
-
});
|
|
141
|
-
expect(result).toBe(null);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
test('strictnumber - should throw', async () => {
|
|
145
|
-
const result = await page.evaluate(() => {
|
|
146
|
-
try {
|
|
147
|
-
document.body.setVariableValue("strictnumber","0");
|
|
148
|
-
} catch(e) {
|
|
149
|
-
return e.message;
|
|
150
|
-
}
|
|
151
|
-
return document.body.getVariableValue("strictnumber");
|
|
152
|
-
});
|
|
153
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
154
|
-
expect(name).toBe("strictnumber");
|
|
155
|
-
expect(validityState.typeMismatch).toBe(true);
|
|
156
|
-
expect(validityState.value).toBe("0");
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
test('strictobject - should be object', async () => {
|
|
160
|
-
const result = await page.evaluate(() => {
|
|
161
|
-
return document.body.getVariableValue("strictobject")
|
|
162
|
-
});
|
|
163
|
-
expect(typeof(result)).toBe("object");
|
|
164
|
-
expect(Object.keys(result).length).toBe(0);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
test('strictobject - should set', async () => {
|
|
168
|
-
const result = await page.evaluate(() => {
|
|
169
|
-
try {
|
|
170
|
-
document.body.setVariableValue("strictobject", {test:"test"});
|
|
171
|
-
} catch(e) {
|
|
172
|
-
return e.message;
|
|
173
|
-
}
|
|
174
|
-
return document.body.getVariableValue("strictobject")
|
|
175
|
-
});
|
|
176
|
-
expect(typeof(result)).toBe("object");
|
|
177
|
-
expect(Object.keys(result).length).toBe(1);
|
|
178
|
-
expect(result.test).toBe("test");
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
test('strictobject - should allow null', async () => {
|
|
182
|
-
const result = await page.evaluate(() => {
|
|
183
|
-
try {
|
|
184
|
-
document.body.setVariableValue("strictobject",undefined);
|
|
185
|
-
document.body.setVariableValue("strictobject",null);
|
|
186
|
-
} catch(e) {
|
|
187
|
-
return e.message;
|
|
188
|
-
}
|
|
189
|
-
return document.body.getVariableValue("strictobject")
|
|
190
|
-
});
|
|
191
|
-
expect(result).toBe(null);
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
test('strictobject - should throw', async () => {
|
|
195
|
-
const result = await page.evaluate(() => {
|
|
196
|
-
try {
|
|
197
|
-
document.body.setVariableValue("strictobject","false");
|
|
198
|
-
} catch(e) {
|
|
199
|
-
return e.message;
|
|
200
|
-
}
|
|
201
|
-
return document.body.getVariableValue("strictobject");
|
|
202
|
-
});
|
|
203
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
204
|
-
expect(name).toBe("strictobject");
|
|
205
|
-
expect(validityState.typeMismatch).toBe(true);
|
|
206
|
-
expect(validityState.value).toBe("false");
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
test('strictstring - should be string', async () => {
|
|
210
|
-
const result = await page.evaluate(() => {
|
|
211
|
-
return document.body.getVariableValue("strictstring")
|
|
212
|
-
});
|
|
213
|
-
expect(result).toBe("test");
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
test('strictstring - should set', async () => {
|
|
217
|
-
const result = await page.evaluate(() => {
|
|
218
|
-
try {
|
|
219
|
-
document.body.setVariableValue("strictstring","anothertest");
|
|
220
|
-
} catch(e) {
|
|
221
|
-
return e.message;
|
|
222
|
-
}
|
|
223
|
-
return document.body.getVariableValue("strictstring")
|
|
224
|
-
});
|
|
225
|
-
expect(result).toBe("anothertest");
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
test('strictstring - should allow null', async () => {
|
|
229
|
-
const result = await page.evaluate(() => {
|
|
230
|
-
try {
|
|
231
|
-
document.body.setVariableValue("strictstring",undefined);
|
|
232
|
-
document.body.setVariableValue("strictstring",null);
|
|
233
|
-
} catch(e) {
|
|
234
|
-
return e.message;
|
|
235
|
-
}
|
|
236
|
-
return document.body.getVariableValue("strictstring")
|
|
237
|
-
});
|
|
238
|
-
expect(result).toBe(null);
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
test('strictstring - should throw', async () => {
|
|
242
|
-
const result = await page.evaluate(() => {
|
|
243
|
-
try {
|
|
244
|
-
document.body.setVariableValue("strictstring",0);
|
|
245
|
-
} catch(e) {
|
|
246
|
-
return e.message;
|
|
247
|
-
}
|
|
248
|
-
return document.body.getVariableValue("strictstring");
|
|
249
|
-
});
|
|
250
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
251
|
-
expect(name).toBe("strictstring");
|
|
252
|
-
expect(validityState.typeMismatch).toBe(true);
|
|
253
|
-
expect(validityState.value).toBe(0);
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
test('extendedarray - should respect minlength', async () => {
|
|
257
|
-
const result = await page.evaluate(() => {
|
|
258
|
-
try {
|
|
259
|
-
document.body.setVariableValue("extendedarray",[]);
|
|
260
|
-
} catch(e) {
|
|
261
|
-
return e.message;
|
|
262
|
-
}
|
|
263
|
-
return document.body.getVariableValue("extendedarray")
|
|
264
|
-
});
|
|
265
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
266
|
-
expect(name).toBe("extendedarray");
|
|
267
|
-
expect(validityState.tooShort).toBe(true);
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
test('extendedarray - should respect maxlength', async () => {
|
|
271
|
-
const result = await page.evaluate(() => {
|
|
272
|
-
try {
|
|
273
|
-
document.body.setVariableValue("extendedarray",[1,2,3,4,5]);
|
|
274
|
-
} catch(e) {
|
|
275
|
-
return e.message;
|
|
276
|
-
}
|
|
277
|
-
return document.body.getVariableValue("extendedarray")
|
|
278
|
-
});
|
|
279
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
280
|
-
expect(name).toBe("extendedarray");
|
|
281
|
-
expect(validityState.tooLong).toBe(true);
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
test('extendedarray - should throw and not allow null', async () => {
|
|
285
|
-
const result = await page.evaluate(() => {
|
|
286
|
-
try {
|
|
287
|
-
document.body.setVariableValue("extendedarray",null);
|
|
288
|
-
} catch(e) {
|
|
289
|
-
return e.message;
|
|
290
|
-
}
|
|
291
|
-
return document.body.getVariableValue("extendedarray")
|
|
292
|
-
});
|
|
293
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
294
|
-
expect(name).toBe("extendedarray");
|
|
295
|
-
expect(validityState.valueMissing).toBe(true);
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
test('extendednumber - should throw and not allow null', async () => {
|
|
299
|
-
const result = await page.evaluate(() => {
|
|
300
|
-
try {
|
|
301
|
-
document.body.setVariableValue("extendednumber",null);
|
|
302
|
-
} catch(e) {
|
|
303
|
-
return e.message;
|
|
304
|
-
}
|
|
305
|
-
return document.body.getVariableValue("extendednumber")
|
|
306
|
-
});
|
|
307
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
308
|
-
expect(name).toBe("extendednumber");
|
|
309
|
-
expect(validityState.valueMissing).toBe(true);
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
test('extendednumber - should throw and not allow NaN', async () => {
|
|
313
|
-
const result = await page.evaluate(() => {
|
|
314
|
-
try {
|
|
315
|
-
document.body.setVariableValue("extendednumber",NaN);
|
|
316
|
-
} catch(e) {
|
|
317
|
-
return e.message;
|
|
318
|
-
}
|
|
319
|
-
return document.body.getVariableValue("extendednumber")
|
|
320
|
-
});
|
|
321
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
322
|
-
expect(name).toBe("extendednumber");
|
|
323
|
-
expect(validityState.badInput).toBe(true);
|
|
324
|
-
//expect(validityState.value).toBe(null);
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
test('extendednumber - should respect min', async () => {
|
|
328
|
-
const result = await page.evaluate(() => {
|
|
329
|
-
try {
|
|
330
|
-
document.body.setVariableValue("extendednumber",0);
|
|
331
|
-
} catch(e) {
|
|
332
|
-
return e.message;
|
|
333
|
-
}
|
|
334
|
-
return document.body.getVariableValue("extendednumber")
|
|
335
|
-
});
|
|
336
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
337
|
-
expect(name).toBe("extendednumber");
|
|
338
|
-
expect(validityState.rangeUnderflow).toBe(true);
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
test('extendednumber - should allow between and allow step', async () => {
|
|
342
|
-
const result = await page.evaluate(() => {
|
|
343
|
-
try {
|
|
344
|
-
document.body.setVariableValue("extendednumber",4);
|
|
345
|
-
} catch(e) {
|
|
346
|
-
return e.message;
|
|
347
|
-
}
|
|
348
|
-
return document.body.getVariableValue("extendednumber")
|
|
349
|
-
});
|
|
350
|
-
expect(result).toBe(4);
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
test('extendednumber - should respect max', async () => {
|
|
354
|
-
const result = await page.evaluate(() => {
|
|
355
|
-
try {
|
|
356
|
-
document.body.setVariableValue("extendednumber",5);
|
|
357
|
-
} catch(e) {
|
|
358
|
-
return e.message;
|
|
359
|
-
}
|
|
360
|
-
return document.body.getVariableValue("extendednumber")
|
|
361
|
-
});
|
|
362
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
363
|
-
expect(name).toBe("extendednumber");
|
|
364
|
-
expect(validityState.rangeOverflow).toBe(true);
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
test('extendednumber - should respect step', async () => {
|
|
368
|
-
const result = await page.evaluate(() => {
|
|
369
|
-
try {
|
|
370
|
-
document.body.setVariableValue("extendednumber",3);
|
|
371
|
-
} catch(e) {
|
|
372
|
-
return e.message;
|
|
373
|
-
}
|
|
374
|
-
return document.body.getVariableValue("extendednumber")
|
|
375
|
-
});
|
|
376
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
377
|
-
expect(name).toBe("extendednumber");
|
|
378
|
-
expect(validityState.rangeUnderflow).toBe(true);
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
test('allowNaNnumber - should allow NaN', async () => {
|
|
382
|
-
const result = await page.evaluate(() => {
|
|
383
|
-
try {
|
|
384
|
-
document.body.setVariableValue("allowNaNnumber",NaN);
|
|
385
|
-
} catch(e) {
|
|
386
|
-
return e.message;
|
|
387
|
-
}
|
|
388
|
-
return document.body.getVariableValue("allowNaNnumber")
|
|
389
|
-
});
|
|
390
|
-
expect(typeof(result)==="number" && isNaN(result)).toBe(true);
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
test('noNaNnumber - should not allow NaN', async () => {
|
|
394
|
-
const result = await page.evaluate(() => {
|
|
395
|
-
try {
|
|
396
|
-
document.body.setVariableValue("noNaNnumber",NaN);
|
|
397
|
-
} catch(e) {
|
|
398
|
-
return e.message;
|
|
399
|
-
}
|
|
400
|
-
return document.body.getVariableValue("noNaNnumber")
|
|
401
|
-
});
|
|
402
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
403
|
-
expect(name).toBe("noNaNnumber");
|
|
404
|
-
expect(validityState.badInput).toBe(true);
|
|
405
|
-
});
|
|
406
|
-
|
|
407
|
-
test('extendedstring - should respect minlength', async () => {
|
|
408
|
-
const result = await page.evaluate(() => {
|
|
409
|
-
try {
|
|
410
|
-
document.body.setVariableValue("extendedstring","a");
|
|
411
|
-
} catch(e) {
|
|
412
|
-
return e.message;
|
|
413
|
-
}
|
|
414
|
-
return document.body.getVariableValue("extendedstring")
|
|
415
|
-
});
|
|
416
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
417
|
-
expect(name).toBe("extendedstring");
|
|
418
|
-
expect(validityState.tooShort).toBe(true);
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
test('extendedstring - should respect maxlength', async () => {
|
|
422
|
-
const result = await page.evaluate(() => {
|
|
423
|
-
try {
|
|
424
|
-
document.body.setVariableValue("extendedstring","abcdefg");
|
|
425
|
-
} catch(e) {
|
|
426
|
-
return e.message;
|
|
427
|
-
}
|
|
428
|
-
return document.body.getVariableValue("extendedstring")
|
|
429
|
-
});
|
|
430
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
431
|
-
expect(name).toBe("extendedstring");
|
|
432
|
-
expect(validityState.tooLong).toBe(true);
|
|
433
|
-
});
|
|
434
|
-
|
|
435
|
-
test('extendedstring - should throw and not allow null', async () => {
|
|
436
|
-
const result = await page.evaluate(() => {
|
|
437
|
-
try {
|
|
438
|
-
document.body.setVariableValue("extendedstring",null);
|
|
439
|
-
} catch(e) {
|
|
440
|
-
return e.message;
|
|
441
|
-
}
|
|
442
|
-
return document.body.getVariableValue("extendedstring")
|
|
443
|
-
});
|
|
444
|
-
const {name,validityState} = JSON.parse(result,reviver);
|
|
445
|
-
expect(name).toBe("extendedstring");
|
|
446
|
-
expect(validityState.valueMissing).toBe(true);
|
|
447
|
-
});
|
|
448
|
-
})
|