@worksafevictoria/wcl7.5 1.17.0-beta.10 → 1.17.0-beta.11
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/package.json +1 -1
- package/src/components/SubComponents/FormInstance/models/base-form-element.js +4 -3
- package/src/components/SubComponents/FormInstance/services/form-render-parser.js +51 -16
- package/src/components/SubComponents/FormInstance/services/logic-parser.js +81 -9
- package/src/components/SubComponents/FormInstance/services/registry-factory.js +52 -50
- package/src/components/SubComponents/FormInstance/stories/mocks/checkboxesother.json +1 -10
- package/src/components/SubComponents/FormInstance/stories/mocks/emailconfirm.json +1 -10
- package/src/components/SubComponents/FormInstance/stories/mocks/jahd.json +1 -5
- package/src/components/SubComponents/FormInstance/stories/mocks/quad.json +1 -5
- package/src/components/SubComponents/FormInstance/stories/mocks/radiosother.json +1 -9
- package/src/components/SubComponents/FormInstance/stories/mocks/sameas.json +1 -5
- package/src/components/SubComponents/FormInstance/stories/mocks/selectother.json +1 -10
- package/src/components/SubComponents/FormInstance/stories/mocks/styles.json +1 -5
- package/src/components/SubComponents/FormInstance/stories/mocks/table-select.json +1 -15
- package/src/components/SubComponents/FormInstance/stories/mocks/token.json +1 -5
- package/src/components/SubComponents/FormInstance/stories/mocks/twig.json +1 -13
- package/src/components/SubComponents/FormInstance/stories/mocks/wizard.json +1 -13
- package/src/components/SubComponents/FormInstance/tests/form-test-utils.js +3 -0
- package/src/components/SubComponents/FormInstance/tests/form.test.js +2 -1
- package/src/components/SubComponents/FormInstance/tests/radiosother.test.js +12 -11
- package/src/components/SubComponents/FormInstance/tests/rule-disabled.test.js +13 -45
- package/src/components/SubComponents/FormInstance/tests/rule-enabled-value.test.js +8 -24
- package/src/components/SubComponents/FormInstance/tests/rule-hidden.test.js +13 -45
- package/src/components/SubComponents/FormInstance/tests/rule-required-value.test.js +15 -55
- package/src/components/SubComponents/FormInstance/tests/rule-visible.test.js +0 -413
- package/src/components/SubComponents/FormInstance/tests/sameas.test.js +9 -25
- package/src/components/SubComponents/FormInstance/tests/twig.test.js +7 -5
|
@@ -5,302 +5,6 @@ const testComponent = 'rule-visible'
|
|
|
5
5
|
describe(`Form ${testComponent} parser`, () => {
|
|
6
6
|
it(`should render a ${testComponent} component`, () => {
|
|
7
7
|
const components = FormTestUtils.getParsedComponentsFromJSON(json)
|
|
8
|
-
console.log(components)
|
|
9
|
-
console.log(
|
|
10
|
-
FormTestUtils.getComparisonJSON([
|
|
11
|
-
{
|
|
12
|
-
attributes: { counter: 1 },
|
|
13
|
-
clearOnHide: true,
|
|
14
|
-
customClass: 'custom-formio-1',
|
|
15
|
-
disabled: false,
|
|
16
|
-
hideLabel: false,
|
|
17
|
-
id: 'kitchen_sink_formio_v1--textbox1',
|
|
18
|
-
input: true,
|
|
19
|
-
key: 'textbox1',
|
|
20
|
-
label: 'textbox1',
|
|
21
|
-
labelPosition: 'top',
|
|
22
|
-
mask: false,
|
|
23
|
-
placeholder:
|
|
24
|
-
"type 'show' to show textfield2 and hide container with textbox",
|
|
25
|
-
type: 'textfield',
|
|
26
|
-
validate: { maxLength: 255, required: false },
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
attributes: { counter: 2 },
|
|
30
|
-
clearOnHide: true,
|
|
31
|
-
customClass: 'custom-formio-2',
|
|
32
|
-
disabled: false,
|
|
33
|
-
hidden: true,
|
|
34
|
-
hideLabel: false,
|
|
35
|
-
id: 'kitchen_sink_formio_v1--textbox2',
|
|
36
|
-
input: true,
|
|
37
|
-
key: 'textbox2',
|
|
38
|
-
label: 'textfield2',
|
|
39
|
-
labelPosition: 'top',
|
|
40
|
-
logic: [
|
|
41
|
-
{
|
|
42
|
-
actions: [
|
|
43
|
-
{
|
|
44
|
-
name: 0,
|
|
45
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
46
|
-
state: false,
|
|
47
|
-
type: 'property',
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
defaultProps: { hidden: true },
|
|
51
|
-
name: 0,
|
|
52
|
-
trigger: {
|
|
53
|
-
javascript: "result = (Boolean(data.textbox1 === 'show'))",
|
|
54
|
-
type: 'javascript',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
actions: [
|
|
59
|
-
{
|
|
60
|
-
name: 0,
|
|
61
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
62
|
-
state: false,
|
|
63
|
-
type: 'property',
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
defaultProps: { hidden: true },
|
|
67
|
-
name: 0,
|
|
68
|
-
trigger: {
|
|
69
|
-
javascript: "result = (Boolean(data.textbox1 === 'show'))",
|
|
70
|
-
type: 'javascript',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
mask: false,
|
|
75
|
-
type: 'textfield',
|
|
76
|
-
validate: { maxLength: 255, required: false },
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
attributes: { counter: 3 },
|
|
80
|
-
clearOnHide: true,
|
|
81
|
-
components: [
|
|
82
|
-
{
|
|
83
|
-
attributes: { counter: 7 },
|
|
84
|
-
clearOnHide: false,
|
|
85
|
-
customClass: 'custom-formio-7',
|
|
86
|
-
disabled: false,
|
|
87
|
-
hideLabel: false,
|
|
88
|
-
id: 'kitchen_sink_formio_v1--textboxContainer',
|
|
89
|
-
input: true,
|
|
90
|
-
key: 'textboxContainer',
|
|
91
|
-
label: 'Container textbox',
|
|
92
|
-
labelPosition: 'top',
|
|
93
|
-
mask: false,
|
|
94
|
-
placeholder: 'type anything to show textbox3',
|
|
95
|
-
type: 'textfield',
|
|
96
|
-
validate: { maxLength: 255, required: false },
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
customClass: 'custom-formio-3',
|
|
100
|
-
disabled: false,
|
|
101
|
-
hidden: true,
|
|
102
|
-
hideLabel: true,
|
|
103
|
-
id: 'kitchen_sink_formio_v1--c31',
|
|
104
|
-
input: false,
|
|
105
|
-
key: 'c31',
|
|
106
|
-
label: null,
|
|
107
|
-
labelPosition: 'top',
|
|
108
|
-
logic: [
|
|
109
|
-
{
|
|
110
|
-
actions: [
|
|
111
|
-
{
|
|
112
|
-
name: 0,
|
|
113
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
114
|
-
state: false,
|
|
115
|
-
type: 'property',
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
defaultProps: { hidden: true },
|
|
119
|
-
name: 0,
|
|
120
|
-
trigger: {
|
|
121
|
-
javascript: "result = (Boolean(data.textbox1 !== 'show'))",
|
|
122
|
-
type: 'javascript',
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
actions: [
|
|
127
|
-
{
|
|
128
|
-
name: 0,
|
|
129
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
130
|
-
state: false,
|
|
131
|
-
type: 'property',
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
defaultProps: { hidden: true },
|
|
135
|
-
name: 0,
|
|
136
|
-
trigger: {
|
|
137
|
-
javascript: "result = (Boolean(data.textbox1 !== 'show'))",
|
|
138
|
-
type: 'javascript',
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
mask: false,
|
|
143
|
-
type: 'container',
|
|
144
|
-
validate: {},
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
attributes: { counter: 4 },
|
|
148
|
-
clearOnHide: true,
|
|
149
|
-
customClass: 'custom-formio-4',
|
|
150
|
-
disabled: false,
|
|
151
|
-
hidden: true,
|
|
152
|
-
hideLabel: false,
|
|
153
|
-
id: 'kitchen_sink_formio_v1--textbox3',
|
|
154
|
-
input: true,
|
|
155
|
-
key: 'textbox3',
|
|
156
|
-
label: 'textfield3',
|
|
157
|
-
labelPosition: 'top',
|
|
158
|
-
logic: [
|
|
159
|
-
{
|
|
160
|
-
actions: [
|
|
161
|
-
{
|
|
162
|
-
name: 0,
|
|
163
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
164
|
-
state: false,
|
|
165
|
-
type: 'property',
|
|
166
|
-
},
|
|
167
|
-
],
|
|
168
|
-
defaultProps: { hidden: true },
|
|
169
|
-
name: 0,
|
|
170
|
-
trigger: {
|
|
171
|
-
javascript:
|
|
172
|
-
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
173
|
-
type: 'javascript',
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
actions: [
|
|
178
|
-
{
|
|
179
|
-
name: 0,
|
|
180
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
181
|
-
state: false,
|
|
182
|
-
type: 'property',
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
defaultProps: { hidden: true },
|
|
186
|
-
name: 0,
|
|
187
|
-
trigger: {
|
|
188
|
-
javascript:
|
|
189
|
-
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
190
|
-
type: 'javascript',
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
actions: [
|
|
195
|
-
{
|
|
196
|
-
name: 0,
|
|
197
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
198
|
-
state: false,
|
|
199
|
-
type: 'property',
|
|
200
|
-
},
|
|
201
|
-
],
|
|
202
|
-
defaultProps: { hidden: true },
|
|
203
|
-
name: 0,
|
|
204
|
-
trigger: {
|
|
205
|
-
javascript:
|
|
206
|
-
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
207
|
-
type: 'javascript',
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
actions: [
|
|
212
|
-
{
|
|
213
|
-
name: 0,
|
|
214
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
215
|
-
state: false,
|
|
216
|
-
type: 'property',
|
|
217
|
-
},
|
|
218
|
-
],
|
|
219
|
-
defaultProps: { hidden: true },
|
|
220
|
-
name: 0,
|
|
221
|
-
trigger: {
|
|
222
|
-
javascript:
|
|
223
|
-
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
224
|
-
type: 'javascript',
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
],
|
|
228
|
-
mask: false,
|
|
229
|
-
placeholder: "type a pattern ending with 'text4' to show textbox4",
|
|
230
|
-
type: 'textfield',
|
|
231
|
-
validate: { maxLength: 255, required: false },
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
attributes: { counter: 5 },
|
|
235
|
-
clearOnHide: true,
|
|
236
|
-
customClass: 'custom-formio-5',
|
|
237
|
-
disabled: false,
|
|
238
|
-
hidden: true,
|
|
239
|
-
hideLabel: false,
|
|
240
|
-
id: 'kitchen_sink_formio_v1--textbox4',
|
|
241
|
-
input: true,
|
|
242
|
-
key: 'textbox4',
|
|
243
|
-
label: 'textfield4',
|
|
244
|
-
labelPosition: 'top',
|
|
245
|
-
logic: [
|
|
246
|
-
{
|
|
247
|
-
actions: [
|
|
248
|
-
{
|
|
249
|
-
name: 0,
|
|
250
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
251
|
-
state: false,
|
|
252
|
-
type: 'property',
|
|
253
|
-
},
|
|
254
|
-
],
|
|
255
|
-
defaultProps: { hidden: true },
|
|
256
|
-
name: 0,
|
|
257
|
-
trigger: {
|
|
258
|
-
javascript:
|
|
259
|
-
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
260
|
-
type: 'javascript',
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
actions: [
|
|
265
|
-
{
|
|
266
|
-
name: 0,
|
|
267
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
268
|
-
state: false,
|
|
269
|
-
type: 'property',
|
|
270
|
-
},
|
|
271
|
-
],
|
|
272
|
-
defaultProps: { hidden: true },
|
|
273
|
-
name: 0,
|
|
274
|
-
trigger: {
|
|
275
|
-
javascript:
|
|
276
|
-
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
277
|
-
type: 'javascript',
|
|
278
|
-
},
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
actions: [
|
|
282
|
-
{
|
|
283
|
-
name: 0,
|
|
284
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
285
|
-
state: false,
|
|
286
|
-
type: 'property',
|
|
287
|
-
},
|
|
288
|
-
],
|
|
289
|
-
defaultProps: { hidden: true },
|
|
290
|
-
name: 0,
|
|
291
|
-
trigger: {
|
|
292
|
-
javascript:
|
|
293
|
-
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
294
|
-
type: 'javascript',
|
|
295
|
-
},
|
|
296
|
-
},
|
|
297
|
-
],
|
|
298
|
-
mask: false,
|
|
299
|
-
type: 'textfield',
|
|
300
|
-
validate: { maxLength: 255, required: false },
|
|
301
|
-
},
|
|
302
|
-
]),
|
|
303
|
-
)
|
|
304
8
|
expect(components).toEqual(
|
|
305
9
|
FormTestUtils.getComparisonJSON([
|
|
306
10
|
{
|
|
@@ -349,22 +53,6 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
349
53
|
type: 'javascript',
|
|
350
54
|
},
|
|
351
55
|
},
|
|
352
|
-
{
|
|
353
|
-
actions: [
|
|
354
|
-
{
|
|
355
|
-
name: 0,
|
|
356
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
357
|
-
state: false,
|
|
358
|
-
type: 'property',
|
|
359
|
-
},
|
|
360
|
-
],
|
|
361
|
-
defaultProps: { hidden: true },
|
|
362
|
-
name: 0,
|
|
363
|
-
trigger: {
|
|
364
|
-
javascript: "result = (Boolean(data.textbox1 === 'show'))",
|
|
365
|
-
type: 'javascript',
|
|
366
|
-
},
|
|
367
|
-
},
|
|
368
56
|
],
|
|
369
57
|
mask: false,
|
|
370
58
|
type: 'textfield',
|
|
@@ -417,22 +105,6 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
417
105
|
type: 'javascript',
|
|
418
106
|
},
|
|
419
107
|
},
|
|
420
|
-
{
|
|
421
|
-
actions: [
|
|
422
|
-
{
|
|
423
|
-
name: 0,
|
|
424
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
425
|
-
state: false,
|
|
426
|
-
type: 'property',
|
|
427
|
-
},
|
|
428
|
-
],
|
|
429
|
-
defaultProps: { hidden: true },
|
|
430
|
-
name: 0,
|
|
431
|
-
trigger: {
|
|
432
|
-
javascript: "result = (Boolean(data.textbox1 !== 'show'))",
|
|
433
|
-
type: 'javascript',
|
|
434
|
-
},
|
|
435
|
-
},
|
|
436
108
|
],
|
|
437
109
|
mask: false,
|
|
438
110
|
type: 'container',
|
|
@@ -468,57 +140,6 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
468
140
|
type: 'javascript',
|
|
469
141
|
},
|
|
470
142
|
},
|
|
471
|
-
{
|
|
472
|
-
actions: [
|
|
473
|
-
{
|
|
474
|
-
name: 0,
|
|
475
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
476
|
-
state: false,
|
|
477
|
-
type: 'property',
|
|
478
|
-
},
|
|
479
|
-
],
|
|
480
|
-
defaultProps: { hidden: true },
|
|
481
|
-
name: 0,
|
|
482
|
-
trigger: {
|
|
483
|
-
javascript:
|
|
484
|
-
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
485
|
-
type: 'javascript',
|
|
486
|
-
},
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
actions: [
|
|
490
|
-
{
|
|
491
|
-
name: 0,
|
|
492
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
493
|
-
state: false,
|
|
494
|
-
type: 'property',
|
|
495
|
-
},
|
|
496
|
-
],
|
|
497
|
-
defaultProps: { hidden: true },
|
|
498
|
-
name: 0,
|
|
499
|
-
trigger: {
|
|
500
|
-
javascript:
|
|
501
|
-
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
502
|
-
type: 'javascript',
|
|
503
|
-
},
|
|
504
|
-
},
|
|
505
|
-
{
|
|
506
|
-
actions: [
|
|
507
|
-
{
|
|
508
|
-
name: 0,
|
|
509
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
510
|
-
state: false,
|
|
511
|
-
type: 'property',
|
|
512
|
-
},
|
|
513
|
-
],
|
|
514
|
-
defaultProps: { hidden: true },
|
|
515
|
-
name: 0,
|
|
516
|
-
trigger: {
|
|
517
|
-
javascript:
|
|
518
|
-
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
519
|
-
type: 'javascript',
|
|
520
|
-
},
|
|
521
|
-
},
|
|
522
143
|
],
|
|
523
144
|
mask: false,
|
|
524
145
|
placeholder: "type a pattern ending with 'text4' to show textbox4",
|
|
@@ -555,40 +176,6 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
555
176
|
type: 'javascript',
|
|
556
177
|
},
|
|
557
178
|
},
|
|
558
|
-
{
|
|
559
|
-
actions: [
|
|
560
|
-
{
|
|
561
|
-
name: 0,
|
|
562
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
563
|
-
state: false,
|
|
564
|
-
type: 'property',
|
|
565
|
-
},
|
|
566
|
-
],
|
|
567
|
-
defaultProps: { hidden: true },
|
|
568
|
-
name: 0,
|
|
569
|
-
trigger: {
|
|
570
|
-
javascript:
|
|
571
|
-
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
572
|
-
type: 'javascript',
|
|
573
|
-
},
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
actions: [
|
|
577
|
-
{
|
|
578
|
-
name: 0,
|
|
579
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
580
|
-
state: false,
|
|
581
|
-
type: 'property',
|
|
582
|
-
},
|
|
583
|
-
],
|
|
584
|
-
defaultProps: { hidden: true },
|
|
585
|
-
name: 0,
|
|
586
|
-
trigger: {
|
|
587
|
-
javascript:
|
|
588
|
-
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
589
|
-
type: 'javascript',
|
|
590
|
-
},
|
|
591
|
-
},
|
|
592
179
|
],
|
|
593
180
|
mask: false,
|
|
594
181
|
type: 'textfield',
|
|
@@ -20,7 +20,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
20
20
|
labelPosition: 'top',
|
|
21
21
|
mask: false,
|
|
22
22
|
type: 'textfield',
|
|
23
|
-
validate: { maxLength: 255, required: true }
|
|
23
|
+
validate: { maxLength: 255, required: true },
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
attributes: { counter: 2 },
|
|
@@ -41,36 +41,20 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
41
41
|
name: 0,
|
|
42
42
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
43
43
|
state: false,
|
|
44
|
-
type: 'property'
|
|
45
|
-
}
|
|
44
|
+
type: 'property',
|
|
45
|
+
},
|
|
46
46
|
],
|
|
47
47
|
defaultProps: { hidden: true },
|
|
48
48
|
name: 0,
|
|
49
49
|
trigger: {
|
|
50
50
|
javascript: 'result = (Boolean((data.samea === false)))',
|
|
51
|
-
type: 'javascript'
|
|
52
|
-
}
|
|
51
|
+
type: 'javascript',
|
|
52
|
+
},
|
|
53
53
|
},
|
|
54
|
-
{
|
|
55
|
-
actions: [
|
|
56
|
-
{
|
|
57
|
-
name: 0,
|
|
58
|
-
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
59
|
-
state: false,
|
|
60
|
-
type: 'property'
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
defaultProps: { hidden: true },
|
|
64
|
-
name: 0,
|
|
65
|
-
trigger: {
|
|
66
|
-
javascript: 'result = (Boolean((data.samea === false)))',
|
|
67
|
-
type: 'javascript'
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
54
|
],
|
|
71
55
|
mask: false,
|
|
72
56
|
type: 'textfield',
|
|
73
|
-
validate: { maxLength: 255, required: false }
|
|
57
|
+
validate: { maxLength: 255, required: false },
|
|
74
58
|
},
|
|
75
59
|
{
|
|
76
60
|
attributes: { counter: 3 },
|
|
@@ -86,9 +70,9 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
86
70
|
labelPosition: 'bottom',
|
|
87
71
|
mask: false,
|
|
88
72
|
type: 'checkbox',
|
|
89
|
-
validate: { required: false }
|
|
90
|
-
}
|
|
91
|
-
])
|
|
73
|
+
validate: { required: false },
|
|
74
|
+
},
|
|
75
|
+
]),
|
|
92
76
|
)
|
|
93
77
|
})
|
|
94
78
|
})
|
|
@@ -5,6 +5,8 @@ const testComponent = 'twig'
|
|
|
5
5
|
describe(`Form ${testComponent} parser`, () => {
|
|
6
6
|
it(`should render a ${testComponent} component`, () => {
|
|
7
7
|
const components = FormTestUtils.getParsedComponentsFromJSON(json)
|
|
8
|
+
|
|
9
|
+
console.log('🚀 ~ components:', components)
|
|
8
10
|
expect(components).toEqual(
|
|
9
11
|
FormTestUtils.getComparisonJSON([
|
|
10
12
|
{
|
|
@@ -26,7 +28,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
26
28
|
requireDecimal: false,
|
|
27
29
|
truncateMultipleSpaces: true,
|
|
28
30
|
type: 'number',
|
|
29
|
-
validate: { required: false }
|
|
31
|
+
validate: { required: false },
|
|
30
32
|
},
|
|
31
33
|
{
|
|
32
34
|
attributes: { counter: 2 },
|
|
@@ -47,7 +49,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
47
49
|
requireDecimal: false,
|
|
48
50
|
truncateMultipleSpaces: true,
|
|
49
51
|
type: 'number',
|
|
50
|
-
validate: { required: false }
|
|
52
|
+
validate: { required: false },
|
|
51
53
|
},
|
|
52
54
|
{
|
|
53
55
|
attributes: { counter: 3 },
|
|
@@ -66,9 +68,9 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
66
68
|
refreshOnChange: true,
|
|
67
69
|
tag: 'div',
|
|
68
70
|
type: 'htmlelement',
|
|
69
|
-
validate: { required: false }
|
|
70
|
-
}
|
|
71
|
-
])
|
|
71
|
+
validate: { required: false },
|
|
72
|
+
},
|
|
73
|
+
]),
|
|
72
74
|
)
|
|
73
75
|
})
|
|
74
76
|
})
|