@ukhomeoffice/cop-react-form-renderer 5.16.2-alpha → 5.17.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.
@@ -46,7 +46,7 @@ var getComponentToUse = function getComponentToUse(toUse, formComponents) {
46
46
  }
47
47
  if (component) {
48
48
  component = _objectSpread(_objectSpread(_objectSpread({}, component), toUse), {}, {
49
- cya_label: component.label || component.cya_label,
49
+ cya_label: toUse.cya_label || component.cya_label || component.label,
50
50
  fieldId: toUse.fieldId || component.fieldId
51
51
  });
52
52
  if (parent && parent.id !== component.id) {
@@ -162,6 +162,19 @@ describe('utils', function () {
162
162
  };
163
163
  expect((0, _useComponent.default)(TO_USE, FORM_COMPONENTS)).toEqual(TO_USE);
164
164
  });
165
+ it('should allow the cya_label to overriden', function () {
166
+ var TO_USE = {
167
+ use: 'd',
168
+ cya_label: 'Alpha'
169
+ };
170
+ var A = FORM_COMPONENTS[3];
171
+ expect((0, _useComponent.default)(TO_USE, FORM_COMPONENTS)).toEqual(_objectSpread(_objectSpread({
172
+ use: 'd'
173
+ }, A), {}, {
174
+ cya_label: TO_USE.cya_label,
175
+ label: TO_USE.label
176
+ }));
177
+ });
165
178
  });
166
179
  });
167
180
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "5.16.2-alpha",
3
+ "version": "5.17.0",
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": "3.5.1-alpha",
19
+ "@ukhomeoffice/cop-react-components": "^3.5.0",
20
20
  "axios": "^0.23.0",
21
21
  "dayjs": "^1.11.0",
22
22
  "govuk-frontend": "^4.3.1",