@ukhomeoffice/cop-react-form-renderer 4.67.0 → 4.69.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.
Files changed (317) hide show
  1. package/dist/components/CheckYourAnswers/Answer.js +6 -16
  2. package/dist/components/CheckYourAnswers/Answer.test.js +104 -129
  3. package/dist/components/CheckYourAnswers/CheckYourAnswers.js +26 -64
  4. package/dist/components/CheckYourAnswers/CheckYourAnswers.test.js +428 -555
  5. package/dist/components/CheckYourAnswers/index.js +0 -3
  6. package/dist/components/CollectionPage/CollectionPage.js +13 -42
  7. package/dist/components/CollectionPage/CollectionPage.test.js +160 -206
  8. package/dist/components/CollectionPage/index.js +0 -3
  9. package/dist/components/FormComponent/Collection.js +35 -79
  10. package/dist/components/FormComponent/Collection.test.js +340 -391
  11. package/dist/components/FormComponent/Container.js +10 -31
  12. package/dist/components/FormComponent/Container.test.js +304 -357
  13. package/dist/components/FormComponent/FormComponent.js +17 -60
  14. package/dist/components/FormComponent/FormComponent.test.js +190 -228
  15. package/dist/components/FormComponent/helpers/addLabel.js +4 -7
  16. package/dist/components/FormComponent/helpers/getComponentDisabled.js +0 -4
  17. package/dist/components/FormComponent/helpers/getComponentDisabled.test.js +0 -2
  18. package/dist/components/FormComponent/helpers/getComponentError.js +0 -6
  19. package/dist/components/FormComponent/helpers/getComponentError.test.js +0 -2
  20. package/dist/components/FormComponent/helpers/index.js +0 -4
  21. package/dist/components/FormComponent/index.js +0 -3
  22. package/dist/components/FormPage/FormPage.js +21 -53
  23. package/dist/components/FormPage/FormPage.test.js +122 -160
  24. package/dist/components/FormPage/index.js +0 -3
  25. package/dist/components/FormRenderer/FormRenderer.js +106 -296
  26. package/dist/components/FormRenderer/FormRenderer.test.js +820 -1058
  27. package/dist/components/FormRenderer/handlers/cyaAction.js +0 -5
  28. package/dist/components/FormRenderer/handlers/getPageId.js +0 -2
  29. package/dist/components/FormRenderer/handlers/getPageId.test.js +1 -2
  30. package/dist/components/FormRenderer/handlers/handlers.test.js +1 -18
  31. package/dist/components/FormRenderer/handlers/index.js +0 -5
  32. package/dist/components/FormRenderer/handlers/navigate.js +0 -5
  33. package/dist/components/FormRenderer/handlers/submissionError.js +0 -2
  34. package/dist/components/FormRenderer/helpers/canActionProceed.js +0 -3
  35. package/dist/components/FormRenderer/helpers/canActionProceed.test.js +1 -3
  36. package/dist/components/FormRenderer/helpers/canCYASubmit.js +0 -2
  37. package/dist/components/FormRenderer/helpers/canCYASubmit.test.js +1 -5
  38. package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.js +12 -16
  39. package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.test.js +48 -11
  40. package/dist/components/FormRenderer/helpers/getCYA.js +0 -9
  41. package/dist/components/FormRenderer/helpers/getCYA.test.js +1 -3
  42. package/dist/components/FormRenderer/helpers/getFormState.js +0 -5
  43. package/dist/components/FormRenderer/helpers/getFormState.test.js +1 -3
  44. package/dist/components/FormRenderer/helpers/getNextPageId.js +0 -25
  45. package/dist/components/FormRenderer/helpers/getNextPageId.test.js +1 -4
  46. package/dist/components/FormRenderer/helpers/getPage.js +0 -5
  47. package/dist/components/FormRenderer/helpers/getPage.test.js +1 -3
  48. package/dist/components/FormRenderer/helpers/getRelevantPages.js +0 -6
  49. package/dist/components/FormRenderer/helpers/getRelevantPages.test.js +1 -3
  50. package/dist/components/FormRenderer/helpers/getSubmissionStatus.js +0 -10
  51. package/dist/components/FormRenderer/helpers/getSubmissionStatus.test.js +4 -7
  52. package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.js +32 -41
  53. package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.test.js +122 -8
  54. package/dist/components/FormRenderer/helpers/index.js +1 -11
  55. package/dist/components/FormRenderer/index.js +0 -3
  56. package/dist/components/FormRenderer/onCYAAction.js +8 -30
  57. package/dist/components/FormRenderer/onCYAAction.test.js +54 -79
  58. package/dist/components/FormRenderer/onPageAction.js +123 -0
  59. package/dist/components/FormRenderer/onPageAction.test.js +632 -0
  60. package/dist/components/PageActions/ActionButton.js +2 -17
  61. package/dist/components/PageActions/ActionButton.test.js +58 -81
  62. package/dist/components/PageActions/PageActions.js +3 -10
  63. package/dist/components/PageActions/PageActions.test.js +95 -120
  64. package/dist/components/PageActions/index.js +0 -3
  65. package/dist/components/SummaryList/GroupAction.js +5 -26
  66. package/dist/components/SummaryList/GroupAction.test.js +14 -28
  67. package/dist/components/SummaryList/RowAction.js +5 -25
  68. package/dist/components/SummaryList/RowAction.test.js +14 -28
  69. package/dist/components/SummaryList/SummaryList.js +7 -31
  70. package/dist/components/SummaryList/SummaryList.test.js +69 -126
  71. package/dist/components/SummaryList/SummaryListHeadingRow.js +3 -8
  72. package/dist/components/SummaryList/SummaryListRow.js +4 -8
  73. package/dist/components/SummaryList/SummaryListTitleRow.js +2 -7
  74. package/dist/components/SummaryList/helpers/getGroupActionAttributes.js +0 -3
  75. package/dist/components/SummaryList/helpers/getGroupActionAttributes.test.js +0 -6
  76. package/dist/components/SummaryList/helpers/getRowActionAttributes.js +0 -3
  77. package/dist/components/SummaryList/helpers/getRowActionAttributes.test.js +0 -6
  78. package/dist/components/SummaryList/helpers/index.js +0 -2
  79. package/dist/components/SummaryList/index.js +0 -3
  80. package/dist/components/TaskList/Task.js +9 -31
  81. package/dist/components/TaskList/Task.test.js +32 -59
  82. package/dist/components/TaskList/TaskList.js +32 -59
  83. package/dist/components/TaskList/TaskList.test.js +52 -90
  84. package/dist/components/TaskList/TaskState.js +2 -10
  85. package/dist/components/TaskList/TaskState.test.js +23 -41
  86. package/dist/components/TaskList/index.js +0 -3
  87. package/dist/components/index.js +0 -7
  88. package/dist/context/HooksContext/HooksContext.js +21 -39
  89. package/dist/context/HooksContext/HooksContext.test.js +18 -34
  90. package/dist/context/HooksContext/index.js +0 -5
  91. package/dist/context/ValidationContext/ValidationContext.js +26 -56
  92. package/dist/context/ValidationContext/ValidationContext.test.js +43 -64
  93. package/dist/context/ValidationContext/index.js +0 -5
  94. package/dist/context/index.js +0 -3
  95. package/dist/hooks/index.js +0 -9
  96. package/dist/hooks/useAxios.js +17 -36
  97. package/dist/hooks/useGetRequest.js +57 -93
  98. package/dist/hooks/useHooks.js +2 -4
  99. package/dist/hooks/useRefData.js +14 -41
  100. package/dist/hooks/useValidation.js +2 -4
  101. package/dist/index.js +0 -9
  102. package/dist/models/PageAction.js +4 -4
  103. package/dist/models/TaskStates.js +4 -4
  104. package/dist/models/index.js +1 -10
  105. package/dist/setupTests.js +0 -13
  106. package/dist/utils/CheckYourAnswers/getCYAAction.js +1 -9
  107. package/dist/utils/CheckYourAnswers/getCYAAction.test.js +1 -19
  108. package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.js +4 -11
  109. package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.test.js +4 -9
  110. package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.js +4 -9
  111. package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.test.js +4 -8
  112. package/dist/utils/CheckYourAnswers/getCYARow.js +3 -11
  113. package/dist/utils/CheckYourAnswers/getCYARow.test.js +60 -25
  114. package/dist/utils/CheckYourAnswers/getCYARowForGroup.js +6 -21
  115. package/dist/utils/CheckYourAnswers/getCYARowForGroup.test.js +2 -9
  116. package/dist/utils/CheckYourAnswers/getCYARowsForCollection.js +4 -20
  117. package/dist/utils/CheckYourAnswers/getCYARowsForCollection.test.js +7 -22
  118. package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.js +4 -32
  119. package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.test.js +4 -34
  120. package/dist/utils/CheckYourAnswers/getCYARowsForContainer.js +4 -15
  121. package/dist/utils/CheckYourAnswers/getCYARowsForContainer.test.js +4 -22
  122. package/dist/utils/CheckYourAnswers/getCYARowsForPage.js +2 -22
  123. package/dist/utils/CheckYourAnswers/getCYARowsForPage.test.js +7 -25
  124. package/dist/utils/CheckYourAnswers/index.js +1 -3
  125. package/dist/utils/CheckYourAnswers/showComponentCYA.js +2 -15
  126. package/dist/utils/CheckYourAnswers/showComponentCYA.test.js +1 -3
  127. package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.js +4 -12
  128. package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.test.js +5 -6
  129. package/dist/utils/CollectionPage/getCollectionPageActiveIndex.js +0 -6
  130. package/dist/utils/CollectionPage/getCollectionPageActiveIndex.test.js +1 -2
  131. package/dist/utils/CollectionPage/index.js +1 -5
  132. package/dist/utils/CollectionPage/mergeCollectionPages.js +5 -11
  133. package/dist/utils/CollectionPage/mergeCollectionPages.test.js +1 -2
  134. package/dist/utils/Component/addShowWhen.js +4 -10
  135. package/dist/utils/Component/addShowWhen.test.js +1 -2
  136. package/dist/utils/Component/applyToComponentTree.js +4 -18
  137. package/dist/utils/Component/applyToComponentTree.test.js +4 -8
  138. package/dist/utils/Component/cleanAttributes.js +1 -8
  139. package/dist/utils/Component/cleanAttributes.test.js +15 -16
  140. package/dist/utils/Component/elevateNestedComponents.js +0 -6
  141. package/dist/utils/Component/elevateNestedComponents.test.js +0 -2
  142. package/dist/utils/Component/getComponent.js +13 -86
  143. package/dist/utils/Component/getComponentTests/getComponent.autocomplete.test.js +6 -10
  144. package/dist/utils/Component/getComponentTests/getComponent.calculation.test.js +33 -51
  145. package/dist/utils/Component/getComponentTests/getComponent.checkboxes.test.js +8 -35
  146. package/dist/utils/Component/getComponentTests/getComponent.date.test.js +12 -29
  147. package/dist/utils/Component/getComponentTests/getComponent.details.test.js +4 -10
  148. package/dist/utils/Component/getComponentTests/getComponent.email.test.js +6 -23
  149. package/dist/utils/Component/getComponentTests/getComponent.file.test.js +6 -24
  150. package/dist/utils/Component/getComponentTests/getComponent.heading.test.js +3 -7
  151. package/dist/utils/Component/getComponentTests/getComponent.html.test.js +4 -10
  152. package/dist/utils/Component/getComponentTests/getComponent.insetText.test.js +3 -7
  153. package/dist/utils/Component/getComponentTests/getComponent.list.test.js +4 -10
  154. package/dist/utils/Component/getComponentTests/getComponent.multifile.test.js +5 -22
  155. package/dist/utils/Component/getComponentTests/getComponent.nested.test.js +156 -175
  156. package/dist/utils/Component/getComponentTests/getComponent.paragraph.test.js +4 -10
  157. package/dist/utils/Component/getComponentTests/getComponent.phoneNumber.test.js +6 -23
  158. package/dist/utils/Component/getComponentTests/getComponent.radios.test.js +8 -35
  159. package/dist/utils/Component/getComponentTests/getComponent.select.test.js +6 -23
  160. package/dist/utils/Component/getComponentTests/getComponent.text.test.js +6 -23
  161. package/dist/utils/Component/getComponentTests/getComponent.textArea.test.js +10 -34
  162. package/dist/utils/Component/getComponentTests/getComponent.time.test.js +12 -31
  163. package/dist/utils/Component/getComponentTests/getComponent.unknown.test.js +1 -2
  164. package/dist/utils/Component/getComponentTests/getComponent.warningText.test.js +3 -7
  165. package/dist/utils/Component/getDefaultValue.js +4 -8
  166. package/dist/utils/Component/getDefaultValue.test.js +0 -3
  167. package/dist/utils/Component/index.js +0 -10
  168. package/dist/utils/Component/isEditable.js +1 -4
  169. package/dist/utils/Component/isEditable.test.js +1 -5
  170. package/dist/utils/Component/optionIsSelected.js +22 -0
  171. package/dist/utils/Component/optionIsSelected.test.js +42 -0
  172. package/dist/utils/Component/setupContainerComponentsPath.js +4 -9
  173. package/dist/utils/Component/setupContainerComponentsPath.test.js +0 -3
  174. package/dist/utils/Component/showComponent.js +1 -8
  175. package/dist/utils/Component/showComponent.test.js +1 -2
  176. package/dist/utils/Component/wrapInFormGroup.js +0 -7
  177. package/dist/utils/Condition/index.js +0 -5
  178. package/dist/utils/Condition/meetsAllConditions.js +0 -9
  179. package/dist/utils/Condition/meetsAllConditions.test.js +1 -2
  180. package/dist/utils/Condition/meetsCondition.js +9 -34
  181. package/dist/utils/Condition/meetsCondition.test.js +21 -14
  182. package/dist/utils/Condition/meetsOneCondition.js +1 -9
  183. package/dist/utils/Condition/meetsOneCondition.test.js +1 -2
  184. package/dist/utils/Condition/setupConditions.js +4 -13
  185. package/dist/utils/Condition/setupConditions.test.js +0 -2
  186. package/dist/utils/Container/getEditableComponents.js +0 -7
  187. package/dist/utils/Container/getEditableComponents.test.js +1 -12
  188. package/dist/utils/Container/index.js +0 -5
  189. package/dist/utils/Container/setupNesting.js +4 -12
  190. package/dist/utils/Container/setupNesting.test.js +4 -10
  191. package/dist/utils/Container/showContainer.js +9 -18
  192. package/dist/utils/Container/showContainer.test.js +1 -2
  193. package/dist/utils/Data/applyFormula.js +6 -29
  194. package/dist/utils/Data/applyFormula.test.js +1 -2
  195. package/dist/utils/Data/getAutocompleteSource.js +1 -5
  196. package/dist/utils/Data/getAutocompleteSource.test.js +1 -2
  197. package/dist/utils/Data/getDataPath.js +3 -17
  198. package/dist/utils/Data/getDataPath.test.js +0 -4
  199. package/dist/utils/Data/getOptions.js +4 -14
  200. package/dist/utils/Data/getOptions.test.js +1 -2
  201. package/dist/utils/Data/getSourceData.js +6 -21
  202. package/dist/utils/Data/getSourceData.test.js +4 -6
  203. package/dist/utils/Data/index.js +1 -11
  204. package/dist/utils/Data/refDataToOptions.js +5 -13
  205. package/dist/utils/Data/refDataToOptions.test.js +1 -2
  206. package/dist/utils/Data/setDataItem.js +0 -5
  207. package/dist/utils/Data/setDataItem.test.js +0 -2
  208. package/dist/utils/Data/setupFormData.js +6 -25
  209. package/dist/utils/Data/setupFormData.test.js +8 -11
  210. package/dist/utils/Data/setupRefDataUrlForComponent.js +4 -15
  211. package/dist/utils/Data/setupRefDataUrlForComponent.test.js +1 -3
  212. package/dist/utils/FormPage/applyConditionalProperties.js +4 -11
  213. package/dist/utils/FormPage/applyConditionalProperties.test.js +4 -6
  214. package/dist/utils/FormPage/getFormPage.js +4 -16
  215. package/dist/utils/FormPage/getFormPage.test.js +10 -9
  216. package/dist/utils/FormPage/getFormPages.js +4 -9
  217. package/dist/utils/FormPage/getFormPages.test.js +6 -7
  218. package/dist/utils/FormPage/getPageActions.js +6 -19
  219. package/dist/utils/FormPage/getPageActions.test.js +1 -3
  220. package/dist/utils/FormPage/getParagraphFromText.js +0 -3
  221. package/dist/utils/FormPage/getParagraphFromText.test.js +1 -3
  222. package/dist/utils/FormPage/index.js +0 -7
  223. package/dist/utils/FormPage/showFormPage.js +9 -18
  224. package/dist/utils/FormPage/showFormPage.test.js +0 -2
  225. package/dist/utils/FormPage/showFormPageCYA.js +0 -5
  226. package/dist/utils/FormPage/showFormPageCYA.test.js +0 -2
  227. package/dist/utils/FormPage/useComponent.js +7 -19
  228. package/dist/utils/FormPage/useComponent.test.js +4 -7
  229. package/dist/utils/Format/formatData.js +0 -5
  230. package/dist/utils/Format/formatData.test.js +1 -2
  231. package/dist/utils/Format/formatDataForComponent.js +1 -6
  232. package/dist/utils/Format/formatDataForComponent.test.js +28 -47
  233. package/dist/utils/Format/formatDataForForm.js +4 -9
  234. package/dist/utils/Format/formatDataForForm.test.js +14 -11
  235. package/dist/utils/Format/formatDataForPage.js +1 -5
  236. package/dist/utils/Format/formatDataForPage.test.js +15 -12
  237. package/dist/utils/Format/index.js +1 -6
  238. package/dist/utils/Hub/getFormHub.js +0 -8
  239. package/dist/utils/Hub/getFormHub.test.js +6 -8
  240. package/dist/utils/Hub/index.js +1 -3
  241. package/dist/utils/Meta/documents/getDocuments.js +1 -4
  242. package/dist/utils/Meta/documents/getDocuments.test.js +4 -10
  243. package/dist/utils/Meta/documents/index.js +1 -5
  244. package/dist/utils/Meta/documents/setDocumentsForField.js +4 -11
  245. package/dist/utils/Meta/documents/setDocumentsForField.test.js +4 -16
  246. package/dist/utils/Meta/index.js +1 -4
  247. package/dist/utils/Operate/checkValueIsTruthy.js +1 -7
  248. package/dist/utils/Operate/checkValueIsTruthy.test.js +0 -2
  249. package/dist/utils/Operate/getFirstOf.js +2 -9
  250. package/dist/utils/Operate/getFirstOf.test.js +0 -2
  251. package/dist/utils/Operate/getIndexOfMatchingValueIn.js +7 -21
  252. package/dist/utils/Operate/getIndexOfMatchingValueIn.test.js +6 -2
  253. package/dist/utils/Operate/index.js +0 -3
  254. package/dist/utils/Operate/persistValueInFormData.js +1 -8
  255. package/dist/utils/Operate/persistValueInFormData.test.js +0 -4
  256. package/dist/utils/Operate/runPageOperations.js +3 -19
  257. package/dist/utils/Operate/runPageOperations.test.js +4 -6
  258. package/dist/utils/Operate/setValueInFormData.js +2 -7
  259. package/dist/utils/Operate/setValueInFormData.test.js +0 -2
  260. package/dist/utils/Operate/shouldRun.js +1 -14
  261. package/dist/utils/Operate/shouldRun.test.js +5 -8
  262. package/dist/utils/Validate/additional/conditionallyRequired.js +0 -3
  263. package/dist/utils/Validate/additional/conditionallyRequired.test.js +0 -2
  264. package/dist/utils/Validate/additional/index.js +1 -22
  265. package/dist/utils/Validate/additional/index.test.js +0 -6
  266. package/dist/utils/Validate/additional/mustBeAfter.js +3 -8
  267. package/dist/utils/Validate/additional/mustBeAfter.test.js +0 -4
  268. package/dist/utils/Validate/additional/mustBeBefore.js +3 -8
  269. package/dist/utils/Validate/additional/mustBeBefore.test.js +0 -4
  270. package/dist/utils/Validate/additional/mustBeEarlierDateTime.js +5 -16
  271. package/dist/utils/Validate/additional/mustBeEarlierDateTime.test.js +4 -8
  272. package/dist/utils/Validate/additional/mustBeGreaterThan.js +0 -3
  273. package/dist/utils/Validate/additional/mustBeGreaterThan.test.js +0 -2
  274. package/dist/utils/Validate/additional/mustBeInTheFuture.js +3 -12
  275. package/dist/utils/Validate/additional/mustBeInTheFuture.test.js +0 -3
  276. package/dist/utils/Validate/additional/mustBeInThePast.js +5 -13
  277. package/dist/utils/Validate/additional/mustBeInThePast.test.js +0 -3
  278. package/dist/utils/Validate/additional/mustBeLessThan.js +0 -3
  279. package/dist/utils/Validate/additional/mustBeLessThan.test.js +0 -2
  280. package/dist/utils/Validate/additional/mustBeLongerThan.js +0 -3
  281. package/dist/utils/Validate/additional/mustBeLongerThan.test.js +0 -2
  282. package/dist/utils/Validate/additional/mustBeNumbersOnly.js +0 -3
  283. package/dist/utils/Validate/additional/mustBeNumbersOnly.test.js +0 -2
  284. package/dist/utils/Validate/additional/mustBeShorterThan.js +0 -3
  285. package/dist/utils/Validate/additional/mustBeShorterThan.test.js +0 -2
  286. package/dist/utils/Validate/additional/mustEnterAtLeastOne.js +0 -5
  287. package/dist/utils/Validate/additional/mustEnterAtLeastOne.test.js +4 -5
  288. package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.js +0 -3
  289. package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.test.js +0 -2
  290. package/dist/utils/Validate/additional/mustSelectOnlyOne.js +0 -6
  291. package/dist/utils/Validate/additional/mustSelectOnlyOne.test.js +4 -7
  292. package/dist/utils/Validate/additional/utils.js +10 -26
  293. package/dist/utils/Validate/index.js +1 -11
  294. package/dist/utils/Validate/validateCollection.js +4 -10
  295. package/dist/utils/Validate/validateCollection.test.js +4 -6
  296. package/dist/utils/Validate/validateComponent.js +5 -40
  297. package/dist/utils/Validate/validateComponent.test.js +120 -22
  298. package/dist/utils/Validate/validateContainer.js +4 -14
  299. package/dist/utils/Validate/validateContainer.test.js +4 -10
  300. package/dist/utils/Validate/validateDate.js +6 -38
  301. package/dist/utils/Validate/validateDate.test.js +0 -4
  302. package/dist/utils/Validate/validateEmail.js +1 -8
  303. package/dist/utils/Validate/validateEmail.test.js +5 -4
  304. package/dist/utils/Validate/validateMultifile.js +0 -7
  305. package/dist/utils/Validate/validateMultifile.test.js +5 -6
  306. package/dist/utils/Validate/validatePage.js +4 -16
  307. package/dist/utils/Validate/validatePage.test.js +30 -25
  308. package/dist/utils/Validate/validateRegex.js +0 -10
  309. package/dist/utils/Validate/validateRegex.test.js +5 -4
  310. package/dist/utils/Validate/validateRequired.js +0 -8
  311. package/dist/utils/Validate/validateRequired.test.js +5 -4
  312. package/dist/utils/Validate/validateTextArea.js +0 -8
  313. package/dist/utils/Validate/validateTextArea.test.js +0 -2
  314. package/dist/utils/Validate/validateTime.js +5 -22
  315. package/dist/utils/Validate/validateTime.test.js +0 -2
  316. package/dist/utils/index.js +4 -20
  317. package/package.json +2 -2
@@ -1,31 +1,18 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  var _react = require("@testing-library/react");
6
-
7
5
  var _react2 = _interopRequireDefault(require("react"));
8
-
9
6
  var _SummaryList = _interopRequireWildcard(require("./SummaryList"));
10
-
11
7
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
-
13
8
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
-
15
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
-
17
10
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
18
-
19
11
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
20
-
21
12
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
22
-
23
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
24
-
25
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
26
-
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
27
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
-
29
16
  describe('components', function () {
30
17
  describe('SummaryList', function () {
31
18
  var checkSummaryList = function checkSummaryList(container, id) {
@@ -34,21 +21,17 @@ describe('components', function () {
34
21
  expect(summaryList.classList).toContain(_SummaryList.DEFAULT_CLASS);
35
22
  return summaryList;
36
23
  };
37
-
38
24
  var checkTitleRow = function checkTitleRow(summaryList, index) {
39
25
  var row = summaryList.childNodes[index];
40
26
  expect(row.tagName).toEqual('DIV');
41
27
  expect(row.classList).toContain("".concat(_SummaryList.DEFAULT_CLASS, "__row"));
42
28
  expect(row.classList).toContain("".concat(_SummaryList.DEFAULT_CLASS, "__title"));
43
-
44
29
  var _row$childNodes = _slicedToArray(row.childNodes, 1),
45
- heading = _row$childNodes[0];
46
-
30
+ heading = _row$childNodes[0];
47
31
  expect(heading.tagName).toEqual('H3');
48
32
  expect(heading.classList).toContain('govuk-heading-s');
49
33
  return heading;
50
34
  };
51
-
52
35
  var checkActionRow = function checkActionRow(summaryList, index) {
53
36
  var row = summaryList.childNodes[index];
54
37
  expect(row.tagName).toEqual('DIV');
@@ -56,17 +39,14 @@ describe('components', function () {
56
39
  var link = row.childNodes[0];
57
40
  return link;
58
41
  };
59
-
60
42
  var checkRow = function checkRow(summaryList, index) {
61
43
  var row = summaryList.childNodes[index];
62
44
  expect(row.tagName).toEqual('DIV');
63
45
  expect(row.classList).toContain("".concat(_SummaryList.DEFAULT_CLASS, "__row"));
64
-
65
46
  var _row$childNodes2 = _slicedToArray(row.childNodes, 3),
66
- key = _row$childNodes2[0],
67
- value = _row$childNodes2[1],
68
- actions = _row$childNodes2[2];
69
-
47
+ key = _row$childNodes2[0],
48
+ value = _row$childNodes2[1],
49
+ actions = _row$childNodes2[2];
70
50
  expect(key.tagName).toEqual('DT');
71
51
  expect(key.classList).toContain("".concat(_SummaryList.DEFAULT_CLASS, "__key"));
72
52
  expect(value.tagName).toEqual('DD');
@@ -75,16 +55,13 @@ describe('components', function () {
75
55
  expect(actions.classList).toContain("".concat(_SummaryList.DEFAULT_CLASS, "__actions"));
76
56
  return [key, value, actions];
77
57
  };
78
-
79
58
  var checkRowNoChangeActions = function checkRowNoChangeActions(summaryList, index) {
80
59
  var row = summaryList.childNodes[index];
81
60
  expect(row.tagName).toEqual('DIV');
82
61
  expect(row.classList).toContain("".concat(_SummaryList.DEFAULT_CLASS, "__row"));
83
-
84
62
  var _row$childNodes3 = _slicedToArray(row.childNodes, 2),
85
- key = _row$childNodes3[0],
86
- value = _row$childNodes3[1];
87
-
63
+ key = _row$childNodes3[0],
64
+ value = _row$childNodes3[1];
88
65
  expect(key.tagName).toEqual('DT');
89
66
  expect(key.classList).toContain("".concat(_SummaryList.DEFAULT_CLASS, "__key"));
90
67
  expect(value.tagName).toEqual('DD');
@@ -92,17 +69,14 @@ describe('components', function () {
92
69
  expect(row.childNodes.length).toEqual(2);
93
70
  return [key, value];
94
71
  };
95
-
96
72
  it('should handle an empty rows array', function () {
97
73
  var ID = 'test-id';
98
74
  var ROWS = [];
99
-
100
75
  var _render = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_SummaryList.default, {
101
- "data-testid": ID,
102
- rows: ROWS
103
- })),
104
- container = _render.container;
105
-
76
+ "data-testid": ID,
77
+ rows: ROWS
78
+ })),
79
+ container = _render.container;
106
80
  var summaryList = checkSummaryList(container, ID);
107
81
  expect(summaryList.childNodes.length).toEqual(0);
108
82
  });
@@ -119,22 +93,19 @@ describe('components', function () {
119
93
  key: 'Bravo',
120
94
  value: 'Bravo value'
121
95
  }];
122
-
123
96
  var _render2 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_SummaryList.default, {
124
- "data-testid": ID,
125
- rows: ROWS
126
- })),
127
- container = _render2.container;
128
-
97
+ "data-testid": ID,
98
+ rows: ROWS
99
+ })),
100
+ container = _render2.container;
129
101
  var summaryList = checkSummaryList(container, ID);
130
102
  expect(summaryList.childNodes.length).toEqual(ROWS.length);
131
103
  ROWS.forEach(function (row, index) {
132
104
  var _checkRow = checkRow(summaryList, index),
133
- _checkRow2 = _slicedToArray(_checkRow, 3),
134
- key = _checkRow2[0],
135
- value = _checkRow2[1],
136
- actions = _checkRow2[2];
137
-
105
+ _checkRow2 = _slicedToArray(_checkRow, 3),
106
+ key = _checkRow2[0],
107
+ value = _checkRow2[1],
108
+ actions = _checkRow2[2];
138
109
  expect(key.textContent).toEqual("".concat(row.key, " (optional)"));
139
110
  expect(value.textContent).toEqual(row.value);
140
111
  expect(actions.childNodes.length).toEqual(0);
@@ -158,33 +129,27 @@ describe('components', function () {
158
129
  key: 'Bravo',
159
130
  value: 'Bravo value'
160
131
  }];
161
-
162
132
  var _render3 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_SummaryList.default, {
163
- "data-testid": ID,
164
- rows: ROWS
165
- })),
166
- container = _render3.container;
167
-
133
+ "data-testid": ID,
134
+ rows: ROWS
135
+ })),
136
+ container = _render3.container;
168
137
  var summaryList = checkSummaryList(container, ID);
169
138
  expect(summaryList.childNodes.length).toEqual(ROWS.length);
170
-
171
139
  var assessTitleRow = function assessTitleRow(row, index) {
172
140
  var heading = checkTitleRow(summaryList, index);
173
141
  expect(heading.textContent).toEqual(row.key);
174
142
  };
175
-
176
143
  var assessRow = function assessRow(row, index) {
177
144
  var _checkRow3 = checkRow(summaryList, index),
178
- _checkRow4 = _slicedToArray(_checkRow3, 3),
179
- key = _checkRow4[0],
180
- value = _checkRow4[1],
181
- actions = _checkRow4[2];
182
-
145
+ _checkRow4 = _slicedToArray(_checkRow3, 3),
146
+ key = _checkRow4[0],
147
+ value = _checkRow4[1],
148
+ actions = _checkRow4[2];
183
149
  expect(key.textContent).toEqual("".concat(row.key, " (optional)"));
184
150
  expect(value.textContent).toEqual(row.value);
185
151
  expect(actions.childNodes.length).toEqual(0);
186
152
  };
187
-
188
153
  ROWS.forEach(function (row, index) {
189
154
  if (row.type === 'title') {
190
155
  assessTitleRow(row, index);
@@ -217,21 +182,17 @@ describe('components', function () {
217
182
  label: 'Do action'
218
183
  }
219
184
  }];
220
-
221
185
  var _render4 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_SummaryList.default, {
222
- "data-testid": ID,
223
- rows: ROWS
224
- })),
225
- container = _render4.container;
226
-
186
+ "data-testid": ID,
187
+ rows: ROWS
188
+ })),
189
+ container = _render4.container;
227
190
  var summaryList = checkSummaryList(container, ID);
228
191
  expect(summaryList.childNodes.length).toEqual(ROWS.length);
229
-
230
192
  var assessActionRow = function assessActionRow(row, index) {
231
193
  var link = checkActionRow(summaryList, index);
232
194
  expect(link.textContent).toEqual(row.action.label);
233
195
  };
234
-
235
196
  ROWS.forEach(function (row, index) {
236
197
  assessActionRow(row, index);
237
198
  });
@@ -260,14 +221,12 @@ describe('components', function () {
260
221
  label: 'Do action'
261
222
  }
262
223
  }];
263
-
264
224
  var _render5 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_SummaryList.default, {
265
- "data-testid": ID,
266
- rows: ROWS,
267
- noChangeAction: true
268
- })),
269
- container = _render5.container;
270
-
225
+ "data-testid": ID,
226
+ rows: ROWS,
227
+ noChangeAction: true
228
+ })),
229
+ container = _render5.container;
271
230
  var summaryList = checkSummaryList(container, ID);
272
231
  expect(summaryList.childNodes.length).toEqual(0);
273
232
  });
@@ -285,22 +244,19 @@ describe('components', function () {
285
244
  key: 'Bravo',
286
245
  value: /*#__PURE__*/_react2.default.createElement("div", null, VALUES[1])
287
246
  }];
288
-
289
247
  var _render6 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_SummaryList.default, {
290
- "data-testid": ID,
291
- rows: ROWS
292
- })),
293
- container = _render6.container;
294
-
248
+ "data-testid": ID,
249
+ rows: ROWS
250
+ })),
251
+ container = _render6.container;
295
252
  var summaryList = checkSummaryList(container, ID);
296
253
  expect(summaryList.childNodes.length).toEqual(ROWS.length);
297
254
  ROWS.forEach(function (row, index) {
298
255
  var _checkRow5 = checkRow(summaryList, index),
299
- _checkRow6 = _slicedToArray(_checkRow5, 3),
300
- key = _checkRow6[0],
301
- value = _checkRow6[1],
302
- actions = _checkRow6[2];
303
-
256
+ _checkRow6 = _slicedToArray(_checkRow5, 3),
257
+ key = _checkRow6[0],
258
+ value = _checkRow6[1],
259
+ actions = _checkRow6[2];
304
260
  expect(key.textContent).toEqual("".concat(row.key, " (optional)"));
305
261
  expect(value.childNodes.length).toEqual(1);
306
262
  var valueDiv = value.childNodes[0];
@@ -312,11 +268,9 @@ describe('components', function () {
312
268
  it('should handle rows with actions', function () {
313
269
  var ID = 'test-id';
314
270
  var ON_ACTION_CALLS = [];
315
-
316
271
  var ON_ACTION = function ON_ACTION(row) {
317
272
  ON_ACTION_CALLS.push(row);
318
273
  };
319
-
320
274
  var ROWS = [{
321
275
  pageId: 'p1',
322
276
  fieldId: 'a',
@@ -336,29 +290,24 @@ describe('components', function () {
336
290
  onAction: ON_ACTION
337
291
  }
338
292
  }];
339
-
340
293
  var _render7 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_SummaryList.default, {
341
- "data-testid": ID,
342
- rows: ROWS
343
- })),
344
- container = _render7.container;
345
-
294
+ "data-testid": ID,
295
+ rows: ROWS
296
+ })),
297
+ container = _render7.container;
346
298
  var summaryList = checkSummaryList(container, ID);
347
299
  expect(summaryList.childNodes.length).toEqual(ROWS.length);
348
300
  ROWS.forEach(function (row, index) {
349
301
  var _checkRow7 = checkRow(summaryList, index),
350
- _checkRow8 = _slicedToArray(_checkRow7, 3),
351
- key = _checkRow8[0],
352
- value = _checkRow8[1],
353
- actions = _checkRow8[2];
354
-
302
+ _checkRow8 = _slicedToArray(_checkRow7, 3),
303
+ key = _checkRow8[0],
304
+ value = _checkRow8[1],
305
+ actions = _checkRow8[2];
355
306
  expect(key.textContent).toEqual("".concat(row.key, " (optional)"));
356
307
  expect(value.textContent).toEqual(row.value);
357
308
  var a = actions.childNodes[0];
358
309
  expect(a.textContent).toEqual(row.action.label);
359
-
360
310
  _react.fireEvent.click(a, {});
361
-
362
311
  expect(ON_ACTION_CALLS.length).toEqual(index + 1);
363
312
  expect(ON_ACTION_CALLS[index]).toEqual(row);
364
313
  });
@@ -377,22 +326,19 @@ describe('components', function () {
377
326
  key: 'Bravo',
378
327
  value: /*#__PURE__*/_react2.default.createElement("div", null, VALUES[1])
379
328
  }];
380
-
381
329
  var _render8 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_SummaryList.default, {
382
- "data-testid": ID,
383
- rows: ROWS,
384
- noChangeAction: true
385
- })),
386
- container = _render8.container;
387
-
330
+ "data-testid": ID,
331
+ rows: ROWS,
332
+ noChangeAction: true
333
+ })),
334
+ container = _render8.container;
388
335
  var summaryList = checkSummaryList(container, ID);
389
336
  expect(summaryList.childNodes.length).toEqual(ROWS.length);
390
337
  ROWS.forEach(function (row, index) {
391
338
  var _checkRowNoChangeActi = checkRowNoChangeActions(summaryList, index),
392
- _checkRowNoChangeActi2 = _slicedToArray(_checkRowNoChangeActi, 2),
393
- key = _checkRowNoChangeActi2[0],
394
- value = _checkRowNoChangeActi2[1];
395
-
339
+ _checkRowNoChangeActi2 = _slicedToArray(_checkRowNoChangeActi, 2),
340
+ key = _checkRowNoChangeActi2[0],
341
+ value = _checkRowNoChangeActi2[1];
396
342
  expect(key.textContent).toEqual("".concat(row.key, " (optional)"));
397
343
  expect(value.childNodes.length).toEqual(1);
398
344
  var valueDiv = value.childNodes[0];
@@ -420,22 +366,19 @@ describe('components', function () {
420
366
  key: 'Charlie',
421
367
  value: /*#__PURE__*/_react2.default.createElement("div", null, VALUES[2])
422
368
  }];
423
-
424
369
  var _render9 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_SummaryList.default, {
425
- "data-testid": ID,
426
- rows: ROWS,
427
- isGroup: ISGROUP
428
- })),
429
- container = _render9.container;
430
-
370
+ "data-testid": ID,
371
+ rows: ROWS,
372
+ isGroup: ISGROUP
373
+ })),
374
+ container = _render9.container;
431
375
  var summaryList = checkSummaryList(container, ID);
432
376
  expect(summaryList.childNodes.length).toEqual(ROWS.length + 1);
433
377
  ROWS.forEach(function (row, index) {
434
378
  var _checkRow9 = checkRow(summaryList, index),
435
- _checkRow10 = _slicedToArray(_checkRow9, 2),
436
- key = _checkRow10[0],
437
- value = _checkRow10[1];
438
-
379
+ _checkRow10 = _slicedToArray(_checkRow9, 2),
380
+ key = _checkRow10[0],
381
+ value = _checkRow10[1];
439
382
  expect(key.textContent).toEqual("".concat(row.key, " (optional)"));
440
383
  expect(value.childNodes.length).toEqual(1);
441
384
  var valueDiv = value.childNodes[0];
@@ -4,25 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _copReactComponents = require("@ukhomeoffice/cop-react-components");
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _react = _interopRequireDefault(require("react"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  // Global imports
12
+
17
13
  var SummaryListHeadingRow = function SummaryListHeadingRow(_ref) {
18
14
  var title = _ref.title,
19
- size = _ref.size,
20
- classes = _ref.classes;
15
+ size = _ref.size,
16
+ classes = _ref.classes;
21
17
  return /*#__PURE__*/_react.default.createElement("div", {
22
18
  className: "".concat(classes('heading'))
23
19
  }, size === 's' && /*#__PURE__*/_react.default.createElement(_copReactComponents.SmallHeading, null, title), size === 'm' && /*#__PURE__*/_react.default.createElement(_copReactComponents.MediumHeading, null, title));
24
20
  };
25
-
26
21
  SummaryListHeadingRow.propTypes = {
27
22
  title: _propTypes.default.string.isRequired,
28
23
  classes: _propTypes.default.func.isRequired
@@ -4,21 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _RowAction = _interopRequireDefault(require("./RowAction"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  // Global imports
12
+
17
13
  // Local imports
14
+
18
15
  var SummaryListRow = function SummaryListRow(_ref) {
19
16
  var row = _ref.row,
20
- classes = _ref.classes,
21
- showAction = _ref.showAction;
17
+ classes = _ref.classes,
18
+ showAction = _ref.showAction;
22
19
  return /*#__PURE__*/_react.default.createElement("div", {
23
20
  className: classes('row')
24
21
  }, /*#__PURE__*/_react.default.createElement("dt", {
@@ -31,7 +28,6 @@ var SummaryListRow = function SummaryListRow(_ref) {
31
28
  row: row
32
29
  })));
33
30
  };
34
-
35
31
  SummaryListRow.propTypes = {
36
32
  row: _propTypes.default.shape({
37
33
  key: _propTypes.default.string.isRequired,
@@ -4,24 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _copReactComponents = require("@ukhomeoffice/cop-react-components");
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _react = _interopRequireDefault(require("react"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  // Global imports
12
+
17
13
  var SummaryListTitleRow = function SummaryListTitleRow(_ref) {
18
14
  var title = _ref.title,
19
- classes = _ref.classes;
15
+ classes = _ref.classes;
20
16
  return /*#__PURE__*/_react.default.createElement("div", {
21
17
  className: "".concat(classes('row'), " ").concat(classes('title'))
22
18
  }, /*#__PURE__*/_react.default.createElement(_copReactComponents.SmallHeading, null, title));
23
19
  };
24
-
25
20
  SummaryListTitleRow.propTypes = {
26
21
  title: _propTypes.default.string.isRequired,
27
22
  classes: _propTypes.default.func.isRequired
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var getGroupActionAttributes = function getGroupActionAttributes(groupRow) {
9
8
  if (groupRow && Object.prototype.hasOwnProperty.call(groupRow, 'action')) {
10
9
  if (typeof groupRow.action.onAction === 'function') {
@@ -25,9 +24,7 @@ var getGroupActionAttributes = function getGroupActionAttributes(groupRow) {
25
24
  };
26
25
  }
27
26
  }
28
-
29
27
  return {};
30
28
  };
31
-
32
29
  var _default = getGroupActionAttributes;
33
30
  exports.default = _default;
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _getGroupActionAttributes = _interopRequireDefault(require("./getGroupActionAttributes"));
4
-
5
4
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
-
7
5
  describe('components', function () {
8
6
  describe('SummaryList', function () {
9
7
  describe('helpers', function () {
@@ -33,11 +31,9 @@ describe('components', function () {
33
31
  });
34
32
  it('should handle a row with an onAction function', function () {
35
33
  var ON_ACTION_CALLS = [];
36
-
37
34
  var ON_ACTION = function ON_ACTION(row) {
38
35
  ON_ACTION_CALLS.push(row);
39
36
  };
40
-
41
37
  var ROW = {
42
38
  action: {
43
39
  onAction: ON_ACTION
@@ -52,11 +48,9 @@ describe('components', function () {
52
48
  });
53
49
  it('should favour onAction over href', function () {
54
50
  var ON_ACTION_CALLS = [];
55
-
56
51
  var ON_ACTION = function ON_ACTION(row) {
57
52
  ON_ACTION_CALLS.push(row);
58
53
  };
59
-
60
54
  var HREF = 'http://alpha.homeoffice.gov.uk';
61
55
  var ROW = {
62
56
  action: {
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var getRowActionAttributes = function getRowActionAttributes(row) {
9
8
  if (row && row.action) {
10
9
  if (typeof row.action.onAction === 'function') {
@@ -25,9 +24,7 @@ var getRowActionAttributes = function getRowActionAttributes(row) {
25
24
  };
26
25
  }
27
26
  }
28
-
29
27
  return {};
30
28
  };
31
-
32
29
  var _default = getRowActionAttributes;
33
30
  exports.default = _default;
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _getRowActionAttributes = _interopRequireDefault(require("./getRowActionAttributes"));
4
-
5
4
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
-
7
5
  describe('components', function () {
8
6
  describe('SummaryList', function () {
9
7
  describe('helpers', function () {
@@ -33,11 +31,9 @@ describe('components', function () {
33
31
  });
34
32
  it('should handle a row with an onAction function', function () {
35
33
  var ON_ACTION_CALLS = [];
36
-
37
34
  var ON_ACTION = function ON_ACTION(row) {
38
35
  ON_ACTION_CALLS.push(row);
39
36
  };
40
-
41
37
  var ROW = {
42
38
  action: {
43
39
  onAction: ON_ACTION
@@ -52,11 +48,9 @@ describe('components', function () {
52
48
  });
53
49
  it('should favour onAction over href', function () {
54
50
  var ON_ACTION_CALLS = [];
55
-
56
51
  var ON_ACTION = function ON_ACTION(row) {
57
52
  ON_ACTION_CALLS.push(row);
58
53
  };
59
-
60
54
  var HREF = 'http://alpha.homeoffice.gov.uk';
61
55
  var ROW = {
62
56
  action: {
@@ -9,7 +9,5 @@ Object.defineProperty(exports, "getRowActionAttributes", {
9
9
  return _getRowActionAttributes.default;
10
10
  }
11
11
  });
12
-
13
12
  var _getRowActionAttributes = _interopRequireDefault(require("./getRowActionAttributes"));
14
-
15
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _SummaryList = _interopRequireDefault(require("./SummaryList"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  var _default = _SummaryList.default;
13
10
  exports.default = _default;