@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,96 +1,59 @@
1
1
  "use strict";
2
2
 
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
3
  var _axios = _interopRequireDefault(require("axios"));
6
-
7
4
  var _axiosMockAdapter = _interopRequireDefault(require("axios-mock-adapter"));
8
-
9
5
  var _react = _interopRequireDefault(require("react"));
10
-
11
6
  var _reactDom = require("react-dom");
12
-
13
7
  var _testUtils = require("react-dom/test-utils");
14
-
15
8
  var _areYouACivilServant = _interopRequireDefault(require("../../json/areYouACivilServant.json"));
16
-
17
9
  var _grade = _interopRequireDefault(require("../../json/grade.json"));
18
-
19
10
  var _team = _interopRequireDefault(require("../../json/team.json"));
20
-
21
11
  var _userProfileData = _interopRequireDefault(require("../../json/userProfile.data.json"));
22
-
23
12
  var _userProfile = _interopRequireDefault(require("../../json/userProfile.json"));
24
-
25
13
  var _groupData = _interopRequireDefault(require("../../json/group.data.json"));
26
-
27
14
  var _group = _interopRequireDefault(require("../../json/group.json"));
28
-
29
15
  var _groupOfRow = _interopRequireDefault(require("../../json/groupOfRow.json"));
30
-
31
16
  var _setupTests = require("../../setupTests");
32
-
33
17
  var _utils = _interopRequireDefault(require("../../utils"));
34
-
35
18
  var _CheckYourAnswers = _interopRequireWildcard(require("./CheckYourAnswers"));
36
-
37
19
  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); }
38
-
39
20
  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; }
40
-
41
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42
-
22
+ 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); }
43
23
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
44
-
45
24
  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."); }
46
-
47
25
  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); }
48
-
49
- 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; }
50
-
51
- 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; }
52
-
26
+ 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; }
27
+ 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; } }
53
28
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
54
-
29
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
55
30
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
56
-
57
31
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
58
-
59
32
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
60
-
61
33
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
62
-
63
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
64
-
34
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
35
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
36
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
65
37
  describe('components', function () {
66
38
  describe('CheckYourAnswers', function () {
67
39
  var mockAxios = new _axiosMockAdapter.default(_axios.default);
68
-
69
40
  var DATA = _utils.default.Data.setupForm(_userProfile.default.pages, _userProfile.default.components, _userProfileData.default);
70
-
71
41
  var PAGES = _utils.default.FormPage.getAll(_userProfile.default.pages, _userProfile.default.components, _objectSpread({}, DATA));
72
-
73
42
  var ON_ROW_ACTION_CALLS = [];
74
-
75
43
  var ON_ROW_ACTION = function ON_ROW_ACTION(row) {
76
44
  ON_ROW_ACTION_CALLS.push(row);
77
45
  };
78
-
79
46
  var ON_ACTION_CALLS = [];
80
-
81
47
  var ON_ACTION = function ON_ACTION(action, onError) {
82
48
  ON_ACTION_CALLS.push({
83
49
  action: action,
84
50
  onError: onError
85
51
  });
86
52
  };
87
-
88
53
  var container = null;
89
-
90
54
  var refDataUrl = function refDataUrl(suffix) {
91
55
  return "".concat(_userProfileData.default.urls.refData, "/").concat(suffix);
92
56
  };
93
-
94
57
  beforeEach(function () {
95
58
  ON_ROW_ACTION_CALLS.length = 0;
96
59
  ON_ACTION_CALLS.length = 0;
@@ -106,573 +69,483 @@ describe('components', function () {
106
69
  container.remove();
107
70
  container = null;
108
71
  });
109
-
110
72
  var checkCYA = function checkCYA(container) {
111
73
  var cya = container.childNodes[0];
112
74
  expect(cya.tagName).toEqual('DIV');
113
75
  expect(cya.classList).toContain(_CheckYourAnswers.DEFAULT_CLASS);
114
76
  return cya;
115
77
  };
116
-
117
78
  var checkRow = function checkRow(row, key, value, action) {
118
79
  expect(row.textContent).toContain(key);
119
80
  expect(row.textContent).toContain(value);
120
-
121
81
  if (action) {
122
82
  expect(row.textContent).toContain('Change');
123
83
  } else {
124
84
  expect(row.textContent).not.toContain('Change');
125
85
  }
126
86
  };
127
-
128
- it('should show default title if none is provided', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
87
+ it('should show default title if none is provided', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
129
88
  var cya, title;
130
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
131
- while (1) {
132
- switch (_context2.prev = _context2.next) {
133
- case 0:
134
- _context2.next = 2;
135
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
136
- return regeneratorRuntime.wrap(function _callee$(_context) {
137
- while (1) {
138
- switch (_context.prev = _context.next) {
139
- case 0:
140
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
141
- pages: PAGES,
142
- onRowAction: ON_ROW_ACTION,
143
- onAction: ON_ACTION
144
- }), container);
145
-
146
- case 1:
147
- case "end":
148
- return _context.stop();
149
- }
150
- }
151
- }, _callee);
152
- })));
153
-
154
- case 2:
155
- cya = checkCYA(container);
156
- title = cya.childNodes[0];
157
- expect(title.classList).toContain('govuk-heading-l');
158
- expect(title.textContent).toEqual(_CheckYourAnswers.DEFAULT_TITLE);
159
-
160
- case 6:
161
- case "end":
162
- return _context2.stop();
163
- }
89
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
90
+ while (1) switch (_context2.prev = _context2.next) {
91
+ case 0:
92
+ _context2.next = 2;
93
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
94
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
95
+ while (1) switch (_context.prev = _context.next) {
96
+ case 0:
97
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
98
+ pages: PAGES,
99
+ onRowAction: ON_ROW_ACTION,
100
+ onAction: ON_ACTION
101
+ }), container);
102
+ case 1:
103
+ case "end":
104
+ return _context.stop();
105
+ }
106
+ }, _callee);
107
+ })));
108
+ case 2:
109
+ cya = checkCYA(container);
110
+ title = cya.childNodes[0];
111
+ expect(title.classList).toContain('govuk-heading-l');
112
+ expect(title.textContent).toEqual(_CheckYourAnswers.DEFAULT_TITLE);
113
+ case 6:
114
+ case "end":
115
+ return _context2.stop();
164
116
  }
165
117
  }, _callee2);
166
118
  })));
167
- it('should allow title to be overridden', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
119
+ it('should allow title to be overridden', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
168
120
  var TITLE, cya, title;
169
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
170
- while (1) {
171
- switch (_context4.prev = _context4.next) {
172
- case 0:
173
- TITLE = 'Alpha Bravo Charlie';
174
- _context4.next = 3;
175
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
176
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
177
- while (1) {
178
- switch (_context3.prev = _context3.next) {
179
- case 0:
180
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
181
- title: TITLE,
182
- pages: PAGES,
183
- onRowAction: ON_ROW_ACTION,
184
- onAction: ON_ACTION
185
- }), container);
186
-
187
- case 1:
188
- case "end":
189
- return _context3.stop();
190
- }
191
- }
192
- }, _callee3);
193
- })));
194
-
195
- case 3:
196
- cya = checkCYA(container);
197
- title = cya.childNodes[0];
198
- expect(title.classList).toContain('govuk-heading-l');
199
- expect(title.textContent).toEqual(TITLE);
200
-
201
- case 7:
202
- case "end":
203
- return _context4.stop();
204
- }
121
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
122
+ while (1) switch (_context4.prev = _context4.next) {
123
+ case 0:
124
+ TITLE = 'Alpha Bravo Charlie';
125
+ _context4.next = 3;
126
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
127
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
128
+ while (1) switch (_context3.prev = _context3.next) {
129
+ case 0:
130
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
131
+ title: TITLE,
132
+ pages: PAGES,
133
+ onRowAction: ON_ROW_ACTION,
134
+ onAction: ON_ACTION
135
+ }), container);
136
+ case 1:
137
+ case "end":
138
+ return _context3.stop();
139
+ }
140
+ }, _callee3);
141
+ })));
142
+ case 3:
143
+ cya = checkCYA(container);
144
+ title = cya.childNodes[0];
145
+ expect(title.classList).toContain('govuk-heading-l');
146
+ expect(title.textContent).toEqual(TITLE);
147
+ case 7:
148
+ case "end":
149
+ return _context4.stop();
205
150
  }
206
151
  }, _callee4);
207
152
  })));
208
- it('should show readonly page components correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
153
+ it('should show readonly page components correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
209
154
  var cya, _cya$childNodes, cyaChildNode, names, _names$childNodes, firstName, surname;
210
-
211
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
212
- while (1) {
213
- switch (_context6.prev = _context6.next) {
214
- case 0:
215
- _context6.next = 2;
216
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
217
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
218
- while (1) {
219
- switch (_context5.prev = _context5.next) {
220
- case 0:
221
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
222
- pages: PAGES,
223
- onRowAction: ON_ROW_ACTION,
224
- onAction: ON_ACTION
225
- }), container);
226
-
227
- case 1:
228
- case "end":
229
- return _context5.stop();
230
- }
231
- }
232
- }, _callee5);
233
- })));
234
-
235
- case 2:
236
- cya = checkCYA(container);
237
- _cya$childNodes = _slicedToArray(cya.childNodes, 2), cyaChildNode = _cya$childNodes[1];
238
- names = cyaChildNode.childNodes[0];
239
- expect(names.tagName).toEqual('DL');
240
- expect(names.classList).toContain("govuk-!-margin-bottom-".concat(_CheckYourAnswers.DEFAULT_MARGIN_BOTTOM));
241
- _names$childNodes = _slicedToArray(names.childNodes, 2), firstName = _names$childNodes[0], surname = _names$childNodes[1];
242
- checkRow(firstName, 'First name', 'John', false);
243
- checkRow(surname, 'Last name', 'Smith', false);
244
-
245
- case 10:
246
- case "end":
247
- return _context6.stop();
248
- }
155
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
156
+ while (1) switch (_context6.prev = _context6.next) {
157
+ case 0:
158
+ _context6.next = 2;
159
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
160
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
161
+ while (1) switch (_context5.prev = _context5.next) {
162
+ case 0:
163
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
164
+ pages: PAGES,
165
+ onRowAction: ON_ROW_ACTION,
166
+ onAction: ON_ACTION
167
+ }), container);
168
+ case 1:
169
+ case "end":
170
+ return _context5.stop();
171
+ }
172
+ }, _callee5);
173
+ })));
174
+ case 2:
175
+ cya = checkCYA(container);
176
+ _cya$childNodes = _slicedToArray(cya.childNodes, 2), cyaChildNode = _cya$childNodes[1];
177
+ names = cyaChildNode.childNodes[0];
178
+ expect(names.tagName).toEqual('DL');
179
+ expect(names.classList).toContain("govuk-!-margin-bottom-".concat(_CheckYourAnswers.DEFAULT_MARGIN_BOTTOM));
180
+ _names$childNodes = _slicedToArray(names.childNodes, 2), firstName = _names$childNodes[0], surname = _names$childNodes[1];
181
+ checkRow(firstName, 'First name', 'John', false);
182
+ checkRow(surname, 'Last name', 'Smith', false);
183
+ case 10:
184
+ case "end":
185
+ return _context6.stop();
249
186
  }
250
187
  }, _callee6);
251
188
  })));
252
- it('should show editable page components correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
189
+ it('should show editable page components correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
253
190
  var cya, _cya$childNodes2, title, cyaChildNode, civilServant, _civilServant$childNo, status;
254
-
255
- return regeneratorRuntime.wrap(function _callee8$(_context8) {
256
- while (1) {
257
- switch (_context8.prev = _context8.next) {
258
- case 0:
259
- _context8.next = 2;
260
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
261
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
262
- while (1) {
263
- switch (_context7.prev = _context7.next) {
264
- case 0:
265
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
266
- pages: PAGES,
267
- onRowAction: ON_ROW_ACTION,
268
- onAction: ON_ACTION
269
- }), container);
270
-
271
- case 1:
272
- case "end":
273
- return _context7.stop();
274
- }
275
- }
276
- }, _callee7);
277
- })));
278
-
279
- case 2:
280
- cya = checkCYA(container);
281
- _cya$childNodes2 = _slicedToArray(cya.childNodes, 4), title = _cya$childNodes2[2], cyaChildNode = _cya$childNodes2[3];
282
- civilServant = cyaChildNode.childNodes[0];
283
- expect(title.textContent).toEqual('Are you a civil servant?');
284
- expect(civilServant.tagName).toEqual('DL');
285
- expect(civilServant.classList).toContain("govuk-!-margin-bottom-".concat(_CheckYourAnswers.DEFAULT_MARGIN_BOTTOM));
286
- _civilServant$childNo = _slicedToArray(civilServant.childNodes, 1), status = _civilServant$childNo[0];
287
- checkRow(status, 'Are you a civil servant?', 'Yes', true);
288
-
289
- case 10:
290
- case "end":
291
- return _context8.stop();
292
- }
191
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
192
+ while (1) switch (_context8.prev = _context8.next) {
193
+ case 0:
194
+ _context8.next = 2;
195
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
196
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
197
+ while (1) switch (_context7.prev = _context7.next) {
198
+ case 0:
199
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
200
+ pages: PAGES,
201
+ onRowAction: ON_ROW_ACTION,
202
+ onAction: ON_ACTION
203
+ }), container);
204
+ case 1:
205
+ case "end":
206
+ return _context7.stop();
207
+ }
208
+ }, _callee7);
209
+ })));
210
+ case 2:
211
+ cya = checkCYA(container);
212
+ _cya$childNodes2 = _slicedToArray(cya.childNodes, 4), title = _cya$childNodes2[2], cyaChildNode = _cya$childNodes2[3];
213
+ civilServant = cyaChildNode.childNodes[0];
214
+ expect(title.textContent).toEqual('Are you a civil servant?');
215
+ expect(civilServant.tagName).toEqual('DL');
216
+ expect(civilServant.classList).toContain("govuk-!-margin-bottom-".concat(_CheckYourAnswers.DEFAULT_MARGIN_BOTTOM));
217
+ _civilServant$childNo = _slicedToArray(civilServant.childNodes, 1), status = _civilServant$childNo[0];
218
+ checkRow(status, 'Are you a civil servant?', 'Yes', true);
219
+ case 10:
220
+ case "end":
221
+ return _context8.stop();
293
222
  }
294
223
  }, _callee8);
295
224
  })));
296
- it('should show editable page components correctly with page titles hidden', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
225
+ it('should show editable page components correctly with page titles hidden', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
297
226
  var cya, _cya$childNodes3, cyaChildNode, civilServant, _civilServant$childNo2, status;
298
-
299
- return regeneratorRuntime.wrap(function _callee10$(_context10) {
300
- while (1) {
301
- switch (_context10.prev = _context10.next) {
302
- case 0:
303
- _context10.next = 2;
304
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
305
- return regeneratorRuntime.wrap(function _callee9$(_context9) {
306
- while (1) {
307
- switch (_context9.prev = _context9.next) {
308
- case 0:
309
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
310
- pages: PAGES,
311
- onRowAction: ON_ROW_ACTION,
312
- onAction: ON_ACTION,
313
- hide_page_titles: true
314
- }), container);
315
-
316
- case 1:
317
- case "end":
318
- return _context9.stop();
319
- }
320
- }
321
- }, _callee9);
322
- })));
323
-
324
- case 2:
325
- cya = checkCYA(container);
326
- _cya$childNodes3 = _slicedToArray(cya.childNodes, 3), cyaChildNode = _cya$childNodes3[2]; // The title simply isn't returned
327
-
328
- civilServant = cyaChildNode.childNodes[0];
329
- expect(civilServant.tagName).toEqual('DL');
330
- expect(civilServant.classList).toContain("govuk-!-margin-bottom-0"); // Changed margin if no titles
331
-
332
- _civilServant$childNo2 = _slicedToArray(civilServant.childNodes, 1), status = _civilServant$childNo2[0];
333
- checkRow(status, 'Are you a civil servant?', 'Yes', true);
334
-
335
- case 9:
336
- case "end":
337
- return _context10.stop();
338
- }
227
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
228
+ while (1) switch (_context10.prev = _context10.next) {
229
+ case 0:
230
+ _context10.next = 2;
231
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
232
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
233
+ while (1) switch (_context9.prev = _context9.next) {
234
+ case 0:
235
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
236
+ pages: PAGES,
237
+ onRowAction: ON_ROW_ACTION,
238
+ onAction: ON_ACTION,
239
+ hide_page_titles: true
240
+ }), container);
241
+ case 1:
242
+ case "end":
243
+ return _context9.stop();
244
+ }
245
+ }, _callee9);
246
+ })));
247
+ case 2:
248
+ cya = checkCYA(container);
249
+ _cya$childNodes3 = _slicedToArray(cya.childNodes, 3), cyaChildNode = _cya$childNodes3[2]; // The title simply isn't returned
250
+ civilServant = cyaChildNode.childNodes[0];
251
+ expect(civilServant.tagName).toEqual('DL');
252
+ expect(civilServant.classList).toContain("govuk-!-margin-bottom-0"); // Changed margin if no titles
253
+ _civilServant$childNo2 = _slicedToArray(civilServant.childNodes, 1), status = _civilServant$childNo2[0];
254
+ checkRow(status, 'Are you a civil servant?', 'Yes', true);
255
+ case 9:
256
+ case "end":
257
+ return _context10.stop();
339
258
  }
340
259
  }, _callee10);
341
260
  })));
342
- it('should show no title if is set to hidden', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
261
+ it('should show no title if is set to hidden', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
343
262
  var cya, _cya$childNodes4, cyaChildNode, names, _names$childNodes2, firstName, surname;
344
-
345
- return regeneratorRuntime.wrap(function _callee12$(_context12) {
346
- while (1) {
347
- switch (_context12.prev = _context12.next) {
348
- case 0:
349
- _context12.next = 2;
350
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
351
- return regeneratorRuntime.wrap(function _callee11$(_context11) {
352
- while (1) {
353
- switch (_context11.prev = _context11.next) {
354
- case 0:
355
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
356
- pages: PAGES,
357
- onRowAction: ON_ROW_ACTION,
358
- onAction: ON_ACTION,
359
- hide_title: true
360
- }), container);
361
-
362
- case 1:
363
- case "end":
364
- return _context11.stop();
365
- }
366
- }
367
- }, _callee11);
368
- })));
369
-
370
- case 2:
371
- cya = checkCYA(container);
372
- _cya$childNodes4 = _slicedToArray(cya.childNodes, 1), cyaChildNode = _cya$childNodes4[0];
373
- names = cyaChildNode.childNodes[0];
374
- expect(names.tagName).toEqual('DL');
375
- expect(names.classList).toContain("govuk-!-margin-bottom-".concat(_CheckYourAnswers.DEFAULT_MARGIN_BOTTOM));
376
- _names$childNodes2 = _slicedToArray(names.childNodes, 2), firstName = _names$childNodes2[0], surname = _names$childNodes2[1];
377
- checkRow(firstName, 'First name', 'John', false);
378
- checkRow(surname, 'Last name', 'Smith', false);
379
-
380
- case 10:
381
- case "end":
382
- return _context12.stop();
383
- }
263
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
264
+ while (1) switch (_context12.prev = _context12.next) {
265
+ case 0:
266
+ _context12.next = 2;
267
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
268
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
269
+ while (1) switch (_context11.prev = _context11.next) {
270
+ case 0:
271
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
272
+ pages: PAGES,
273
+ onRowAction: ON_ROW_ACTION,
274
+ onAction: ON_ACTION,
275
+ hide_title: true
276
+ }), container);
277
+ case 1:
278
+ case "end":
279
+ return _context11.stop();
280
+ }
281
+ }, _callee11);
282
+ })));
283
+ case 2:
284
+ cya = checkCYA(container);
285
+ _cya$childNodes4 = _slicedToArray(cya.childNodes, 1), cyaChildNode = _cya$childNodes4[0];
286
+ names = cyaChildNode.childNodes[0];
287
+ expect(names.tagName).toEqual('DL');
288
+ expect(names.classList).toContain("govuk-!-margin-bottom-".concat(_CheckYourAnswers.DEFAULT_MARGIN_BOTTOM));
289
+ _names$childNodes2 = _slicedToArray(names.childNodes, 2), firstName = _names$childNodes2[0], surname = _names$childNodes2[1];
290
+ checkRow(firstName, 'First name', 'John', false);
291
+ checkRow(surname, 'Last name', 'Smith', false);
292
+ case 10:
293
+ case "end":
294
+ return _context12.stop();
384
295
  }
385
296
  }, _callee12);
386
297
  })));
387
- it('should show task list in CYA style', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
298
+ it('should show task list in CYA style', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
388
299
  var sections, taskHeading1, namesPageHeading, taskHeading2, gradePageHeading;
389
- return regeneratorRuntime.wrap(function _callee14$(_context14) {
390
- while (1) {
391
- switch (_context14.prev = _context14.next) {
392
- case 0:
393
- sections = [{
394
- name: 'These are your tasks',
395
- tasks: [{
396
- name: 'Task 1',
397
- state: 'complete',
398
- pages: ['names']
399
- }, {
400
- name: 'Task 2',
401
- state: 'complete',
402
- pages: ['grade']
403
- }]
404
- }];
405
- _context14.next = 3;
406
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
407
- return regeneratorRuntime.wrap(function _callee13$(_context13) {
408
- while (1) {
409
- switch (_context13.prev = _context13.next) {
410
- case 0:
411
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
412
- pages: PAGES,
413
- onRowAction: ON_ROW_ACTION,
414
- onAction: ON_ACTION,
415
- hide_title: true,
416
- sections: sections,
417
- type: "task-list-cya"
418
- }), container);
419
-
420
- case 1:
421
- case "end":
422
- return _context13.stop();
423
- }
424
- }
425
- }, _callee13);
426
- })));
427
-
428
- case 3:
429
- taskHeading1 = container.childNodes[0].childNodes[0];
430
- expect(taskHeading1.tagName).toEqual('H3');
431
- expect(taskHeading1.textContent).toEqual('Task 1');
432
- expect(taskHeading1.classList).toContain("govuk-!-margin-top-8");
433
- expect(taskHeading1.classList).toContain("govuk-!-margin-bottom-0");
434
- namesPageHeading = container.childNodes[0].childNodes[1];
435
- expect(namesPageHeading.tagName).toEqual('DIV');
436
- expect(namesPageHeading.textContent).toContain('John');
437
- expect(namesPageHeading.classList).toContain("group-of-rows");
438
- taskHeading2 = container.childNodes[0].childNodes[2];
439
- expect(taskHeading2.tagName).toEqual('H3');
440
- expect(taskHeading2.textContent).toEqual('Task 2');
441
- expect(taskHeading2.classList).toContain("govuk-!-margin-top-8");
442
- expect(taskHeading2.classList).toContain("govuk-!-margin-bottom-0");
443
- gradePageHeading = container.childNodes[0].childNodes[3];
444
- expect(gradePageHeading.tagName).toEqual('H4');
445
- expect(gradePageHeading.textContent).toEqual("What's your grade?");
446
- expect(gradePageHeading.classList).toContain("govuk-!-margin-top-6");
447
- expect(gradePageHeading.classList).toContain("govuk-!-margin-bottom-5");
448
-
449
- case 22:
450
- case "end":
451
- return _context14.stop();
452
- }
300
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
301
+ while (1) switch (_context14.prev = _context14.next) {
302
+ case 0:
303
+ sections = [{
304
+ name: 'These are your tasks',
305
+ tasks: [{
306
+ name: 'Task 1',
307
+ state: 'complete',
308
+ pages: ['names']
309
+ }, {
310
+ name: 'Task 2',
311
+ state: 'complete',
312
+ pages: ['grade']
313
+ }]
314
+ }];
315
+ _context14.next = 3;
316
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
317
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
318
+ while (1) switch (_context13.prev = _context13.next) {
319
+ case 0:
320
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
321
+ pages: PAGES,
322
+ onRowAction: ON_ROW_ACTION,
323
+ onAction: ON_ACTION,
324
+ hide_title: true,
325
+ sections: sections,
326
+ type: "task-list-cya"
327
+ }), container);
328
+ case 1:
329
+ case "end":
330
+ return _context13.stop();
331
+ }
332
+ }, _callee13);
333
+ })));
334
+ case 3:
335
+ taskHeading1 = container.childNodes[0].childNodes[0];
336
+ expect(taskHeading1.tagName).toEqual('H3');
337
+ expect(taskHeading1.textContent).toEqual('Task 1');
338
+ expect(taskHeading1.classList).toContain("govuk-!-margin-top-8");
339
+ expect(taskHeading1.classList).toContain("govuk-!-margin-bottom-0");
340
+ namesPageHeading = container.childNodes[0].childNodes[1];
341
+ expect(namesPageHeading.tagName).toEqual('DIV');
342
+ expect(namesPageHeading.textContent).toContain('John');
343
+ expect(namesPageHeading.classList).toContain("group-of-rows");
344
+ taskHeading2 = container.childNodes[0].childNodes[2];
345
+ expect(taskHeading2.tagName).toEqual('H3');
346
+ expect(taskHeading2.textContent).toEqual('Task 2');
347
+ expect(taskHeading2.classList).toContain("govuk-!-margin-top-8");
348
+ expect(taskHeading2.classList).toContain("govuk-!-margin-bottom-0");
349
+ gradePageHeading = container.childNodes[0].childNodes[3];
350
+ expect(gradePageHeading.tagName).toEqual('H4');
351
+ expect(gradePageHeading.textContent).toEqual("What's your grade?");
352
+ expect(gradePageHeading.classList).toContain("govuk-!-margin-top-6");
353
+ expect(gradePageHeading.classList).toContain("govuk-!-margin-bottom-5");
354
+ case 22:
355
+ case "end":
356
+ return _context14.stop();
453
357
  }
454
358
  }, _callee14);
455
359
  })));
456
- it('Show answers from multiple address fields into in one DL', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() {
360
+ it('Show answers from multiple address fields into in one DL', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
457
361
  var DATA, GROUP_PAGES, cya, groupedComponent, keyGroup, valueGroup, changeButtonDiv, changeButton;
458
- return regeneratorRuntime.wrap(function _callee16$(_context16) {
459
- while (1) {
460
- switch (_context16.prev = _context16.next) {
461
- case 0:
462
- DATA = _utils.default.Data.setupForm(_group.default.pages, _group.default.components, _groupData.default);
463
- GROUP_PAGES = _utils.default.FormPage.getAll(_group.default.pages, _group.default.components, _objectSpread({}, DATA));
464
- _context16.next = 4;
465
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15() {
466
- return regeneratorRuntime.wrap(function _callee15$(_context15) {
467
- while (1) {
468
- switch (_context15.prev = _context15.next) {
469
- case 0:
470
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
471
- pages: GROUP_PAGES,
472
- onRowAction: ON_ROW_ACTION,
473
- onAction: ON_ACTION,
474
- hide_title: true
475
- }), container);
476
-
477
- case 1:
478
- case "end":
479
- return _context15.stop();
480
- }
481
- }
482
- }, _callee15);
483
- })));
484
-
485
- case 4:
486
- cya = checkCYA(container);
487
- groupedComponent = cya.childNodes[10];
488
- keyGroup = groupedComponent.childNodes[0].childNodes[0].childNodes[0];
489
- expect(keyGroup.tagName).toEqual('DT');
490
- expect(keyGroup.textContent).toEqual('Address details');
491
- valueGroup = groupedComponent.childNodes[0].childNodes[0].childNodes[1];
492
- expect(valueGroup.childNodes.length).toEqual(4);
493
- expect(valueGroup.tagName).toEqual('DD');
494
- expect(valueGroup.childNodes[0].textContent).toContain('10 Downing Street');
495
- expect(valueGroup.childNodes[1].textContent).toContain('City of Westminster');
496
- expect(valueGroup.childNodes[2].textContent).toContain('London');
497
- expect(valueGroup.childNodes[3].textContent).toContain('SW1A 2AA');
498
- changeButtonDiv = groupedComponent.childNodes[0].childNodes[0].childNodes[2];
499
- expect(changeButtonDiv.classList).toContain('govuk-summary-list__actions');
500
- changeButton = changeButtonDiv.childNodes[0];
501
- expect(changeButton.tagName).toEqual('A');
502
- expect(changeButton.textContent).toEqual('Change address details');
503
-
504
- case 21:
505
- case "end":
506
- return _context16.stop();
507
- }
362
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
363
+ while (1) switch (_context16.prev = _context16.next) {
364
+ case 0:
365
+ DATA = _utils.default.Data.setupForm(_group.default.pages, _group.default.components, _groupData.default);
366
+ GROUP_PAGES = _utils.default.FormPage.getAll(_group.default.pages, _group.default.components, _objectSpread({}, DATA));
367
+ _context16.next = 4;
368
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
369
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
370
+ while (1) switch (_context15.prev = _context15.next) {
371
+ case 0:
372
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
373
+ pages: GROUP_PAGES,
374
+ onRowAction: ON_ROW_ACTION,
375
+ onAction: ON_ACTION,
376
+ hide_title: true
377
+ }), container);
378
+ case 1:
379
+ case "end":
380
+ return _context15.stop();
381
+ }
382
+ }, _callee15);
383
+ })));
384
+ case 4:
385
+ cya = checkCYA(container);
386
+ groupedComponent = cya.childNodes[10];
387
+ keyGroup = groupedComponent.childNodes[0].childNodes[0].childNodes[0];
388
+ expect(keyGroup.tagName).toEqual('DT');
389
+ expect(keyGroup.textContent).toEqual('Address details');
390
+ valueGroup = groupedComponent.childNodes[0].childNodes[0].childNodes[1];
391
+ expect(valueGroup.childNodes.length).toEqual(4);
392
+ expect(valueGroup.tagName).toEqual('DD');
393
+ expect(valueGroup.childNodes[0].textContent).toContain('10 Downing Street');
394
+ expect(valueGroup.childNodes[1].textContent).toContain('City of Westminster');
395
+ expect(valueGroup.childNodes[2].textContent).toContain('London');
396
+ expect(valueGroup.childNodes[3].textContent).toContain('SW1A 2AA');
397
+ changeButtonDiv = groupedComponent.childNodes[0].childNodes[0].childNodes[2];
398
+ expect(changeButtonDiv.classList).toContain('govuk-summary-list__actions');
399
+ changeButton = changeButtonDiv.childNodes[0];
400
+ expect(changeButton.tagName).toEqual('A');
401
+ expect(changeButton.textContent).toEqual('Change address details');
402
+ case 21:
403
+ case "end":
404
+ return _context16.stop();
508
405
  }
509
406
  }, _callee16);
510
407
  })));
511
- it('should render a group with one action button', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18() {
408
+ it('should render a group with one action button', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
512
409
  var GROUP_PAGES, cya, namesGroup, firstNameRow, surname, changeButtonDiv, changeButton;
513
- return regeneratorRuntime.wrap(function _callee18$(_context18) {
514
- while (1) {
515
- switch (_context18.prev = _context18.next) {
516
- case 0:
517
- GROUP_PAGES = _utils.default.FormPage.getAll(_groupOfRow.default.pages, _groupOfRow.default.components, _objectSpread({}, DATA));
518
- _context18.next = 3;
519
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() {
520
- return regeneratorRuntime.wrap(function _callee17$(_context17) {
521
- while (1) {
522
- switch (_context17.prev = _context17.next) {
523
- case 0:
524
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
525
- pages: GROUP_PAGES,
526
- onRowAction: ON_ROW_ACTION,
527
- onAction: ON_ACTION,
528
- groups: _groupOfRow.default.cya.groups
529
- }), container);
530
-
531
- case 1:
532
- case "end":
533
- return _context17.stop();
534
- }
535
- }
536
- }, _callee17);
537
- })));
538
-
539
- case 3:
540
- cya = checkCYA(container);
541
- namesGroup = cya.childNodes[2];
542
- firstNameRow = namesGroup.childNodes[0].childNodes[0];
543
- expect(firstNameRow.childNodes.length).toEqual(2);
544
- expect(firstNameRow.childNodes[0].textContent).toEqual('First name (optional)');
545
- expect(firstNameRow.childNodes[0].tagName).toEqual('DT');
546
- expect(firstNameRow.childNodes[1].textContent).toEqual('John');
547
- expect(firstNameRow.childNodes[1].tagName).toEqual('DD');
548
- surname = namesGroup.childNodes[0].childNodes[1];
549
- expect(surname.childNodes.length).toEqual(2);
550
- expect(surname.childNodes[0].textContent).toEqual('Last name (optional)');
551
- expect(surname.childNodes[0].tagName).toEqual('DT');
552
- expect(surname.childNodes[1].textContent).toEqual('Smith');
553
- expect(surname.childNodes[1].tagName).toEqual('DD');
554
- changeButtonDiv = namesGroup.childNodes[0].childNodes[2];
555
- expect(changeButtonDiv.classList).toContain('change-group-button');
556
- changeButton = changeButtonDiv.childNodes[0];
557
- expect(changeButton.tagName).toEqual('A');
558
- expect(changeButton.textContent).toEqual('Change names');
559
-
560
- case 22:
561
- case "end":
562
- return _context18.stop();
563
- }
410
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
411
+ while (1) switch (_context18.prev = _context18.next) {
412
+ case 0:
413
+ GROUP_PAGES = _utils.default.FormPage.getAll(_groupOfRow.default.pages, _groupOfRow.default.components, _objectSpread({}, DATA));
414
+ _context18.next = 3;
415
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
416
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
417
+ while (1) switch (_context17.prev = _context17.next) {
418
+ case 0:
419
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
420
+ pages: GROUP_PAGES,
421
+ onRowAction: ON_ROW_ACTION,
422
+ onAction: ON_ACTION,
423
+ groups: _groupOfRow.default.cya.groups
424
+ }), container);
425
+ case 1:
426
+ case "end":
427
+ return _context17.stop();
428
+ }
429
+ }, _callee17);
430
+ })));
431
+ case 3:
432
+ cya = checkCYA(container);
433
+ namesGroup = cya.childNodes[2];
434
+ firstNameRow = namesGroup.childNodes[0].childNodes[0];
435
+ expect(firstNameRow.childNodes.length).toEqual(2);
436
+ expect(firstNameRow.childNodes[0].textContent).toEqual('First name (optional)');
437
+ expect(firstNameRow.childNodes[0].tagName).toEqual('DT');
438
+ expect(firstNameRow.childNodes[1].textContent).toEqual('John');
439
+ expect(firstNameRow.childNodes[1].tagName).toEqual('DD');
440
+ surname = namesGroup.childNodes[0].childNodes[1];
441
+ expect(surname.childNodes.length).toEqual(2);
442
+ expect(surname.childNodes[0].textContent).toEqual('Last name (optional)');
443
+ expect(surname.childNodes[0].tagName).toEqual('DT');
444
+ expect(surname.childNodes[1].textContent).toEqual('Smith');
445
+ expect(surname.childNodes[1].tagName).toEqual('DD');
446
+ changeButtonDiv = namesGroup.childNodes[0].childNodes[2];
447
+ expect(changeButtonDiv.classList).toContain('change-group-button');
448
+ changeButton = changeButtonDiv.childNodes[0];
449
+ expect(changeButton.tagName).toEqual('A');
450
+ expect(changeButton.textContent).toEqual('Change names');
451
+ case 22:
452
+ case "end":
453
+ return _context18.stop();
564
454
  }
565
455
  }, _callee18);
566
456
  })));
567
- it('should show page components corrently with interpolated title and cya_label, if label is missing', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20() {
457
+ it('should show page components corrently with interpolated title and cya_label, if label is missing', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
568
458
  var _PAGES, _COMPONENTS, T_PAGES, cya, _cya$childNodes5, cyaTitle, cyaChildNode, names, _names$childNodes3, firstName, surname, _firstName$childNodes, label;
569
-
570
- return regeneratorRuntime.wrap(function _callee20$(_context20) {
571
- while (1) {
572
- switch (_context20.prev = _context20.next) {
573
- case 0:
574
- _PAGES = [].concat(_userProfile.default.pages); // eslint-disable-next-line no-template-curly-in-string
575
-
576
- _PAGES[0] = _objectSpread(_objectSpread({}, _PAGES[0]), {}, {
577
- title: 'Alpha ID: ${businessKey}'
578
- });
579
- _COMPONENTS = [].concat(_userProfile.default.components);
580
- _COMPONENTS[0] = _objectSpread(_objectSpread({}, _COMPONENTS[0]), {}, {
581
- label: undefined,
582
- required: true,
583
- // eslint-disable-next-line no-template-curly-in-string
584
- cya_label: "Text ${currentUser.familyName}"
585
- });
586
- T_PAGES = _utils.default.FormPage.getAll(_PAGES, _COMPONENTS, DATA);
587
- _context20.next = 7;
588
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee19() {
589
- return regeneratorRuntime.wrap(function _callee19$(_context19) {
590
- while (1) {
591
- switch (_context19.prev = _context19.next) {
592
- case 0:
593
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
594
- pages: T_PAGES,
595
- onRowAction: ON_ROW_ACTION,
596
- onAction: ON_ACTION
597
- }), container);
598
-
599
- case 1:
600
- case "end":
601
- return _context19.stop();
602
- }
603
- }
604
- }, _callee19);
605
- })));
606
-
607
- case 7:
608
- cya = checkCYA(container);
609
- _cya$childNodes5 = _slicedToArray(cya.childNodes, 3), cyaTitle = _cya$childNodes5[1], cyaChildNode = _cya$childNodes5[2];
610
- expect(cyaTitle.textContent).toEqual('Alpha ID: 123456789');
611
- names = cyaChildNode.childNodes[0];
612
- expect(names.tagName).toEqual('DL');
613
- expect(names.classList).toContain("govuk-!-margin-bottom-".concat(_CheckYourAnswers.DEFAULT_MARGIN_BOTTOM));
614
- _names$childNodes3 = _slicedToArray(names.childNodes, 2), firstName = _names$childNodes3[0], surname = _names$childNodes3[1];
615
- _firstName$childNodes = _slicedToArray(firstName.childNodes, 1), label = _firstName$childNodes[0];
616
- expect(label.textContent).toEqual('Text Smith');
617
- checkRow(surname, 'Last name', 'Smith', false);
618
-
619
- case 17:
620
- case "end":
621
- return _context20.stop();
622
- }
459
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
460
+ while (1) switch (_context20.prev = _context20.next) {
461
+ case 0:
462
+ _PAGES = [].concat(_userProfile.default.pages); // eslint-disable-next-line no-template-curly-in-string
463
+ _PAGES[0] = _objectSpread(_objectSpread({}, _PAGES[0]), {}, {
464
+ title: 'Alpha ID: ${businessKey}'
465
+ });
466
+ _COMPONENTS = [].concat(_userProfile.default.components);
467
+ _COMPONENTS[0] = _objectSpread(_objectSpread({}, _COMPONENTS[0]), {}, {
468
+ label: undefined,
469
+ required: true,
470
+ // eslint-disable-next-line no-template-curly-in-string
471
+ cya_label: "Text ${currentUser.familyName}"
472
+ });
473
+ T_PAGES = _utils.default.FormPage.getAll(_PAGES, _COMPONENTS, DATA);
474
+ _context20.next = 7;
475
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
476
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
477
+ while (1) switch (_context19.prev = _context19.next) {
478
+ case 0:
479
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
480
+ pages: T_PAGES,
481
+ onRowAction: ON_ROW_ACTION,
482
+ onAction: ON_ACTION
483
+ }), container);
484
+ case 1:
485
+ case "end":
486
+ return _context19.stop();
487
+ }
488
+ }, _callee19);
489
+ })));
490
+ case 7:
491
+ cya = checkCYA(container);
492
+ _cya$childNodes5 = _slicedToArray(cya.childNodes, 3), cyaTitle = _cya$childNodes5[1], cyaChildNode = _cya$childNodes5[2];
493
+ expect(cyaTitle.textContent).toEqual('Alpha ID: 123456789');
494
+ names = cyaChildNode.childNodes[0];
495
+ expect(names.tagName).toEqual('DL');
496
+ expect(names.classList).toContain("govuk-!-margin-bottom-".concat(_CheckYourAnswers.DEFAULT_MARGIN_BOTTOM));
497
+ _names$childNodes3 = _slicedToArray(names.childNodes, 2), firstName = _names$childNodes3[0], surname = _names$childNodes3[1];
498
+ _firstName$childNodes = _slicedToArray(firstName.childNodes, 1), label = _firstName$childNodes[0];
499
+ expect(label.textContent).toEqual('Text Smith');
500
+ checkRow(surname, 'Last name', 'Smith', false);
501
+ case 17:
502
+ case "end":
503
+ return _context20.stop();
623
504
  }
624
505
  }, _callee20);
625
506
  })));
626
- it('should show page components corrently with no label, if label and cya_label are missing', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee22() {
507
+ it('should show page components corrently with no label, if label and cya_label are missing', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
627
508
  var _PAGES, _COMPONENTS, T_PAGES, cya, _cya$childNodes6, cyaChildNode, names, _names$childNodes4, firstName, surname, _firstName$childNodes2, label;
628
-
629
- return regeneratorRuntime.wrap(function _callee22$(_context22) {
630
- while (1) {
631
- switch (_context22.prev = _context22.next) {
632
- case 0:
633
- _PAGES = [].concat(_userProfile.default.pages);
634
- _COMPONENTS = [].concat(_userProfile.default.components);
635
- _COMPONENTS[0] = _objectSpread(_objectSpread({}, _COMPONENTS[0]), {}, {
636
- label: undefined,
637
- required: true,
638
- cya_label: undefined
639
- });
640
- T_PAGES = _utils.default.FormPage.getAll(_PAGES, _COMPONENTS, _objectSpread({}, DATA));
641
- _context22.next = 6;
642
- return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee21() {
643
- return regeneratorRuntime.wrap(function _callee21$(_context21) {
644
- while (1) {
645
- switch (_context21.prev = _context21.next) {
646
- case 0:
647
- (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
648
- pages: T_PAGES,
649
- onRowAction: ON_ROW_ACTION,
650
- onAction: ON_ACTION
651
- }), container);
652
-
653
- case 1:
654
- case "end":
655
- return _context21.stop();
656
- }
657
- }
658
- }, _callee21);
659
- })));
660
-
661
- case 6:
662
- cya = checkCYA(container);
663
- _cya$childNodes6 = _slicedToArray(cya.childNodes, 2), cyaChildNode = _cya$childNodes6[1];
664
- names = cyaChildNode.childNodes[0];
665
- expect(names.tagName).toEqual('DL');
666
- expect(names.classList).toContain("govuk-!-margin-bottom-".concat(_CheckYourAnswers.DEFAULT_MARGIN_BOTTOM));
667
- _names$childNodes4 = _slicedToArray(names.childNodes, 2), firstName = _names$childNodes4[0], surname = _names$childNodes4[1];
668
- _firstName$childNodes2 = _slicedToArray(firstName.childNodes, 1), label = _firstName$childNodes2[0];
669
- expect(label.textContent).toEqual("");
670
- checkRow(surname, 'Last name', 'Smith', false);
671
-
672
- case 15:
673
- case "end":
674
- return _context22.stop();
675
- }
509
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
510
+ while (1) switch (_context22.prev = _context22.next) {
511
+ case 0:
512
+ _PAGES = [].concat(_userProfile.default.pages);
513
+ _COMPONENTS = [].concat(_userProfile.default.components);
514
+ _COMPONENTS[0] = _objectSpread(_objectSpread({}, _COMPONENTS[0]), {}, {
515
+ label: undefined,
516
+ required: true,
517
+ cya_label: undefined
518
+ });
519
+ T_PAGES = _utils.default.FormPage.getAll(_PAGES, _COMPONENTS, _objectSpread({}, DATA));
520
+ _context22.next = 6;
521
+ return (0, _testUtils.act)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
522
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
523
+ while (1) switch (_context21.prev = _context21.next) {
524
+ case 0:
525
+ (0, _setupTests.renderDomWithValidation)( /*#__PURE__*/_react.default.createElement(_CheckYourAnswers.default, {
526
+ pages: T_PAGES,
527
+ onRowAction: ON_ROW_ACTION,
528
+ onAction: ON_ACTION
529
+ }), container);
530
+ case 1:
531
+ case "end":
532
+ return _context21.stop();
533
+ }
534
+ }, _callee21);
535
+ })));
536
+ case 6:
537
+ cya = checkCYA(container);
538
+ _cya$childNodes6 = _slicedToArray(cya.childNodes, 2), cyaChildNode = _cya$childNodes6[1];
539
+ names = cyaChildNode.childNodes[0];
540
+ expect(names.tagName).toEqual('DL');
541
+ expect(names.classList).toContain("govuk-!-margin-bottom-".concat(_CheckYourAnswers.DEFAULT_MARGIN_BOTTOM));
542
+ _names$childNodes4 = _slicedToArray(names.childNodes, 2), firstName = _names$childNodes4[0], surname = _names$childNodes4[1];
543
+ _firstName$childNodes2 = _slicedToArray(firstName.childNodes, 1), label = _firstName$childNodes2[0];
544
+ expect(label.textContent).toEqual("");
545
+ checkRow(surname, 'Last name', 'Smith', false);
546
+ case 15:
547
+ case "end":
548
+ return _context22.stop();
676
549
  }
677
550
  }, _callee22);
678
551
  })));