@ukhomeoffice/cop-react-form-renderer 5.88.7 → 5.89.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.
@@ -207,7 +207,9 @@ var CheckYourAnswers = function CheckYourAnswers(_ref) {
207
207
  isGroup: isGroup(page.id)
208
208
  }));
209
209
  }), !hide_actions && /*#__PURE__*/_react.default.createElement(_PageActions.default, {
210
- actions: actions,
210
+ actions: actions === null || actions === void 0 ? void 0 : actions.filter(function (action) {
211
+ return _utils.default.Component.show(action, _pages[_pages.length - 1].formData);
212
+ }),
211
213
  onAction: function onAction(action) {
212
214
  return _onAction(action);
213
215
  }
@@ -223,7 +225,9 @@ CheckYourAnswers.propTypes = {
223
225
  noGroupAction: _propTypes.default.bool,
224
226
  onAction: _propTypes.default.func.isRequired,
225
227
  onRowAction: _propTypes.default.func.isRequired,
226
- pages: _propTypes.default.arrayOf(_propTypes.default.shape({})).isRequired,
228
+ pages: _propTypes.default.arrayOf(_propTypes.default.shape({
229
+ formData: _propTypes.default.shape({}).isRequired
230
+ })).isRequired,
227
231
  sections: _propTypes.default.arrayOf(_propTypes.default.shape({
228
232
  name: _propTypes.default.string.isRequired,
229
233
  tasks: _propTypes.default.arrayOf(_propTypes.default.shape({
@@ -13,6 +13,8 @@ var _userProfile = _interopRequireDefault(require("../../json/userProfile.json")
13
13
  var _groupData = _interopRequireDefault(require("../../json/group.data.json"));
14
14
  var _group = _interopRequireDefault(require("../../json/group.json"));
15
15
  var _groupOfRow = _interopRequireDefault(require("../../json/groupOfRow.json"));
16
+ var _actions = _interopRequireDefault(require("../../json/actions.json"));
17
+ var _actionsNoSave = _interopRequireDefault(require("../../json/actionsNoSave.json"));
16
18
  var _models = require("../../models");
17
19
  var _setupTests = require("../../setupTests");
18
20
  var _utils = _interopRequireDefault(require("../../utils"));
@@ -673,12 +675,12 @@ describe('components', function () {
673
675
  }
674
676
  }, _callee26);
675
677
  })));
676
- it('should render empty optional fields with a placeholder value when provided', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
677
- var GROUP_PAGES, cya, namesGroup, firstNameRow, surname;
678
+ it('should show a conditional button', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
679
+ var GROUP_PAGES, cya, hodsButtonDiv, submitButton, saveButton;
678
680
  return _regeneratorRuntime().wrap(function _callee28$(_context28) {
679
681
  while (1) switch (_context28.prev = _context28.next) {
680
682
  case 0:
681
- GROUP_PAGES = _utils.default.FormPage.getAll(_groupOfRow.default.pages, _groupOfRow.default.components, {});
683
+ GROUP_PAGES = _utils.default.FormPage.getAll(_groupOfRow.default.pages, _groupOfRow.default.components, _objectSpread({}, DATA));
682
684
  _context28.next = 3;
683
685
  return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
684
686
  return _regeneratorRuntime().wrap(function _callee27$(_context27) {
@@ -686,8 +688,10 @@ describe('components', function () {
686
688
  case 0:
687
689
  (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
688
690
  pages: GROUP_PAGES,
691
+ onRowAction: ON_ROW_ACTION,
692
+ onAction: ON_ACTION,
689
693
  groups: _groupOfRow.default.cya.groups,
690
- optionalFieldPlaceholder: "Not entered"
694
+ actions: _actions.default
691
695
  }), container);
692
696
  case 1:
693
697
  case "end":
@@ -695,6 +699,83 @@ describe('components', function () {
695
699
  }
696
700
  }, _callee27);
697
701
  })));
702
+ case 3:
703
+ cya = checkCYA(container);
704
+ hodsButtonDiv = cya.childNodes[7];
705
+ expect(hodsButtonDiv.classList).toContain('hods-button-group');
706
+ submitButton = hodsButtonDiv.childNodes[0];
707
+ expect(submitButton.tagName).toEqual('BUTTON');
708
+ expect(submitButton.textContent).toEqual('Submit');
709
+ saveButton = hodsButtonDiv.childNodes[1];
710
+ expect(saveButton.tagName).toEqual('BUTTON');
711
+ expect(saveButton.textContent).toEqual('Save and return later');
712
+ case 12:
713
+ case "end":
714
+ return _context28.stop();
715
+ }
716
+ }, _callee28);
717
+ })));
718
+ it('should not show a conditional button', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
719
+ var GROUP_PAGES, cya, hodsButtonDiv, submitButton, saveButton;
720
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
721
+ while (1) switch (_context30.prev = _context30.next) {
722
+ case 0:
723
+ GROUP_PAGES = _utils.default.FormPage.getAll(_groupOfRow.default.pages, _groupOfRow.default.components, _objectSpread({}, DATA));
724
+ _context30.next = 3;
725
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
726
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
727
+ while (1) switch (_context29.prev = _context29.next) {
728
+ case 0:
729
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
730
+ pages: GROUP_PAGES,
731
+ onRowAction: ON_ROW_ACTION,
732
+ onAction: ON_ACTION,
733
+ groups: _groupOfRow.default.cya.groups,
734
+ actions: _actionsNoSave.default
735
+ }), container);
736
+ case 1:
737
+ case "end":
738
+ return _context29.stop();
739
+ }
740
+ }, _callee29);
741
+ })));
742
+ case 3:
743
+ cya = checkCYA(container);
744
+ hodsButtonDiv = cya.childNodes[7];
745
+ expect(hodsButtonDiv.classList).toContain('hods-button-group');
746
+ submitButton = hodsButtonDiv.childNodes[0];
747
+ expect(submitButton.tagName).toEqual('BUTTON');
748
+ expect(submitButton.textContent).toEqual('Submit');
749
+ saveButton = hodsButtonDiv.childNodes[1];
750
+ expect(saveButton).toEqual(undefined);
751
+ case 11:
752
+ case "end":
753
+ return _context30.stop();
754
+ }
755
+ }, _callee30);
756
+ })));
757
+ it('should render empty optional fields with a placeholder value when provided', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
758
+ var GROUP_PAGES, cya, namesGroup, firstNameRow, surname;
759
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
760
+ while (1) switch (_context32.prev = _context32.next) {
761
+ case 0:
762
+ GROUP_PAGES = _utils.default.FormPage.getAll(_groupOfRow.default.pages, _groupOfRow.default.components, {});
763
+ _context32.next = 3;
764
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
765
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
766
+ while (1) switch (_context31.prev = _context31.next) {
767
+ case 0:
768
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
769
+ pages: GROUP_PAGES,
770
+ groups: _groupOfRow.default.cya.groups,
771
+ optionalFieldPlaceholder: "Not entered"
772
+ }), container);
773
+ case 1:
774
+ case "end":
775
+ return _context31.stop();
776
+ }
777
+ }, _callee31);
778
+ })));
698
779
  case 3:
699
780
  cya = checkCYA(container);
700
781
  namesGroup = cya.childNodes[2];
@@ -712,14 +793,14 @@ describe('components', function () {
712
793
  expect(surname.childNodes[1].tagName).toEqual('DD');
713
794
  case 17:
714
795
  case "end":
715
- return _context28.stop();
796
+ return _context32.stop();
716
797
  }
717
- }, _callee28);
798
+ }, _callee32);
718
799
  })));
719
- it('should show page components corrently with interpolated title and cya_label, if label is missing', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
800
+ it('should show page components corrently with interpolated title and cya_label, if label is missing', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
720
801
  var _PAGES, _COMPONENTS, T_PAGES, cya, _cya$childNodes7, cyaTitle, cyaChildNode, names, _names$childNodes3, firstName, surname, _firstName$childNodes, label;
721
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
722
- while (1) switch (_context30.prev = _context30.next) {
802
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
803
+ while (1) switch (_context34.prev = _context34.next) {
723
804
  case 0:
724
805
  _PAGES = [].concat(_userProfile.default.pages); // eslint-disable-next-line no-template-curly-in-string
725
806
  _PAGES[0] = _objectSpread(_objectSpread({}, _PAGES[0]), {}, {
@@ -733,10 +814,10 @@ describe('components', function () {
733
814
  cya_label: "Text ${currentUser.familyName}"
734
815
  });
735
816
  T_PAGES = _utils.default.FormPage.getAll(_PAGES, _COMPONENTS, DATA);
736
- _context30.next = 7;
737
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
738
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
739
- while (1) switch (_context29.prev = _context29.next) {
817
+ _context34.next = 7;
818
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
819
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
820
+ while (1) switch (_context33.prev = _context33.next) {
740
821
  case 0:
741
822
  (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
742
823
  pages: T_PAGES,
@@ -745,9 +826,9 @@ describe('components', function () {
745
826
  }), container);
746
827
  case 1:
747
828
  case "end":
748
- return _context29.stop();
829
+ return _context33.stop();
749
830
  }
750
- }, _callee29);
831
+ }, _callee33);
751
832
  })));
752
833
  case 7:
753
834
  cya = checkCYA(container);
@@ -762,14 +843,14 @@ describe('components', function () {
762
843
  checkRow(surname, 'Last name', 'Smith', false);
763
844
  case 17:
764
845
  case "end":
765
- return _context30.stop();
846
+ return _context34.stop();
766
847
  }
767
- }, _callee30);
848
+ }, _callee34);
768
849
  })));
769
- it('should show page components corrently with no label, if label and cya_label are missing', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
850
+ it('should show page components corrently with no label, if label and cya_label are missing', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
770
851
  var _PAGES, _COMPONENTS, T_PAGES, cya, _cya$childNodes8, cyaChildNode, names, _names$childNodes4, firstName, surname, _firstName$childNodes2, label;
771
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
772
- while (1) switch (_context32.prev = _context32.next) {
852
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
853
+ while (1) switch (_context36.prev = _context36.next) {
773
854
  case 0:
774
855
  _PAGES = [].concat(_userProfile.default.pages);
775
856
  _COMPONENTS = [].concat(_userProfile.default.components);
@@ -779,10 +860,10 @@ describe('components', function () {
779
860
  cya_label: undefined
780
861
  });
781
862
  T_PAGES = _utils.default.FormPage.getAll(_PAGES, _COMPONENTS, _objectSpread({}, DATA));
782
- _context32.next = 6;
783
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
784
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
785
- while (1) switch (_context31.prev = _context31.next) {
863
+ _context36.next = 6;
864
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
865
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
866
+ while (1) switch (_context35.prev = _context35.next) {
786
867
  case 0:
787
868
  (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
788
869
  pages: T_PAGES,
@@ -791,9 +872,9 @@ describe('components', function () {
791
872
  }), container);
792
873
  case 1:
793
874
  case "end":
794
- return _context31.stop();
875
+ return _context35.stop();
795
876
  }
796
- }, _callee31);
877
+ }, _callee35);
797
878
  })));
798
879
  case 6:
799
880
  cya = checkCYA(container);
@@ -807,14 +888,14 @@ describe('components', function () {
807
888
  checkRow(surname, 'Last name', 'Smith', false);
808
889
  case 15:
809
890
  case "end":
810
- return _context32.stop();
891
+ return _context36.stop();
811
892
  }
812
- }, _callee32);
893
+ }, _callee36);
813
894
  })));
814
- it('should show task list in CYA style and hide pages from skipped tasks', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
895
+ it('should show task list in CYA style and hide pages from skipped tasks', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
815
896
  var sections, taskHeading1, namesPageHeading;
816
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
817
- while (1) switch (_context34.prev = _context34.next) {
897
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
898
+ while (1) switch (_context38.prev = _context38.next) {
818
899
  case 0:
819
900
  sections = [{
820
901
  name: 'These are your tasks',
@@ -828,10 +909,10 @@ describe('components', function () {
828
909
  pages: ['grade']
829
910
  }]
830
911
  }];
831
- _context34.next = 3;
832
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
833
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
834
- while (1) switch (_context33.prev = _context33.next) {
912
+ _context38.next = 3;
913
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
914
+ return _regeneratorRuntime().wrap(function _callee37$(_context37) {
915
+ while (1) switch (_context37.prev = _context37.next) {
835
916
  case 0:
836
917
  (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
837
918
  pages: PAGES,
@@ -843,9 +924,9 @@ describe('components', function () {
843
924
  }), container);
844
925
  case 1:
845
926
  case "end":
846
- return _context33.stop();
927
+ return _context37.stop();
847
928
  }
848
- }, _callee33);
929
+ }, _callee37);
849
930
  })));
850
931
  case 3:
851
932
  taskHeading1 = container.childNodes[0].childNodes[0];
@@ -859,21 +940,21 @@ describe('components', function () {
859
940
  expect(container.childNodes[0].childNodes.length).toEqual(2); // second task skipped so not shown
860
941
  case 12:
861
942
  case "end":
862
- return _context34.stop();
943
+ return _context38.stop();
863
944
  }
864
- }, _callee34);
945
+ }, _callee38);
865
946
  })));
866
- it('Show answers from multiple address fields into in one DL correctly when hideBlankRows is true', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
947
+ it('Show answers from multiple address fields into in one DL correctly when hideBlankRows is true', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
867
948
  var ADDRESS_DATA, GROUP_PAGES, cya, groupedComponent, keyGroup, valueGroup, changeButtonDiv, changeButton;
868
- return _regeneratorRuntime().wrap(function _callee36$(_context36) {
869
- while (1) switch (_context36.prev = _context36.next) {
949
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
950
+ while (1) switch (_context40.prev = _context40.next) {
870
951
  case 0:
871
952
  ADDRESS_DATA = _utils.default.Data.setupForm(_group.default.pages, _group.default.components, _groupData.default);
872
953
  GROUP_PAGES = _utils.default.FormPage.getAll(_group.default.pages, _group.default.components, _objectSpread({}, ADDRESS_DATA));
873
- _context36.next = 4;
874
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
875
- return _regeneratorRuntime().wrap(function _callee35$(_context35) {
876
- while (1) switch (_context35.prev = _context35.next) {
954
+ _context40.next = 4;
955
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
956
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
957
+ while (1) switch (_context39.prev = _context39.next) {
877
958
  case 0:
878
959
  (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
879
960
  pages: GROUP_PAGES,
@@ -884,9 +965,9 @@ describe('components', function () {
884
965
  }), container);
885
966
  case 1:
886
967
  case "end":
887
- return _context35.stop();
968
+ return _context39.stop();
888
969
  }
889
- }, _callee35);
970
+ }, _callee39);
890
971
  })));
891
972
  case 4:
892
973
  cya = checkCYA(container);
@@ -908,9 +989,9 @@ describe('components', function () {
908
989
  expect(changeButton.textContent).toEqual('Change address details');
909
990
  case 21:
910
991
  case "end":
911
- return _context36.stop();
992
+ return _context40.stop();
912
993
  }
913
- }, _callee36);
994
+ }, _callee40);
914
995
  })));
915
996
  });
916
997
  });
@@ -0,0 +1,17 @@
1
+ [
2
+ {
3
+ "type": "submit",
4
+ "label": "Submit",
5
+ "validate": true
6
+ },
7
+ {
8
+ "type": "saveAndReturn",
9
+ "show_when": {
10
+ "field": "areYouACivilServant",
11
+ "op": "nin",
12
+ "values": [
13
+ "no"
14
+ ]
15
+ }
16
+ }
17
+ ]
@@ -0,0 +1,17 @@
1
+ [
2
+ {
3
+ "type": "submit",
4
+ "label": "Submit",
5
+ "validate": true
6
+ },
7
+ {
8
+ "type": "saveAndReturn",
9
+ "show_when": {
10
+ "field": "areYouACivilServant",
11
+ "op": "nin",
12
+ "values": [
13
+ "yes"
14
+ ]
15
+ }
16
+ }
17
+ ]
@@ -14,6 +14,7 @@ describe('utils', function () {
14
14
  var gbCurrency = {
15
15
  currencyName: 'Great British Pounds',
16
16
  currencyCode: 'GBP',
17
+ hint: 'hint',
17
18
  value: 'GBP',
18
19
  label: 'GBP',
19
20
  slangTerm: 'quid'
@@ -21,6 +22,7 @@ describe('utils', function () {
21
22
  var usCurrency = {
22
23
  currencyName: 'United States Dollars',
23
24
  currencyCode: 'USD',
25
+ hint: 'hint',
24
26
  value: 'USD',
25
27
  label: 'USD',
26
28
  slangTerm: 'bucks',
@@ -29,19 +31,23 @@ describe('utils', function () {
29
31
  var options = {
30
32
  alpha: {
31
33
  value: 'a',
32
- label: 'Alpha'
34
+ label: 'Alpha',
35
+ hint: 'hint'
33
36
  },
34
37
  bravo: {
35
38
  value: 'b',
36
- label: 'Bravo'
39
+ label: 'Bravo',
40
+ hint: 'hint'
37
41
  },
38
42
  alIncluded: {
39
43
  value: 'c',
40
- label: 'Call me alan'
44
+ label: 'Call me alan',
45
+ hint: 'hint'
41
46
  },
42
47
  alStart: {
43
48
  value: 'd',
44
- label: 'Word Alphabet'
49
+ label: 'Word Alphabet',
50
+ hint: 'hint'
45
51
  }
46
52
  };
47
53
  var testCurrencies = [gbCurrency, usCurrency];
@@ -71,7 +77,8 @@ describe('utils', function () {
71
77
  expect(results.length).toEqual(1);
72
78
  expect(results).toEqual([{
73
79
  value: 'a',
74
- label: 'Alpha'
80
+ label: 'Alpha',
81
+ hint: 'hint'
75
82
  }]);
76
83
  });
77
84
  });
@@ -249,6 +256,7 @@ describe('utils', function () {
249
256
  options: [gbCurrency, {
250
257
  currencyName: 'United States Dollars',
251
258
  currencyCode: 'USD',
259
+ hint: 'hint',
252
260
  value: 'USD'
253
261
  }]
254
262
  }
@@ -263,6 +271,7 @@ describe('utils', function () {
263
271
  expect(results).toEqual([gbCurrency, {
264
272
  currencyName: 'United States Dollars',
265
273
  currencyCode: 'USD',
274
+ hint: 'hint',
266
275
  value: 'USD',
267
276
  label: ''
268
277
  }]);
@@ -32,7 +32,8 @@ var interpolateOptions = function interpolateOptions(config, options) {
32
32
  }
33
33
  return _objectSpread(_objectSpread({}, opt), {}, {
34
34
  value: _copReactComponents.Utils.interpolateString(opt.value, config.formData),
35
- label: _copReactComponents.Utils.interpolateString(opt.label, config.formData)
35
+ label: _copReactComponents.Utils.interpolateString(opt.label, config.formData),
36
+ hint: _copReactComponents.Utils.interpolateString(opt.hint, config.formData)
36
37
  });
37
38
  }).filter(function (n) {
38
39
  return n;
@@ -16,10 +16,12 @@ describe('utils', function () {
16
16
  var CONFIG = {
17
17
  options: [{
18
18
  value: 'a',
19
- label: 'Alpha'
19
+ label: 'Alpha',
20
+ hint: ''
20
21
  }, {
21
22
  value: 'b',
22
- label: 'Bravo'
23
+ label: 'Bravo',
24
+ hint: ''
23
25
  }]
24
26
  };
25
27
  (0, _getOptions.default)(CONFIG, function (options) {
@@ -31,10 +33,12 @@ describe('utils', function () {
31
33
  data: {
32
34
  options: [{
33
35
  value: 'a',
34
- label: 'Alpha'
36
+ label: 'Alpha',
37
+ hint: ''
35
38
  }, {
36
39
  value: 'b',
37
- label: 'Bravo'
40
+ label: 'Bravo',
41
+ hint: ''
38
42
  }]
39
43
  }
40
44
  };
@@ -46,10 +50,12 @@ describe('utils', function () {
46
50
  var CONFIG = {
47
51
  options: [{
48
52
  value: 'a',
49
- label: 'Alpha'
53
+ label: 'Alpha',
54
+ hint: ''
50
55
  }, {
51
56
  value: 'b',
52
- label: 'Bravo'
57
+ label: 'Bravo',
58
+ hint: ''
53
59
  }],
54
60
  data: {
55
61
  options: [{
@@ -71,6 +77,7 @@ describe('utils', function () {
71
77
  options: [{
72
78
  value: 'a',
73
79
  label: 'Alpha',
80
+ hint: '',
74
81
  show_when: {
75
82
  field: 'other',
76
83
  op: 'eq',
@@ -79,6 +86,7 @@ describe('utils', function () {
79
86
  }, {
80
87
  value: 'b',
81
88
  label: 'Bravo',
89
+ hint: '',
82
90
  show_when: {
83
91
  field: 'other',
84
92
  op: 'neq',
@@ -99,6 +107,7 @@ describe('utils', function () {
99
107
  options: [{
100
108
  value: 'a',
101
109
  label: 'Alpha',
110
+ hint: '',
102
111
  show_when: {
103
112
  type: 'or',
104
113
  conditions: [{
@@ -114,6 +123,7 @@ describe('utils', function () {
114
123
  }, {
115
124
  value: 'b',
116
125
  label: 'Bravo',
126
+ hint: '',
117
127
  show_when: {
118
128
  type: 'or',
119
129
  conditions: [{
@@ -152,16 +162,19 @@ describe('utils', function () {
152
162
  options: [{
153
163
  id: 1,
154
164
  description: 'First refdata item',
165
+ hint: '',
155
166
  value: 'firstValue',
156
167
  label: 'First label'
157
168
  }, {
158
169
  id: 2,
159
170
  description: 'Second refdata item',
171
+ hint: '',
160
172
  value: 'secondValue',
161
173
  label: 'Second label'
162
174
  }, {
163
175
  id: 3,
164
176
  description: 'Third refdata item',
177
+ hint: '',
165
178
  value: 'thirdValue',
166
179
  label: 'Third label'
167
180
  }]
@@ -169,11 +182,13 @@ describe('utils', function () {
169
182
  var MERGED_CONFIG = [{
170
183
  id: 1,
171
184
  description: 'First refdata item',
185
+ hint: '',
172
186
  value: 'firstValue',
173
187
  label: 'First label'
174
188
  }, {
175
189
  id: 2,
176
190
  description: 'Second refdata item',
191
+ hint: '',
177
192
  value: 'secondValue',
178
193
  nested: [{
179
194
  value: 'a',
@@ -183,6 +198,7 @@ describe('utils', function () {
183
198
  }, {
184
199
  id: 3,
185
200
  description: 'Third refdata item',
201
+ hint: '',
186
202
  value: 'thirdValue',
187
203
  label: 'Third label'
188
204
  }];
@@ -196,11 +212,13 @@ describe('utils', function () {
196
212
  options: [{
197
213
  value: 'a',
198
214
  label: 'Alpha',
199
- description: 'first'
215
+ description: 'first',
216
+ hint: ''
200
217
  }, {
201
218
  value: 'b',
202
219
  label: 'Bravo',
203
- description: 'second'
220
+ description: 'second',
221
+ hint: ''
204
222
  }]
205
223
  };
206
224
  (0, _getOptions.default)(CONFIG, function (options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "5.88.7",
3
+ "version": "5.89.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",