@ukhomeoffice/cop-react-form-renderer 5.10.0 → 5.11.0-bravo
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/dist/components/CollectionPage/CollectionPage.test.js +1 -1
- package/dist/components/FormComponent/Collection.test.js +12 -11
- package/dist/components/FormComponent/Container.test.js +3 -3
- package/dist/components/FormComponent/FormComponent.test.js +3 -3
- package/dist/components/FormPage/FormPage.test.js +1 -1
- package/dist/utils/Component/getComponentTests/getComponent.calculation.test.js +2 -2
- package/dist/utils/Component/getComponentTests/getComponent.nested.test.js +6 -6
- package/package.json +2 -2
|
@@ -150,7 +150,7 @@ describe('components.CollectionPage', function () {
|
|
|
150
150
|
expect(input.tagName).toEqual('INPUT');
|
|
151
151
|
expect(input.classList).toContain('govuk-input');
|
|
152
152
|
expect(input.id).toEqual(fieldId);
|
|
153
|
-
expect(input.value).toEqual(val);
|
|
153
|
+
expect(input.dataset.value).toEqual(val);
|
|
154
154
|
return input;
|
|
155
155
|
};
|
|
156
156
|
var checkAutoCompleteField = function checkAutoCompleteField(formGroup, fieldId, lbl, hnt, val) {
|
|
@@ -84,7 +84,7 @@ describe('components.FormComponent.Collection', function () {
|
|
|
84
84
|
expect(input.tagName).toEqual('INPUT');
|
|
85
85
|
expect(input.classList).toContain('govuk-input');
|
|
86
86
|
expect(input.id).toEqual("".concat(ID, "[0].").concat(TEXT_ID));
|
|
87
|
-
expect(input.value).toEqual(TEXT_VALUE);
|
|
87
|
+
expect(input.dataset.value).toEqual(TEXT_VALUE);
|
|
88
88
|
case 30:
|
|
89
89
|
case "end":
|
|
90
90
|
return _context.stop();
|
|
@@ -390,11 +390,12 @@ describe('components.FormComponent.Collection', function () {
|
|
|
390
390
|
expect(hint.classList).toContain('govuk-hint');
|
|
391
391
|
expect(hint.textContent).toEqual(TEXT_COMPONENT.hint);
|
|
392
392
|
input = formGroup.childNodes[2];
|
|
393
|
+
_react.screen.debug();
|
|
393
394
|
expect(input.tagName).toEqual('DIV'); // Now readonly, so a DIV.
|
|
394
395
|
expect(input.classList).toContain('hods-readonly'); // Now readonly, so hods-readonly
|
|
395
|
-
expect(input.id).toEqual("".concat(ID, "[0].").concat(TEXT_ID));
|
|
396
|
+
expect(input.dataset.id).toEqual("".concat(ID, "[0].").concat(TEXT_ID));
|
|
396
397
|
expect(input.textContent).toEqual(TEXT_VALUE);
|
|
397
|
-
case
|
|
398
|
+
case 31:
|
|
398
399
|
case "end":
|
|
399
400
|
return _context9.stop();
|
|
400
401
|
}
|
|
@@ -518,7 +519,7 @@ describe('components.FormComponent.Collection', function () {
|
|
|
518
519
|
expect(input.tagName).toEqual('INPUT');
|
|
519
520
|
expect(input.classList).toContain('govuk-input');
|
|
520
521
|
expect(input.id).toEqual("".concat(ID, "[0].").concat(TEXT_ID));
|
|
521
|
-
expect(input.value).toEqual(TEXT_VALUE);
|
|
522
|
+
expect(input.dataset.value).toEqual(TEXT_VALUE);
|
|
522
523
|
|
|
523
524
|
// First item component 2
|
|
524
525
|
formGroup = itemContainer.childNodes[1];
|
|
@@ -537,7 +538,7 @@ describe('components.FormComponent.Collection', function () {
|
|
|
537
538
|
expect(input.tagName).toEqual('INPUT');
|
|
538
539
|
expect(input.classList).toContain('govuk-input');
|
|
539
540
|
expect(input.id).toEqual("".concat(ID, "[0].textTwo"));
|
|
540
|
-
expect(input.value).toEqual('charlie');
|
|
541
|
+
expect(input.dataset.value).toEqual('charlie');
|
|
541
542
|
|
|
542
543
|
// Check the second item and confirm there is no hint
|
|
543
544
|
itemTwo = c.childNodes[1];
|
|
@@ -564,7 +565,7 @@ describe('components.FormComponent.Collection', function () {
|
|
|
564
565
|
expect(inputTwo.tagName).toEqual('INPUT');
|
|
565
566
|
expect(inputTwo.classList).toContain('govuk-input');
|
|
566
567
|
expect(inputTwo.id).toEqual("".concat(ID, "[1].").concat(TEXT_ID));
|
|
567
|
-
expect(inputTwo.value).toEqual('beta');
|
|
568
|
+
expect(inputTwo.dataset.value).toEqual('beta');
|
|
568
569
|
|
|
569
570
|
// Second item second component
|
|
570
571
|
formGroupTwo = itemContainerTwo.childNodes[1];
|
|
@@ -581,7 +582,7 @@ describe('components.FormComponent.Collection', function () {
|
|
|
581
582
|
expect(inputTwo.tagName).toEqual('INPUT');
|
|
582
583
|
expect(inputTwo.classList).toContain('govuk-input');
|
|
583
584
|
expect(inputTwo.id).toEqual("".concat(ID, "[1].textTwo"));
|
|
584
|
-
expect(inputTwo.value).toEqual('delta');
|
|
585
|
+
expect(inputTwo.dataset.value).toEqual('delta');
|
|
585
586
|
case 87:
|
|
586
587
|
case "end":
|
|
587
588
|
return _context11.stop();
|
|
@@ -658,7 +659,7 @@ describe('components.FormComponent.Collection', function () {
|
|
|
658
659
|
expect(input.tagName).toEqual('INPUT');
|
|
659
660
|
expect(input.classList).toContain('govuk-input');
|
|
660
661
|
expect(input.id).toEqual("".concat(ID, "[0].").concat(TEXT_ID));
|
|
661
|
-
expect(input.value).toEqual(TEXT_VALUE);
|
|
662
|
+
expect(input.dataset.value).toEqual(TEXT_VALUE);
|
|
662
663
|
|
|
663
664
|
// First item component 2
|
|
664
665
|
formGroup = itemContainer.childNodes[1];
|
|
@@ -677,7 +678,7 @@ describe('components.FormComponent.Collection', function () {
|
|
|
677
678
|
expect(input.tagName).toEqual('INPUT');
|
|
678
679
|
expect(input.classList).toContain('govuk-input');
|
|
679
680
|
expect(input.id).toEqual("".concat(ID, "[0].textTwo"));
|
|
680
|
-
expect(input.value).toEqual('charlie');
|
|
681
|
+
expect(input.dataset.value).toEqual('charlie');
|
|
681
682
|
|
|
682
683
|
// Check the second item and confirm there is no hint
|
|
683
684
|
itemTwo = c.childNodes[1];
|
|
@@ -704,7 +705,7 @@ describe('components.FormComponent.Collection', function () {
|
|
|
704
705
|
expect(inputTwo.tagName).toEqual('INPUT');
|
|
705
706
|
expect(inputTwo.classList).toContain('govuk-input');
|
|
706
707
|
expect(inputTwo.id).toEqual("".concat(ID, "[1].").concat(TEXT_ID));
|
|
707
|
-
expect(inputTwo.value).toEqual('beta');
|
|
708
|
+
expect(inputTwo.dataset.value).toEqual('beta');
|
|
708
709
|
|
|
709
710
|
// Second item second component
|
|
710
711
|
formGroupTwo = itemContainerTwo.childNodes[1];
|
|
@@ -721,7 +722,7 @@ describe('components.FormComponent.Collection', function () {
|
|
|
721
722
|
expect(inputTwo.tagName).toEqual('INPUT');
|
|
722
723
|
expect(inputTwo.classList).toContain('govuk-input');
|
|
723
724
|
expect(inputTwo.id).toEqual("".concat(ID, "[1].textTwo"));
|
|
724
|
-
expect(inputTwo.value).toEqual('delta');
|
|
725
|
+
expect(inputTwo.dataset.value).toEqual('delta');
|
|
725
726
|
case 89:
|
|
726
727
|
case "end":
|
|
727
728
|
return _context12.stop();
|
|
@@ -76,7 +76,7 @@ describe('components.FormComponent.Container', function () {
|
|
|
76
76
|
expect(input.tagName).toEqual('INPUT');
|
|
77
77
|
expect(input.classList).toContain('govuk-input');
|
|
78
78
|
expect(input.id).toEqual("".concat(ID, ".").concat(TEXT_ID));
|
|
79
|
-
expect(input.value).toEqual(TEXT_VALUE);
|
|
79
|
+
expect(input.dataset.value).toEqual(TEXT_VALUE);
|
|
80
80
|
case 22:
|
|
81
81
|
case "end":
|
|
82
82
|
return _context.stop();
|
|
@@ -130,7 +130,7 @@ describe('components.FormComponent.Container', function () {
|
|
|
130
130
|
expect(input.tagName).toEqual('INPUT');
|
|
131
131
|
expect(input.classList).toContain('govuk-input');
|
|
132
132
|
expect(input.id).toEqual("".concat(ID, ".").concat(NESTED_ID, ".").concat(TEXT_ID));
|
|
133
|
-
expect(input.value).toEqual(NESTED_TEXT_VALUE);
|
|
133
|
+
expect(input.dataset.value).toEqual(NESTED_TEXT_VALUE);
|
|
134
134
|
case 25:
|
|
135
135
|
case "end":
|
|
136
136
|
return _context2.stop();
|
|
@@ -359,7 +359,7 @@ describe('components.FormComponent.Container', function () {
|
|
|
359
359
|
input = formGroup.childNodes[2];
|
|
360
360
|
expect(input.tagName).toEqual('DIV'); // Now readonly, so a DIV.
|
|
361
361
|
expect(input.classList).toContain('hods-readonly'); // Now readonly, so hods-readonly
|
|
362
|
-
expect(input.id).toEqual("".concat(ID, ".").concat(TEXT_ID));
|
|
362
|
+
expect(input.dataset.id).toEqual("".concat(ID, ".").concat(TEXT_ID));
|
|
363
363
|
expect(input.textContent).toEqual(TEXT_VALUE);
|
|
364
364
|
case 22:
|
|
365
365
|
case "end":
|
|
@@ -47,7 +47,7 @@ describe('components', function () {
|
|
|
47
47
|
expect(input.tagName).toEqual('INPUT');
|
|
48
48
|
expect(input.classList).toContain('govuk-input');
|
|
49
49
|
expect(input.id).toEqual(ID);
|
|
50
|
-
expect(input.value).toEqual(VALUE);
|
|
50
|
+
expect(input.dataset.value).toEqual(VALUE);
|
|
51
51
|
case 22:
|
|
52
52
|
case "end":
|
|
53
53
|
return _context.stop();
|
|
@@ -80,7 +80,7 @@ describe('components', function () {
|
|
|
80
80
|
expect(input.tagName).toEqual('INPUT');
|
|
81
81
|
expect(input.classList).toContain('govuk-input');
|
|
82
82
|
expect(input.id).toEqual(ID);
|
|
83
|
-
expect(input.value).toEqual(VALUE);
|
|
83
|
+
expect(input.dataset.value).toEqual(VALUE);
|
|
84
84
|
case 10:
|
|
85
85
|
case "end":
|
|
86
86
|
return _context2.stop();
|
|
@@ -215,7 +215,7 @@ describe('components', function () {
|
|
|
215
215
|
expect(input.tagName).toEqual('INPUT');
|
|
216
216
|
expect(input.classList).toContain('govuk-input');
|
|
217
217
|
expect(input.id).toEqual(ID);
|
|
218
|
-
expect(input.value).toEqual(VALUE);
|
|
218
|
+
expect(input.dataset.value).toEqual(VALUE);
|
|
219
219
|
case 23:
|
|
220
220
|
case "end":
|
|
221
221
|
return _context6.stop();
|
|
@@ -138,7 +138,7 @@ describe('components.FormPage', function () {
|
|
|
138
138
|
expect(input.tagName).toEqual('INPUT');
|
|
139
139
|
expect(input.classList).toContain('govuk-input');
|
|
140
140
|
expect(input.id).toEqual(fieldId);
|
|
141
|
-
expect(input.value).toEqual(val);
|
|
141
|
+
expect(input.dataset.value).toEqual(val);
|
|
142
142
|
return input;
|
|
143
143
|
};
|
|
144
144
|
var checkAutoCompleteField = function checkAutoCompleteField(formGroup, fieldId, lbl, hnt, val) {
|
|
@@ -148,7 +148,7 @@ describe('utils.Component.get', function () {
|
|
|
148
148
|
expect(formGroup.classList).toContain('govuk-form-group');
|
|
149
149
|
expect(input.tagName).toEqual('DIV');
|
|
150
150
|
expect(input.classList).toContain('hods-readonly');
|
|
151
|
-
expect(input.id).toEqual(ID);
|
|
151
|
+
expect(input.dataset.id).toEqual(ID);
|
|
152
152
|
expect("".concat(COMPONENT.formData[FIELD_ID])).toEqual(test.result);
|
|
153
153
|
case 13:
|
|
154
154
|
case "end":
|
|
@@ -258,7 +258,7 @@ describe('utils.Component.get', function () {
|
|
|
258
258
|
expect(formGroup.classList).toContain('govuk-form-group');
|
|
259
259
|
expect(input.tagName).toEqual('DIV');
|
|
260
260
|
expect(input.classList).toContain('hods-readonly');
|
|
261
|
-
expect(input.id).toEqual(ID);
|
|
261
|
+
expect(input.dataset.id).toEqual(ID);
|
|
262
262
|
expect(error).toBeCalledTimes(1);
|
|
263
263
|
expect(error).toBeCalledWith(test.error);
|
|
264
264
|
});
|
|
@@ -51,7 +51,7 @@ describe('utils.Component.get', function () {
|
|
|
51
51
|
expect(input.tagName).toEqual('INPUT');
|
|
52
52
|
expect(input.classList).toContain('govuk-input');
|
|
53
53
|
expect(input.id).toEqual(ID);
|
|
54
|
-
expect(input.value).toEqual(VALUE);
|
|
54
|
+
expect(input.dataset.value).toEqual(VALUE);
|
|
55
55
|
child2 = container.childNodes[1];
|
|
56
56
|
expect(child2.childNodes[0].childNodes.length).toEqual(3);
|
|
57
57
|
expect(child2.classList).toContain('govuk-form-group');
|
|
@@ -62,9 +62,9 @@ describe('utils.Component.get', function () {
|
|
|
62
62
|
expect(input2.tagName).toEqual('DIV');
|
|
63
63
|
expect(input2.classList).toContain('govuk-date-input');
|
|
64
64
|
expect(input2.id).toEqual(ID2);
|
|
65
|
-
expect(input2.childNodes[0].childNodes[1].value).toEqual('1');
|
|
66
|
-
expect(input2.childNodes[1].childNodes[1].value).toEqual('2');
|
|
67
|
-
expect(input2.childNodes[2].childNodes[1].value).toEqual('2022');
|
|
65
|
+
expect(input2.childNodes[0].childNodes[1].dataset.value).toEqual('1');
|
|
66
|
+
expect(input2.childNodes[1].childNodes[1].dataset.value).toEqual('2');
|
|
67
|
+
expect(input2.childNodes[2].childNodes[1].dataset.value).toEqual('2022');
|
|
68
68
|
case 35:
|
|
69
69
|
case "end":
|
|
70
70
|
return _context.stop();
|
|
@@ -133,7 +133,7 @@ describe('utils.Component.get', function () {
|
|
|
133
133
|
expect(input.tagName).toEqual('INPUT');
|
|
134
134
|
expect(input.classList).toContain('govuk-input');
|
|
135
135
|
expect(input.id).toEqual("".concat(CONTAINER_ID, ".").concat(FIELD_ID));
|
|
136
|
-
expect(input.value).toEqual(VALUE);
|
|
136
|
+
expect(input.dataset.value).toEqual(VALUE);
|
|
137
137
|
case 19:
|
|
138
138
|
case "end":
|
|
139
139
|
return _context3.stop();
|
|
@@ -172,7 +172,7 @@ describe('utils.Component.get', function () {
|
|
|
172
172
|
expect(input.tagName).toEqual('INPUT');
|
|
173
173
|
expect(input.classList).toContain('govuk-input');
|
|
174
174
|
expect(input.id).toEqual("".concat(COLLECTION_ID, "[0].").concat(FIELD_ID));
|
|
175
|
-
expect(input.value).toEqual(VALUE);
|
|
175
|
+
expect(input.dataset.value).toEqual(VALUE);
|
|
176
176
|
case 19:
|
|
177
177
|
case "end":
|
|
178
178
|
return _context4.stop();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ukhomeoffice/cop-react-form-renderer",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0-bravo",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf dist",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"post-compile": "rimraf dist/*.test.* dist/**/*.test.* dist/**/*.stories.* dist/docs dist/assets"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@ukhomeoffice/cop-react-components": "
|
|
19
|
+
"@ukhomeoffice/cop-react-components": "3.4.0-charlie",
|
|
20
20
|
"axios": "^0.23.0",
|
|
21
21
|
"dayjs": "^1.11.0",
|
|
22
22
|
"govuk-frontend": "^4.3.1",
|