@ukhomeoffice/cop-react-form-renderer 6.5.1-peter → 6.7.0-alpha

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 (390) hide show
  1. package/dist/components/CheckYourAnswers/Answer.js +12 -12
  2. package/dist/components/CheckYourAnswers/Answer.test.js +92 -127
  3. package/dist/components/CheckYourAnswers/CheckYourAnswers.js +101 -131
  4. package/dist/components/CheckYourAnswers/CheckYourAnswers.test.js +463 -769
  5. package/dist/components/CollectionPage/CollectionPage.js +73 -63
  6. package/dist/components/CollectionPage/CollectionPage.test.js +316 -366
  7. package/dist/components/CollectionSummary/BannerStrip.js +13 -13
  8. package/dist/components/CollectionSummary/BannerStrip.test.js +80 -76
  9. package/dist/components/CollectionSummary/CollectionSummary.js +97 -107
  10. package/dist/components/CollectionSummary/CollectionSummary.test.js +152 -142
  11. package/dist/components/CollectionSummary/Confirmation.js +14 -12
  12. package/dist/components/CollectionSummary/Confirmation.test.js +68 -63
  13. package/dist/components/CollectionSummary/RenderListView.js +45 -51
  14. package/dist/components/CollectionSummary/RenderListView.test.js +78 -77
  15. package/dist/components/CollectionSummary/SummaryCard.js +104 -135
  16. package/dist/components/CollectionSummary/SummaryCard.test.js +930 -962
  17. package/dist/components/CollectionSummary/SummaryCardDetails.js +72 -71
  18. package/dist/components/CollectionSummary/SummaryCardDetails.test.js +128 -135
  19. package/dist/components/CollectionSummary/SummaryCardValidationContext.js +30 -35
  20. package/dist/components/CollectionSummary/SummaryCardValidationContext.test.js +62 -74
  21. package/dist/components/FormComponent/Collection.js +74 -108
  22. package/dist/components/FormComponent/Collection.test.js +909 -1081
  23. package/dist/components/FormComponent/Container.js +40 -38
  24. package/dist/components/FormComponent/Container.test.js +314 -345
  25. package/dist/components/FormComponent/FormComponent.js +69 -72
  26. package/dist/components/FormComponent/FormComponent.test.js +353 -414
  27. package/dist/components/FormComponent/helpers/addLabel.js +4 -7
  28. package/dist/components/FormComponent/helpers/getComponentDisabled.js +1 -1
  29. package/dist/components/FormComponent/helpers/getComponentDisabled.test.js +7 -7
  30. package/dist/components/FormComponent/helpers/getComponentError.js +3 -5
  31. package/dist/components/FormComponent/helpers/getComponentError.test.js +14 -14
  32. package/dist/components/FormComponent/helpers/getComponentFieldSet.js +3 -4
  33. package/dist/components/FormComponent/helpers/getComponentFieldSet.test.js +6 -6
  34. package/dist/components/FormComponent/helpers/index.js +4 -4
  35. package/dist/components/FormPage/FormPage.js +65 -80
  36. package/dist/components/FormPage/FormPage.test.js +127 -163
  37. package/dist/components/FormRenderer/FormRenderer.js +143 -179
  38. package/dist/components/FormRenderer/FormRenderer.test.js +730 -1115
  39. package/dist/components/FormRenderer/handlers/cyaAction.js +2 -2
  40. package/dist/components/FormRenderer/handlers/getPageId.js +1 -3
  41. package/dist/components/FormRenderer/handlers/getPageId.test.js +14 -14
  42. package/dist/components/FormRenderer/handlers/handlers.test.js +32 -32
  43. package/dist/components/FormRenderer/handlers/index.js +1 -1
  44. package/dist/components/FormRenderer/handlers/navigate.js +3 -3
  45. package/dist/components/FormRenderer/handlers/submissionError.js +1 -1
  46. package/dist/components/FormRenderer/helpers/canActionProceed.js +1 -1
  47. package/dist/components/FormRenderer/helpers/canActionProceed.test.js +15 -15
  48. package/dist/components/FormRenderer/helpers/canCYASubmit.js +1 -3
  49. package/dist/components/FormRenderer/helpers/canCYASubmit.test.js +16 -20
  50. package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.js +17 -22
  51. package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.test.js +16 -16
  52. package/dist/components/FormRenderer/helpers/getCYA.js +3 -5
  53. package/dist/components/FormRenderer/helpers/getCYA.test.js +11 -11
  54. package/dist/components/FormRenderer/helpers/getFormState.js +5 -7
  55. package/dist/components/FormRenderer/helpers/getFormState.test.js +10 -10
  56. package/dist/components/FormRenderer/helpers/getNextPageId.js +13 -24
  57. package/dist/components/FormRenderer/helpers/getNextPageId.test.js +67 -67
  58. package/dist/components/FormRenderer/helpers/getPage.js +2 -4
  59. package/dist/components/FormRenderer/helpers/getPage.test.js +11 -11
  60. package/dist/components/FormRenderer/helpers/getRelevantPages.js +7 -9
  61. package/dist/components/FormRenderer/helpers/getRelevantPages.test.js +14 -14
  62. package/dist/components/FormRenderer/helpers/getSubmissionStatus.js +5 -5
  63. package/dist/components/FormRenderer/helpers/getSubmissionStatus.test.js +103 -97
  64. package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.js +62 -60
  65. package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.test.js +71 -78
  66. package/dist/components/FormRenderer/helpers/index.js +2 -4
  67. package/dist/components/FormRenderer/onCYAAction.js +59 -51
  68. package/dist/components/FormRenderer/onCYAAction.test.js +164 -152
  69. package/dist/components/FormRenderer/onPageAction.js +44 -47
  70. package/dist/components/FormRenderer/onPageAction.test.js +223 -213
  71. package/dist/components/FormRenderer/onTaskAction.js +9 -13
  72. package/dist/components/FormRenderer/onTaskAction.test.js +93 -88
  73. package/dist/components/PageActions/ActionButton.js +12 -15
  74. package/dist/components/PageActions/ActionButton.test.js +56 -78
  75. package/dist/components/PageActions/PageActions.js +10 -10
  76. package/dist/components/PageActions/PageActions.test.js +86 -115
  77. package/dist/components/SummaryList/GroupAction.js +9 -17
  78. package/dist/components/SummaryList/GroupAction.test.js +37 -33
  79. package/dist/components/SummaryList/RowAction.js +11 -16
  80. package/dist/components/SummaryList/RowAction.test.js +37 -33
  81. package/dist/components/SummaryList/SummaryList.js +21 -26
  82. package/dist/components/SummaryList/SummaryList.test.js +143 -166
  83. package/dist/components/SummaryList/SummaryListHeadingRow.js +6 -4
  84. package/dist/components/SummaryList/SummaryListRow.js +6 -4
  85. package/dist/components/SummaryList/SummaryListTitleRow.js +5 -3
  86. package/dist/components/SummaryList/helpers/getGroupActionAttributes.js +3 -5
  87. package/dist/components/SummaryList/helpers/getGroupActionAttributes.test.js +22 -22
  88. package/dist/components/SummaryList/helpers/getRowActionAttributes.js +3 -5
  89. package/dist/components/SummaryList/helpers/getRowActionAttributes.test.js +22 -22
  90. package/dist/components/SummaryList/helpers/index.js +1 -1
  91. package/dist/components/TaskList/Task.js +19 -29
  92. package/dist/components/TaskList/Task.test.js +83 -76
  93. package/dist/components/TaskList/TaskList.js +45 -71
  94. package/dist/components/TaskList/TaskList.test.js +113 -111
  95. package/dist/components/TaskList/TaskState.js +7 -5
  96. package/dist/components/TaskList/TaskState.test.js +52 -45
  97. package/dist/components/index.js +7 -7
  98. package/dist/context/HooksContext/HooksContext.js +57 -80
  99. package/dist/context/HooksContext/HooksContext.test.js +26 -35
  100. package/dist/context/HooksContext/index.js +3 -4
  101. package/dist/context/ValidationContext/ValidationContext.js +43 -94
  102. package/dist/context/ValidationContext/ValidationContext.test.js +56 -68
  103. package/dist/context/ValidationContext/index.js +3 -4
  104. package/dist/context/index.js +2 -2
  105. package/dist/hooks/index.js +9 -10
  106. package/dist/hooks/useAxios.js +14 -40
  107. package/dist/hooks/useGetRequest.js +61 -97
  108. package/dist/hooks/useHooks.js +1 -3
  109. package/dist/hooks/useRefData.js +26 -39
  110. package/dist/hooks/useValidation.js +1 -3
  111. package/dist/index.js +13 -14
  112. package/dist/models/CollectionLabels.js +1 -1
  113. package/dist/models/ComponentTypes.js +25 -25
  114. package/dist/models/EventTypes.js +4 -4
  115. package/dist/models/FormPages.js +4 -4
  116. package/dist/models/FormTypes.js +8 -8
  117. package/dist/models/HubFormats.js +3 -3
  118. package/dist/models/PageAction.js +44 -38
  119. package/dist/models/TaskStates.js +29 -28
  120. package/dist/models/index.js +9 -9
  121. package/dist/setupTests.js +30 -31
  122. package/dist/utils/CheckYourAnswers/getCYAAction.js +5 -5
  123. package/dist/utils/CheckYourAnswers/getCYAAction.test.js +52 -54
  124. package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.js +15 -25
  125. package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.test.js +33 -35
  126. package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.js +17 -31
  127. package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.test.js +42 -44
  128. package/dist/utils/CheckYourAnswers/getCYARow.js +6 -6
  129. package/dist/utils/CheckYourAnswers/getCYARow.test.js +86 -86
  130. package/dist/utils/CheckYourAnswers/getCYARowForGroup.js +18 -24
  131. package/dist/utils/CheckYourAnswers/getCYARowForGroup.test.js +15 -16
  132. package/dist/utils/CheckYourAnswers/getCYARowsForCollection.js +33 -36
  133. package/dist/utils/CheckYourAnswers/getCYARowsForCollection.test.js +58 -61
  134. package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.js +83 -89
  135. package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.test.js +164 -138
  136. package/dist/utils/CheckYourAnswers/getCYARowsForContainer.js +25 -20
  137. package/dist/utils/CheckYourAnswers/getCYARowsForContainer.test.js +103 -97
  138. package/dist/utils/CheckYourAnswers/getCYARowsForPage.js +13 -18
  139. package/dist/utils/CheckYourAnswers/getCYARowsForPage.test.js +70 -76
  140. package/dist/utils/CheckYourAnswers/getComponentRowForCYA.js +11 -11
  141. package/dist/utils/CheckYourAnswers/getComponentRowForCYA.test.js +7 -7
  142. package/dist/utils/CheckYourAnswers/index.js +1 -1
  143. package/dist/utils/CheckYourAnswers/showComponentCYA.js +4 -4
  144. package/dist/utils/CheckYourAnswers/showComponentCYA.test.js +25 -25
  145. package/dist/utils/CollectionPage/addCollectionPageEntry.js +2 -2
  146. package/dist/utils/CollectionPage/addCollectionPageEntry.test.js +5 -5
  147. package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.js +2 -2
  148. package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.test.js +17 -18
  149. package/dist/utils/CollectionPage/duplicateCollectionPageEntry.js +18 -20
  150. package/dist/utils/CollectionPage/duplicateCollectionPageEntry.test.js +55 -26
  151. package/dist/utils/CollectionPage/getCollectionPageActiveId.js +2 -2
  152. package/dist/utils/CollectionPage/getCollectionPageActiveId.test.js +10 -10
  153. package/dist/utils/CollectionPage/getCollectionPageActiveIndex.js +7 -11
  154. package/dist/utils/CollectionPage/getCollectionPageActiveIndex.test.js +22 -22
  155. package/dist/utils/CollectionPage/getCollectionPageData.js +8 -12
  156. package/dist/utils/CollectionPage/getCollectionPageData.test.js +19 -19
  157. package/dist/utils/CollectionPage/getErrorsForCollection.js +24 -24
  158. package/dist/utils/CollectionPage/getErrorsForCollection.test.js +20 -22
  159. package/dist/utils/CollectionPage/getQuickEditPage.js +36 -28
  160. package/dist/utils/CollectionPage/getQuickEditPage.test.js +26 -45
  161. package/dist/utils/CollectionPage/index.js +1 -1
  162. package/dist/utils/CollectionPage/mergeCollectionPages.js +31 -35
  163. package/dist/utils/CollectionPage/mergeCollectionPages.test.js +20 -20
  164. package/dist/utils/CollectionPage/removeCollectionPageEntry.js +4 -6
  165. package/dist/utils/CollectionPage/removeCollectionPageEntry.test.js +10 -10
  166. package/dist/utils/CollectionPage/setCollectionPageData.js +10 -16
  167. package/dist/utils/CollectionPage/setCollectionPageData.test.js +24 -24
  168. package/dist/utils/Component/addShowWhen.js +4 -8
  169. package/dist/utils/Component/addShowWhen.test.js +37 -37
  170. package/dist/utils/Component/applyToComponentTree.js +18 -18
  171. package/dist/utils/Component/applyToComponentTree.test.js +27 -32
  172. package/dist/utils/Component/cleanAttributes.js +10 -13
  173. package/dist/utils/Component/cleanAttributes.test.js +17 -18
  174. package/dist/utils/Component/elevateNestedComponents.js +5 -5
  175. package/dist/utils/Component/elevateNestedComponents.test.js +30 -30
  176. package/dist/utils/Component/getComponent.js +88 -94
  177. package/dist/utils/Component/getComponentTests/getComponent.autocomplete.test.js +18 -17
  178. package/dist/utils/Component/getComponentTests/getComponent.calculation.test.js +46 -59
  179. package/dist/utils/Component/getComponentTests/getComponent.checkboxes.test.js +39 -48
  180. package/dist/utils/Component/getComponentTests/getComponent.date.test.js +23 -33
  181. package/dist/utils/Component/getComponentTests/getComponent.details.test.js +20 -18
  182. package/dist/utils/Component/getComponentTests/getComponent.email.test.js +17 -22
  183. package/dist/utils/Component/getComponentTests/getComponent.file.test.js +20 -25
  184. package/dist/utils/Component/getComponentTests/getComponent.heading.test.js +10 -9
  185. package/dist/utils/Component/getComponentTests/getComponent.html.test.js +17 -15
  186. package/dist/utils/Component/getComponentTests/getComponent.insetText.test.js +9 -8
  187. package/dist/utils/Component/getComponentTests/getComponent.list.test.js +17 -15
  188. package/dist/utils/Component/getComponentTests/getComponent.multifile.test.js +22 -26
  189. package/dist/utils/Component/getComponentTests/getComponent.nested.test.js +155 -175
  190. package/dist/utils/Component/getComponentTests/getComponent.paragraph.test.js +17 -15
  191. package/dist/utils/Component/getComponentTests/getComponent.phoneNumber.test.js +17 -22
  192. package/dist/utils/Component/getComponentTests/getComponent.radios.test.js +57 -72
  193. package/dist/utils/Component/getComponentTests/getComponent.select.test.js +17 -22
  194. package/dist/utils/Component/getComponentTests/getComponent.text.test.js +17 -22
  195. package/dist/utils/Component/getComponentTests/getComponent.textArea.test.js +31 -38
  196. package/dist/utils/Component/getComponentTests/getComponent.time.test.js +20 -29
  197. package/dist/utils/Component/getComponentTests/getComponent.unknown.test.js +2 -2
  198. package/dist/utils/Component/getComponentTests/getComponent.warningText.test.js +9 -8
  199. package/dist/utils/Component/getDefaultValue.js +6 -8
  200. package/dist/utils/Component/getDefaultValue.test.js +12 -12
  201. package/dist/utils/Component/getDefaultValueFromConfig.js +22 -21
  202. package/dist/utils/Component/getDefaultValueFromConfig.test.js +31 -31
  203. package/dist/utils/Component/index.js +1 -1
  204. package/dist/utils/Component/isEditable.js +2 -4
  205. package/dist/utils/Component/isEditable.test.js +14 -15
  206. package/dist/utils/Component/optionIsSelected.js +1 -1
  207. package/dist/utils/Component/optionIsSelected.test.js +9 -9
  208. package/dist/utils/Component/setupContainerComponentsPath.js +27 -29
  209. package/dist/utils/Component/setupContainerComponentsPath.test.js +11 -11
  210. package/dist/utils/Component/showComponent.js +1 -1
  211. package/dist/utils/Component/showComponent.test.js +28 -28
  212. package/dist/utils/Component/wrapInFormGroup.js +2 -2
  213. package/dist/utils/Condition/index.js +1 -1
  214. package/dist/utils/Condition/meetsAllConditions.js +8 -8
  215. package/dist/utils/Condition/meetsAllConditions.test.js +20 -20
  216. package/dist/utils/Condition/meetsCondition.js +16 -25
  217. package/dist/utils/Condition/meetsCondition.test.js +402 -402
  218. package/dist/utils/Condition/meetsOneCondition.js +5 -5
  219. package/dist/utils/Condition/meetsOneCondition.test.js +16 -16
  220. package/dist/utils/Condition/setupConditions.js +13 -18
  221. package/dist/utils/Condition/setupConditions.test.js +7 -7
  222. package/dist/utils/Container/getEditableComponents.js +3 -5
  223. package/dist/utils/Container/getEditableComponents.test.js +43 -45
  224. package/dist/utils/Container/index.js +1 -1
  225. package/dist/utils/Container/setupNesting.js +16 -20
  226. package/dist/utils/Container/setupNesting.test.js +27 -30
  227. package/dist/utils/Container/showContainer.js +3 -7
  228. package/dist/utils/Container/showContainer.test.js +30 -30
  229. package/dist/utils/Data/applyFormula.js +38 -48
  230. package/dist/utils/Data/applyFormula.test.js +20 -20
  231. package/dist/utils/Data/getAutocompleteSource.js +18 -26
  232. package/dist/utils/Data/getAutocompleteSource.test.js +80 -86
  233. package/dist/utils/Data/getDataPath.js +18 -28
  234. package/dist/utils/Data/getDataPath.test.js +12 -12
  235. package/dist/utils/Data/getOptions.js +24 -30
  236. package/dist/utils/Data/getOptions.test.js +27 -27
  237. package/dist/utils/Data/getSourceData.js +6 -19
  238. package/dist/utils/Data/getSourceData.test.js +84 -80
  239. package/dist/utils/Data/index.js +1 -1
  240. package/dist/utils/Data/nestInRefdataOptions.js +9 -16
  241. package/dist/utils/Data/nestInRefdataOptions.test.js +16 -16
  242. package/dist/utils/Data/refDataToOptions.js +10 -13
  243. package/dist/utils/Data/refDataToOptions.test.js +19 -19
  244. package/dist/utils/Data/setDataItem.js +7 -8
  245. package/dist/utils/Data/setDataItem.test.js +37 -37
  246. package/dist/utils/Data/setupFormData.js +13 -21
  247. package/dist/utils/Data/setupFormData.test.js +51 -50
  248. package/dist/utils/Data/setupRefDataUrlForComponent.js +20 -26
  249. package/dist/utils/Data/setupRefDataUrlForComponent.test.js +24 -24
  250. package/dist/utils/FormPage/applyConditionalProperties.js +5 -9
  251. package/dist/utils/FormPage/applyConditionalProperties.test.js +15 -18
  252. package/dist/utils/FormPage/getConditionalText.js +3 -3
  253. package/dist/utils/FormPage/getConditionalText.test.js +29 -29
  254. package/dist/utils/FormPage/getFormPage.js +15 -16
  255. package/dist/utils/FormPage/getFormPage.test.js +47 -46
  256. package/dist/utils/FormPage/getFormPages.js +7 -12
  257. package/dist/utils/FormPage/getFormPages.test.js +20 -23
  258. package/dist/utils/FormPage/getPageActions.js +9 -15
  259. package/dist/utils/FormPage/getPageActions.test.js +32 -32
  260. package/dist/utils/FormPage/getParagraphFromText.js +5 -7
  261. package/dist/utils/FormPage/getParagraphFromText.test.js +6 -6
  262. package/dist/utils/FormPage/index.js +2 -4
  263. package/dist/utils/FormPage/showFormPage.js +3 -7
  264. package/dist/utils/FormPage/showFormPage.test.js +32 -32
  265. package/dist/utils/FormPage/showFormPageCYA.js +1 -1
  266. package/dist/utils/FormPage/showFormPageCYA.test.js +8 -8
  267. package/dist/utils/FormPage/useComponent.js +21 -28
  268. package/dist/utils/FormPage/useComponent.test.js +77 -79
  269. package/dist/utils/Format/formatData.js +1 -1
  270. package/dist/utils/Format/formatData.test.js +18 -18
  271. package/dist/utils/Format/formatDataForComponent.js +5 -6
  272. package/dist/utils/Format/formatDataForComponent.test.js +50 -78
  273. package/dist/utils/Format/formatDataForForm.js +6 -8
  274. package/dist/utils/Format/formatDataForForm.test.js +13 -16
  275. package/dist/utils/Format/formatDataForPage.js +4 -5
  276. package/dist/utils/Format/formatDataForPage.test.js +20 -25
  277. package/dist/utils/Format/index.js +1 -1
  278. package/dist/utils/Hub/getFormHub.js +1 -1
  279. package/dist/utils/Hub/getFormHub.test.js +28 -31
  280. package/dist/utils/Hub/index.js +1 -1
  281. package/dist/utils/Meta/constants.js +2 -2
  282. package/dist/utils/Meta/documents/getDocuments.js +1 -1
  283. package/dist/utils/Meta/documents/getDocuments.test.js +24 -16
  284. package/dist/utils/Meta/documents/index.js +1 -1
  285. package/dist/utils/Meta/documents/setDocumentsForField.js +14 -16
  286. package/dist/utils/Meta/documents/setDocumentsForField.test.js +68 -34
  287. package/dist/utils/Meta/index.js +1 -1
  288. package/dist/utils/Operate/checkValueIsTruthy.js +2 -2
  289. package/dist/utils/Operate/checkValueIsTruthy.test.js +16 -16
  290. package/dist/utils/Operate/getFirstOf.js +5 -5
  291. package/dist/utils/Operate/getFirstOf.test.js +31 -31
  292. package/dist/utils/Operate/getIndexOfMatchingValueIn.js +10 -10
  293. package/dist/utils/Operate/getIndexOfMatchingValueIn.test.js +46 -52
  294. package/dist/utils/Operate/index.js +1 -1
  295. package/dist/utils/Operate/persistValueInFormData.js +3 -3
  296. package/dist/utils/Operate/persistValueInFormData.test.js +22 -20
  297. package/dist/utils/Operate/runPageOperations.js +7 -7
  298. package/dist/utils/Operate/runPageOperations.test.js +35 -36
  299. package/dist/utils/Operate/setValueInFormData.js +2 -2
  300. package/dist/utils/Operate/setValueInFormData.test.js +16 -16
  301. package/dist/utils/Operate/shouldRun.js +6 -6
  302. package/dist/utils/Operate/shouldRun.test.js +21 -27
  303. package/dist/utils/Validate/additional/conditionallyRequired.js +4 -4
  304. package/dist/utils/Validate/additional/conditionallyRequired.test.js +18 -18
  305. package/dist/utils/Validate/additional/index.js +6 -6
  306. package/dist/utils/Validate/additional/index.test.js +12 -12
  307. package/dist/utils/Validate/additional/mustBeAfter.js +2 -2
  308. package/dist/utils/Validate/additional/mustBeAfter.test.js +40 -40
  309. package/dist/utils/Validate/additional/mustBeBefore.js +2 -2
  310. package/dist/utils/Validate/additional/mustBeBefore.test.js +28 -28
  311. package/dist/utils/Validate/additional/mustBeEarlierDateTime.js +7 -11
  312. package/dist/utils/Validate/additional/mustBeEarlierDateTime.test.js +37 -41
  313. package/dist/utils/Validate/additional/mustBeGreaterThan.js +2 -2
  314. package/dist/utils/Validate/additional/mustBeGreaterThan.test.js +18 -18
  315. package/dist/utils/Validate/additional/mustBeInTheFuture.js +2 -2
  316. package/dist/utils/Validate/additional/mustBeInTheFuture.test.js +12 -12
  317. package/dist/utils/Validate/additional/mustBeInThePast.js +3 -3
  318. package/dist/utils/Validate/additional/mustBeInThePast.test.js +12 -12
  319. package/dist/utils/Validate/additional/mustBeLessThan.js +2 -2
  320. package/dist/utils/Validate/additional/mustBeLessThan.test.js +17 -17
  321. package/dist/utils/Validate/additional/mustBeLongerThan.js +1 -1
  322. package/dist/utils/Validate/additional/mustBeLongerThan.test.js +16 -16
  323. package/dist/utils/Validate/additional/mustBeNumbersOnly.js +2 -2
  324. package/dist/utils/Validate/additional/mustBeNumbersOnly.test.js +20 -20
  325. package/dist/utils/Validate/additional/mustBeShorterThan.js +1 -1
  326. package/dist/utils/Validate/additional/mustBeShorterThan.test.js +16 -16
  327. package/dist/utils/Validate/additional/mustBeUniqueInCollection.js +8 -4
  328. package/dist/utils/Validate/additional/mustBeUniqueInCollection.test.js +64 -32
  329. package/dist/utils/Validate/additional/mustEnterAtLeastOne.js +2 -2
  330. package/dist/utils/Validate/additional/mustEnterAtLeastOne.test.js +14 -16
  331. package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.js +1 -1
  332. package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.test.js +12 -12
  333. package/dist/utils/Validate/additional/mustNotContainSql.js +3 -4
  334. package/dist/utils/Validate/additional/mustNotContainSql.test.js +14 -14
  335. package/dist/utils/Validate/additional/mustSelectOnlyOne.js +2 -2
  336. package/dist/utils/Validate/additional/mustSelectOnlyOne.test.js +28 -26
  337. package/dist/utils/Validate/additional/utils.js +9 -22
  338. package/dist/utils/Validate/index.js +1 -1
  339. package/dist/utils/Validate/validateCollection.js +19 -25
  340. package/dist/utils/Validate/validateCollection.test.js +74 -66
  341. package/dist/utils/Validate/validateComponent.js +17 -15
  342. package/dist/utils/Validate/validateComponent.test.js +167 -146
  343. package/dist/utils/Validate/validateContainer.js +15 -20
  344. package/dist/utils/Validate/validateContainer.test.js +58 -52
  345. package/dist/utils/Validate/validateDate.js +15 -21
  346. package/dist/utils/Validate/validateDate.test.js +31 -32
  347. package/dist/utils/Validate/validateEmail.js +6 -8
  348. package/dist/utils/Validate/validateEmail.test.js +25 -25
  349. package/dist/utils/Validate/validateMultifile.js +5 -7
  350. package/dist/utils/Validate/validateMultifile.test.js +17 -18
  351. package/dist/utils/Validate/validatePage.js +19 -22
  352. package/dist/utils/Validate/validatePage.test.js +215 -203
  353. package/dist/utils/Validate/validateRegex.js +3 -5
  354. package/dist/utils/Validate/validateRegex.test.js +14 -14
  355. package/dist/utils/Validate/validateRequired.js +4 -6
  356. package/dist/utils/Validate/validateRequired.test.js +18 -18
  357. package/dist/utils/Validate/validateTextArea.js +4 -6
  358. package/dist/utils/Validate/validateTextArea.test.js +20 -20
  359. package/dist/utils/Validate/validateTime.js +11 -18
  360. package/dist/utils/Validate/validateTime.test.js +16 -16
  361. package/dist/utils/index.js +7 -9
  362. package/package.json +2 -2
  363. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/component-used-in-multiple-pages-data.json +0 -4
  364. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/component-used-in-multiple-pages-form.json +0 -61
  365. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/cop-airpax-after.json +0 -429
  366. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/cop-airpax-before.json +0 -449
  367. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/cop-airpax-form.json +0 -15219
  368. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/cop-eab-2-data-after.json +0 -516
  369. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/cop-eab-2-data-before.json +0 -593
  370. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/cop-eab2-form.json +0 -15219
  371. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/cop-mandec-data-after.json +0 -84
  372. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/cop-mandec-data-before.json +0 -98
  373. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/cop-mandec-form.json +0 -9158
  374. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-collection-data-removed.json +0 -4
  375. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-collections.json +0 -8
  376. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-components-removed.json +0 -3
  377. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-components.json +0 -5
  378. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-entire-collection-removed.json +0 -3
  379. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-nested-component-removed.json +0 -10
  380. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/data-with-nested-components.json +0 -11
  381. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/form-for-nested-components.json +0 -96
  382. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/form-with-collections-delete-entire.json +0 -47
  383. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/form-with-collections.json +0 -46
  384. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/form-with-components.json +0 -48
  385. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/test.json +0 -1605
  386. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/test2.json +0 -205
  387. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.js +0 -206
  388. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.test.js +0 -143
  389. package/dist/components/FormRenderer/helpers/deleteNodeByPath.js +0 -26
  390. package/dist/components/FormRenderer/helpers/deleteNodeByPath.test.js +0 -56
@@ -4,8 +4,8 @@ var _meetsCondition = _interopRequireDefault(require("./meetsCondition"));
4
4
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5
5
  // Local imports
6
6
 
7
- describe('utils.Condition.meetsCondition', function () {
8
- var getCondition = function getCondition(operator, val) {
7
+ describe('utils.Condition.meetsCondition', () => {
8
+ const getCondition = (operator, val) => {
9
9
  if (['in', 'nin'].includes(operator)) {
10
10
  return {
11
11
  op: operator,
@@ -17,684 +17,684 @@ describe('utils.Condition.meetsCondition', function () {
17
17
  value: val
18
18
  };
19
19
  };
20
- var TEST_VALUES = ['a', 'b', 3, 4, null, undefined, true, false, 0];
21
- describe('equality operators', function () {
22
- ['eq', '='].forEach(function (op) {
23
- describe("operator ".concat(op), function () {
20
+ const TEST_VALUES = ['a', 'b', 3, 4, null, undefined, true, false, 0];
21
+ describe('equality operators', () => {
22
+ ['eq', '='].forEach(op => {
23
+ describe("operator ".concat(op), () => {
24
24
  // Should match...
25
- it('should match two nulls', function () {
26
- var VALUE = null;
27
- var CONDITION = getCondition(op, null);
25
+ it('should match two nulls', () => {
26
+ const VALUE = null;
27
+ const CONDITION = getCondition(op, null);
28
28
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
29
29
  });
30
- it('should match two undefineds', function () {
31
- var VALUE = undefined;
32
- var CONDITION = getCondition(op, undefined);
30
+ it('should match two undefineds', () => {
31
+ const VALUE = undefined;
32
+ const CONDITION = getCondition(op, undefined);
33
33
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
34
34
  });
35
- it('should match two identical strings', function () {
36
- var VALUE = 'value';
37
- var CONDITION = getCondition(op, 'value');
35
+ it('should match two identical strings', () => {
36
+ const VALUE = 'value';
37
+ const CONDITION = getCondition(op, 'value');
38
38
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
39
39
  });
40
- it('should match two empty strings', function () {
41
- var VALUE = '';
42
- var CONDITION = getCondition(op, '');
40
+ it('should match two empty strings', () => {
41
+ const VALUE = '';
42
+ const CONDITION = getCondition(op, '');
43
43
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
44
44
  });
45
- it('should match two identical numbers', function () {
46
- var VALUE = 3;
47
- var CONDITION = getCondition(op, 3);
45
+ it('should match two identical numbers', () => {
46
+ const VALUE = 3;
47
+ const CONDITION = getCondition(op, 3);
48
48
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
49
49
  });
50
- it('should match two zeroes', function () {
51
- var VALUE = 0;
52
- var CONDITION = getCondition(op, 0);
50
+ it('should match two zeroes', () => {
51
+ const VALUE = 0;
52
+ const CONDITION = getCondition(op, 0);
53
53
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
54
54
  });
55
- it('should match two boolean trues', function () {
56
- var VALUE = true;
57
- var CONDITION = getCondition(op, true);
55
+ it('should match two boolean trues', () => {
56
+ const VALUE = true;
57
+ const CONDITION = getCondition(op, true);
58
58
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
59
59
  });
60
- it('should match two boolean falses', function () {
61
- var VALUE = false;
62
- var CONDITION = getCondition(op, false);
60
+ it('should match two boolean falses', () => {
61
+ const VALUE = false;
62
+ const CONDITION = getCondition(op, false);
63
63
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
64
64
  });
65
- it('should match environmentContext value with data object', function () {
66
- var VALUE = 'Bob';
67
- var DATA = {
65
+ it('should match environmentContext value with data object', () => {
66
+ const VALUE = 'Bob';
67
+ const DATA = {
68
68
  environmentContext: {
69
69
  currentUser: 'Bob'
70
70
  }
71
71
  };
72
- var CONDITION = getCondition(op, 'field::environmentContext.currentUser');
72
+ const CONDITION = getCondition(op, 'field::environmentContext.currentUser');
73
73
  expect((0, _meetsCondition.default)(CONDITION, VALUE, DATA)).toBeTruthy();
74
74
  });
75
75
 
76
76
  // Should reject...
77
- it('should reject a null and undefined', function () {
78
- var VALUE = null;
79
- var CONDITION = getCondition(op, undefined);
77
+ it('should reject a null and undefined', () => {
78
+ const VALUE = null;
79
+ const CONDITION = getCondition(op, undefined);
80
80
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
81
81
  });
82
- it('should reject a null and empty string', function () {
83
- var VALUE = null;
84
- var CONDITION = getCondition(op, '');
82
+ it('should reject a null and empty string', () => {
83
+ const VALUE = null;
84
+ const CONDITION = getCondition(op, '');
85
85
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
86
86
  });
87
- it('should reject an undefined and empty string', function () {
88
- var VALUE = undefined;
89
- var CONDITION = getCondition(op, '');
87
+ it('should reject an undefined and empty string', () => {
88
+ const VALUE = undefined;
89
+ const CONDITION = getCondition(op, '');
90
90
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
91
91
  });
92
- it('should reject a string of just whitespace and empty string', function () {
93
- var VALUE = ' ';
94
- var CONDITION = getCondition(op, '');
92
+ it('should reject a string of just whitespace and empty string', () => {
93
+ const VALUE = ' ';
94
+ const CONDITION = getCondition(op, '');
95
95
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
96
96
  });
97
- it("should reject the string number '3' and the number 3", function () {
98
- var VALUE = '3';
99
- var CONDITION = getCondition(op, 3);
97
+ it("should reject the string number '3' and the number 3", () => {
98
+ const VALUE = '3';
99
+ const CONDITION = getCondition(op, 3);
100
100
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
101
101
  });
102
- it('should reject a boolean true and the number 1', function () {
103
- var VALUE = true;
104
- var CONDITION = getCondition(op, 1);
102
+ it('should reject a boolean true and the number 1', () => {
103
+ const VALUE = true;
104
+ const CONDITION = getCondition(op, 1);
105
105
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
106
106
  });
107
- it('should reject a boolean false and a zero', function () {
108
- var VALUE = false;
109
- var CONDITION = getCondition(op, 0);
107
+ it('should reject a boolean false and a zero', () => {
108
+ const VALUE = false;
109
+ const CONDITION = getCondition(op, 0);
110
110
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
111
111
  });
112
112
  });
113
113
  });
114
114
  });
115
- describe('inequality operators', function () {
116
- ['ne', 'neq', '!=', '<>'].forEach(function (op) {
117
- describe("operator ".concat(op), function () {
115
+ describe('inequality operators', () => {
116
+ ['ne', 'neq', '!=', '<>'].forEach(op => {
117
+ describe("operator ".concat(op), () => {
118
118
  // Should reject...
119
- it('should reject two nulls', function () {
120
- var VALUE = null;
121
- var CONDITION = getCondition(op, null);
119
+ it('should reject two nulls', () => {
120
+ const VALUE = null;
121
+ const CONDITION = getCondition(op, null);
122
122
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
123
123
  });
124
- it('should reject two undefineds', function () {
125
- var VALUE = undefined;
126
- var CONDITION = getCondition(op, undefined);
124
+ it('should reject two undefineds', () => {
125
+ const VALUE = undefined;
126
+ const CONDITION = getCondition(op, undefined);
127
127
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
128
128
  });
129
- it('should reject two identical strings', function () {
130
- var VALUE = 'value';
131
- var CONDITION = getCondition(op, 'value');
129
+ it('should reject two identical strings', () => {
130
+ const VALUE = 'value';
131
+ const CONDITION = getCondition(op, 'value');
132
132
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
133
133
  });
134
- it('should reject two empty strings', function () {
135
- var VALUE = '';
136
- var CONDITION = getCondition(op, '');
134
+ it('should reject two empty strings', () => {
135
+ const VALUE = '';
136
+ const CONDITION = getCondition(op, '');
137
137
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
138
138
  });
139
- it('should reject two identical numbers', function () {
140
- var VALUE = 3;
141
- var CONDITION = getCondition(op, 3);
139
+ it('should reject two identical numbers', () => {
140
+ const VALUE = 3;
141
+ const CONDITION = getCondition(op, 3);
142
142
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
143
143
  });
144
- it('should reject two zeroes', function () {
145
- var VALUE = 0;
146
- var CONDITION = getCondition(op, 0);
144
+ it('should reject two zeroes', () => {
145
+ const VALUE = 0;
146
+ const CONDITION = getCondition(op, 0);
147
147
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
148
148
  });
149
- it('should reject two boolean trues', function () {
150
- var VALUE = true;
151
- var CONDITION = getCondition(op, true);
149
+ it('should reject two boolean trues', () => {
150
+ const VALUE = true;
151
+ const CONDITION = getCondition(op, true);
152
152
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
153
153
  });
154
- it('should reject two boolean falses', function () {
155
- var VALUE = false;
156
- var CONDITION = getCondition(op, false);
154
+ it('should reject two boolean falses', () => {
155
+ const VALUE = false;
156
+ const CONDITION = getCondition(op, false);
157
157
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
158
158
  });
159
- it('should reject environmentContext value with data object', function () {
160
- var VALUE = 'Bob';
161
- var DATA = {
159
+ it('should reject environmentContext value with data object', () => {
160
+ const VALUE = 'Bob';
161
+ const DATA = {
162
162
  environmentContext: {
163
163
  currentUser: 'Bob'
164
164
  }
165
165
  };
166
- var CONDITION = getCondition(op, 'field::environmentContext.currentUser');
166
+ const CONDITION = getCondition(op, 'field::environmentContext.currentUser');
167
167
  expect((0, _meetsCondition.default)(CONDITION, VALUE, DATA)).toBeFalsy();
168
168
  });
169
169
 
170
170
  // Should match...
171
- it('should match a null and undefined', function () {
172
- var VALUE = null;
173
- var CONDITION = getCondition(op, undefined);
171
+ it('should match a null and undefined', () => {
172
+ const VALUE = null;
173
+ const CONDITION = getCondition(op, undefined);
174
174
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
175
175
  });
176
- it('should match a null and empty string', function () {
177
- var VALUE = null;
178
- var CONDITION = getCondition(op, '');
176
+ it('should match a null and empty string', () => {
177
+ const VALUE = null;
178
+ const CONDITION = getCondition(op, '');
179
179
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
180
180
  });
181
- it('should match an undefined and empty string', function () {
182
- var VALUE = undefined;
183
- var CONDITION = getCondition(op, '');
181
+ it('should match an undefined and empty string', () => {
182
+ const VALUE = undefined;
183
+ const CONDITION = getCondition(op, '');
184
184
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
185
185
  });
186
- it('should match a string of just whitespace and empty string', function () {
187
- var VALUE = ' ';
188
- var CONDITION = getCondition(op, '');
186
+ it('should match a string of just whitespace and empty string', () => {
187
+ const VALUE = ' ';
188
+ const CONDITION = getCondition(op, '');
189
189
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
190
190
  });
191
- it("should match the string number '3' and the number 3", function () {
192
- var VALUE = '3';
193
- var CONDITION = getCondition(op, 3);
191
+ it("should match the string number '3' and the number 3", () => {
192
+ const VALUE = '3';
193
+ const CONDITION = getCondition(op, 3);
194
194
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
195
195
  });
196
- it('should match a boolean true and the number 1', function () {
197
- var VALUE = true;
198
- var CONDITION = getCondition(op, 1);
196
+ it('should match a boolean true and the number 1', () => {
197
+ const VALUE = true;
198
+ const CONDITION = getCondition(op, 1);
199
199
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
200
200
  });
201
- it('should match a boolean false and a zero', function () {
202
- var VALUE = false;
203
- var CONDITION = getCondition(op, 0);
201
+ it('should match a boolean false and a zero', () => {
202
+ const VALUE = false;
203
+ const CONDITION = getCondition(op, 0);
204
204
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
205
205
  });
206
206
  });
207
207
  });
208
208
  });
209
- describe('operator in', function () {
210
- var op = 'in';
209
+ describe('operator in', () => {
210
+ const op = 'in';
211
211
 
212
212
  // Should match...
213
- it('should match a string that is in the values array', function () {
214
- var VALUE = 'alpha';
215
- var CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
213
+ it('should match a string that is in the values array', () => {
214
+ const VALUE = 'alpha';
215
+ const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
216
216
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
217
217
  });
218
- it('should match a number that is in the values array', function () {
219
- var VALUE = 4;
220
- var CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie', 4]);
218
+ it('should match a number that is in the values array', () => {
219
+ const VALUE = 4;
220
+ const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie', 4]);
221
221
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
222
222
  });
223
223
 
224
224
  // Should reject...
225
- it('should reject a string that is missing from the values array', function () {
226
- var VALUE = 'delta';
227
- var CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
225
+ it('should reject a string that is missing from the values array', () => {
226
+ const VALUE = 'delta';
227
+ const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
228
228
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
229
229
  });
230
- it('should reject a number that is missing from the values array', function () {
231
- var VALUE = 4;
232
- var CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
230
+ it('should reject a number that is missing from the values array', () => {
231
+ const VALUE = 4;
232
+ const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
233
233
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
234
234
  });
235
- it('should reject everything when the values array is empty', function () {
236
- var CONDITION = getCondition(op, []);
237
- ['a', 'b', 'c', 'd', 'e', 6, 7, 8, 9, 'ten'].forEach(function (value) {
235
+ it('should reject everything when the values array is empty', () => {
236
+ const CONDITION = getCondition(op, []);
237
+ ['a', 'b', 'c', 'd', 'e', 6, 7, 8, 9, 'ten'].forEach(value => {
238
238
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeFalsy();
239
239
  });
240
240
  });
241
- it('should reject everything when the values array is null', function () {
242
- var CONDITION = getCondition(op, null);
243
- ['a', 'b', 'c', 'd', 'e', 6, 7, 8, 9, 'ten'].forEach(function (value) {
241
+ it('should reject everything when the values array is null', () => {
242
+ const CONDITION = getCondition(op, null);
243
+ ['a', 'b', 'c', 'd', 'e', 6, 7, 8, 9, 'ten'].forEach(value => {
244
244
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeFalsy();
245
245
  });
246
246
  });
247
247
  });
248
- describe('operator nin', function () {
249
- var op = 'nin';
248
+ describe('operator nin', () => {
249
+ const op = 'nin';
250
250
 
251
251
  // Should reject...
252
- it('should reject a string that is in the values array', function () {
253
- var VALUE = 'alpha';
254
- var CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
252
+ it('should reject a string that is in the values array', () => {
253
+ const VALUE = 'alpha';
254
+ const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
255
255
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
256
256
  });
257
- it('should reject a number that is in the values array', function () {
258
- var VALUE = 4;
259
- var CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie', 4]);
257
+ it('should reject a number that is in the values array', () => {
258
+ const VALUE = 4;
259
+ const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie', 4]);
260
260
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
261
261
  });
262
262
 
263
263
  // Should match...
264
- it('should match a string that is missing from the values array', function () {
265
- var VALUE = 'delta';
266
- var CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
264
+ it('should match a string that is missing from the values array', () => {
265
+ const VALUE = 'delta';
266
+ const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
267
267
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
268
268
  });
269
- it('should match a number that is missing from the values array', function () {
270
- var VALUE = 4;
271
- var CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
269
+ it('should match a number that is missing from the values array', () => {
270
+ const VALUE = 4;
271
+ const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
272
272
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
273
273
  });
274
- it('should match anything when the values array is empty', function () {
275
- var CONDITION = getCondition(op, []);
276
- TEST_VALUES.forEach(function (value) {
274
+ it('should match anything when the values array is empty', () => {
275
+ const CONDITION = getCondition(op, []);
276
+ TEST_VALUES.forEach(value => {
277
277
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeTruthy();
278
278
  });
279
279
  });
280
- it('should match anything when the values array is null', function () {
281
- var CONDITION = getCondition(op, null);
282
- TEST_VALUES.forEach(function (value) {
280
+ it('should match anything when the values array is null', () => {
281
+ const CONDITION = getCondition(op, null);
282
+ TEST_VALUES.forEach(value => {
283
283
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeTruthy();
284
284
  });
285
285
  });
286
286
  });
287
- describe('operator contains', function () {
288
- var op = 'contains';
287
+ describe('operator contains', () => {
288
+ const op = 'contains';
289
289
 
290
290
  // Should match...
291
- it('should match a string that is in the field array', function () {
292
- var FIELD = ['alpha', 'bravo', 'charlie'];
293
- var VALUE = 'alpha';
294
- var CONDITION = getCondition(op, VALUE);
291
+ it('should match a string that is in the field array', () => {
292
+ const FIELD = ['alpha', 'bravo', 'charlie'];
293
+ const VALUE = 'alpha';
294
+ const CONDITION = getCondition(op, VALUE);
295
295
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
296
296
  });
297
- it('should match a sub-string that is in the field array', function () {
298
- var FIELD = ['alpha', 'bravo', 'charlie'];
299
- var VALUE = 'alp';
300
- var CONDITION = getCondition(op, VALUE);
297
+ it('should match a sub-string that is in the field array', () => {
298
+ const FIELD = ['alpha', 'bravo', 'charlie'];
299
+ const VALUE = 'alp';
300
+ const CONDITION = getCondition(op, VALUE);
301
301
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
302
302
  });
303
- it('should match a number that is in the field array', function () {
304
- var FIELD = [1, 2, 3];
305
- var VALUE = 1;
306
- var CONDITION = getCondition(op, VALUE);
303
+ it('should match a number that is in the field array', () => {
304
+ const FIELD = [1, 2, 3];
305
+ const VALUE = 1;
306
+ const CONDITION = getCondition(op, VALUE);
307
307
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
308
308
  });
309
- it('should match a sub-string that is in the field string', function () {
310
- var FIELD = 'alphabravocharlie';
311
- var VALUE = 'alpha';
312
- var CONDITION = getCondition(op, VALUE);
309
+ it('should match a sub-string that is in the field string', () => {
310
+ const FIELD = 'alphabravocharlie';
311
+ const VALUE = 'alpha';
312
+ const CONDITION = getCondition(op, VALUE);
313
313
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
314
314
  });
315
- it('should match a string that is in the field array regardless of case', function () {
316
- var FIELD = ['Alpha', 'bravo', 'charlie'];
317
- var VALUE = 'alpha';
318
- var CONDITION = getCondition(op, VALUE);
315
+ it('should match a string that is in the field array regardless of case', () => {
316
+ const FIELD = ['Alpha', 'bravo', 'charlie'];
317
+ const VALUE = 'alpha';
318
+ const CONDITION = getCondition(op, VALUE);
319
319
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
320
320
  });
321
321
 
322
322
  // Should reject...
323
- it('should reject a string that is missing from the field array', function () {
324
- var FIELD = ['alpha', 'bravo', 'charlie'];
325
- var VALUE = 'delta';
326
- var CONDITION = getCondition(op, VALUE);
323
+ it('should reject a string that is missing from the field array', () => {
324
+ const FIELD = ['alpha', 'bravo', 'charlie'];
325
+ const VALUE = 'delta';
326
+ const CONDITION = getCondition(op, VALUE);
327
327
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
328
328
  });
329
- it('should reject a number that is missing from the field array', function () {
330
- var FIELD = [1, 2, 3];
331
- var VALUE = 4;
332
- var CONDITION = getCondition(op, VALUE);
329
+ it('should reject a number that is missing from the field array', () => {
330
+ const FIELD = [1, 2, 3];
331
+ const VALUE = 4;
332
+ const CONDITION = getCondition(op, VALUE);
333
333
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
334
334
  });
335
- it('should reject a substring that is missing from the field string', function () {
336
- var FIELD = 'alphabravocharlie';
337
- var VALUE = 'delta';
338
- var CONDITION = getCondition(op, VALUE);
335
+ it('should reject a substring that is missing from the field string', () => {
336
+ const FIELD = 'alphabravocharlie';
337
+ const VALUE = 'delta';
338
+ const CONDITION = getCondition(op, VALUE);
339
339
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
340
340
  });
341
- it('should reject any value when the field is an empty Array', function () {
342
- var FIELD = [];
343
- var VALUE = 'alpha';
344
- var CONDITION = getCondition(op, VALUE);
341
+ it('should reject any value when the field is an empty Array', () => {
342
+ const FIELD = [];
343
+ const VALUE = 'alpha';
344
+ const CONDITION = getCondition(op, VALUE);
345
345
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
346
346
  });
347
- it('should reject any value when the field is an empty string', function () {
348
- var FIELD = '';
349
- var VALUE = 'alpha';
350
- var CONDITION = getCondition(op, VALUE);
347
+ it('should reject any value when the field is an empty string', () => {
348
+ const FIELD = '';
349
+ const VALUE = 'alpha';
350
+ const CONDITION = getCondition(op, VALUE);
351
351
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
352
352
  });
353
- it('should reject any field when the value is null', function () {
354
- var FIELD = ['alpha', 'bravo', 'charlie'];
355
- var VALUE = null;
356
- var CONDITION = getCondition(op, VALUE);
353
+ it('should reject any field when the value is null', () => {
354
+ const FIELD = ['alpha', 'bravo', 'charlie'];
355
+ const VALUE = null;
356
+ const CONDITION = getCondition(op, VALUE);
357
357
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
358
358
  });
359
- it('should reject any field when the value is undefined', function () {
360
- var FIELD = ['alpha', 'bravo', 'charlie'];
361
- var VALUE = undefined;
362
- var CONDITION = getCondition(op, VALUE);
359
+ it('should reject any field when the value is undefined', () => {
360
+ const FIELD = ['alpha', 'bravo', 'charlie'];
361
+ const VALUE = undefined;
362
+ const CONDITION = getCondition(op, VALUE);
363
363
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
364
364
  });
365
- it('should reject any value when the field is null', function () {
366
- var FIELD = null;
367
- var VALUE = 'alpha';
368
- var CONDITION = getCondition(op, VALUE);
365
+ it('should reject any value when the field is null', () => {
366
+ const FIELD = null;
367
+ const VALUE = 'alpha';
368
+ const CONDITION = getCondition(op, VALUE);
369
369
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
370
370
  });
371
- it('should reject any value when the field is undefined', function () {
372
- var FIELD = undefined;
373
- var VALUE = 'alpha';
374
- var CONDITION = getCondition(op, VALUE);
371
+ it('should reject any value when the field is undefined', () => {
372
+ const FIELD = undefined;
373
+ const VALUE = 'alpha';
374
+ const CONDITION = getCondition(op, VALUE);
375
375
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
376
376
  });
377
377
  });
378
- describe('operator !contains', function () {
379
- var op = '!contains';
378
+ describe('operator !contains', () => {
379
+ const op = '!contains';
380
380
 
381
381
  // Should match...
382
- it('should match a string that is not in the field array', function () {
383
- var FIELD = ['alpha', 'bravo', 'charlie'];
384
- var VALUE = 'delta';
385
- var CONDITION = getCondition(op, VALUE);
382
+ it('should match a string that is not in the field array', () => {
383
+ const FIELD = ['alpha', 'bravo', 'charlie'];
384
+ const VALUE = 'delta';
385
+ const CONDITION = getCondition(op, VALUE);
386
386
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
387
387
  });
388
- it('should match any value if the field array is empty', function () {
389
- var FIELD = [];
390
- var VALUE = 'alpha';
391
- var CONDITION = getCondition(op, VALUE);
388
+ it('should match any value if the field array is empty', () => {
389
+ const FIELD = [];
390
+ const VALUE = 'alpha';
391
+ const CONDITION = getCondition(op, VALUE);
392
392
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
393
393
  });
394
- it('should match any field when the value is null', function () {
395
- var FIELD = ['alpha', 'bravo', 'charlie'];
396
- var VALUE = null;
397
- var CONDITION = getCondition(op, VALUE);
394
+ it('should match any field when the value is null', () => {
395
+ const FIELD = ['alpha', 'bravo', 'charlie'];
396
+ const VALUE = null;
397
+ const CONDITION = getCondition(op, VALUE);
398
398
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
399
399
  });
400
- it('should match any field when the value is undefined', function () {
401
- var FIELD = ['alpha', 'bravo', 'charlie'];
402
- var VALUE = undefined;
403
- var CONDITION = getCondition(op, VALUE);
400
+ it('should match any field when the value is undefined', () => {
401
+ const FIELD = ['alpha', 'bravo', 'charlie'];
402
+ const VALUE = undefined;
403
+ const CONDITION = getCondition(op, VALUE);
404
404
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
405
405
  });
406
- it('should match any value when the field is an empty string', function () {
407
- var FIELD = '';
408
- var VALUE = 'alpha';
409
- var CONDITION = getCondition(op, VALUE);
406
+ it('should match any value when the field is an empty string', () => {
407
+ const FIELD = '';
408
+ const VALUE = 'alpha';
409
+ const CONDITION = getCondition(op, VALUE);
410
410
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
411
411
  });
412
- it('should match a number that is missing from the field array', function () {
413
- var FIELD = [1, 2, 3];
414
- var VALUE = 4;
415
- var CONDITION = getCondition(op, VALUE);
412
+ it('should match a number that is missing from the field array', () => {
413
+ const FIELD = [1, 2, 3];
414
+ const VALUE = 4;
415
+ const CONDITION = getCondition(op, VALUE);
416
416
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
417
417
  });
418
- it('should match a substring that is missing from the field string', function () {
419
- var FIELD = 'alphabravocharlie';
420
- var VALUE = 'delta';
421
- var CONDITION = getCondition(op, VALUE);
418
+ it('should match a substring that is missing from the field string', () => {
419
+ const FIELD = 'alphabravocharlie';
420
+ const VALUE = 'delta';
421
+ const CONDITION = getCondition(op, VALUE);
422
422
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
423
423
  });
424
- it('should match any value when the field is null', function () {
425
- var FIELD = null;
426
- var VALUE = 'alpha';
427
- var CONDITION = getCondition(op, VALUE);
424
+ it('should match any value when the field is null', () => {
425
+ const FIELD = null;
426
+ const VALUE = 'alpha';
427
+ const CONDITION = getCondition(op, VALUE);
428
428
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
429
429
  });
430
- it('should match any value when the field is undefined', function () {
431
- var FIELD = undefined;
432
- var VALUE = 'alpha';
433
- var CONDITION = getCondition(op, VALUE);
430
+ it('should match any value when the field is undefined', () => {
431
+ const FIELD = undefined;
432
+ const VALUE = 'alpha';
433
+ const CONDITION = getCondition(op, VALUE);
434
434
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
435
435
  });
436
436
 
437
437
  // Should reject...
438
- it('should reject a string that is in the field array', function () {
439
- var FIELD = ['alpha', 'bravo', 'charlie'];
440
- var VALUE = 'alpha';
441
- var CONDITION = getCondition(op, VALUE);
438
+ it('should reject a string that is in the field array', () => {
439
+ const FIELD = ['alpha', 'bravo', 'charlie'];
440
+ const VALUE = 'alpha';
441
+ const CONDITION = getCondition(op, VALUE);
442
442
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
443
443
  });
444
- it('should reject a sub-string that is in the field array', function () {
445
- var FIELD = ['alpha', 'bravo', 'charlie'];
446
- var VALUE = 'alp';
447
- var CONDITION = getCondition(op, VALUE);
444
+ it('should reject a sub-string that is in the field array', () => {
445
+ const FIELD = ['alpha', 'bravo', 'charlie'];
446
+ const VALUE = 'alp';
447
+ const CONDITION = getCondition(op, VALUE);
448
448
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
449
449
  });
450
- it('should reject a number that is in the field array', function () {
451
- var FIELD = [1, 2, 3];
452
- var VALUE = 1;
453
- var CONDITION = getCondition(op, VALUE);
450
+ it('should reject a number that is in the field array', () => {
451
+ const FIELD = [1, 2, 3];
452
+ const VALUE = 1;
453
+ const CONDITION = getCondition(op, VALUE);
454
454
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
455
455
  });
456
- it('should reject a sub-string that is in the field string', function () {
457
- var FIELD = 'alphabravocharlie';
458
- var VALUE = 'alpha';
459
- var CONDITION = getCondition(op, VALUE);
456
+ it('should reject a sub-string that is in the field string', () => {
457
+ const FIELD = 'alphabravocharlie';
458
+ const VALUE = 'alpha';
459
+ const CONDITION = getCondition(op, VALUE);
460
460
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
461
461
  });
462
- it('should reject a string that is in the field array regardless of case', function () {
463
- var FIELD = ['Alpha', 'bravo', 'charlie'];
464
- var VALUE = 'alpha';
465
- var CONDITION = getCondition(op, VALUE);
462
+ it('should reject a string that is in the field array regardless of case', () => {
463
+ const FIELD = ['Alpha', 'bravo', 'charlie'];
464
+ const VALUE = 'alpha';
465
+ const CONDITION = getCondition(op, VALUE);
466
466
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
467
467
  });
468
468
  });
469
- describe('numerical operators', function () {
470
- it('less than should reject when value is null', function () {
471
- var CONDITION = {
469
+ describe('numerical operators', () => {
470
+ it('less than should reject when value is null', () => {
471
+ const CONDITION = {
472
472
  op: '<',
473
473
  value: '100'
474
474
  };
475
475
  expect((0, _meetsCondition.default)(CONDITION, null)).toBeFalsy();
476
476
  });
477
- it('less than should reject when condition.value is null', function () {
478
- var CONDITION = {
477
+ it('less than should reject when condition.value is null', () => {
478
+ const CONDITION = {
479
479
  op: '<',
480
480
  value: null
481
481
  };
482
482
  expect((0, _meetsCondition.default)(CONDITION, '100')).toBeFalsy();
483
483
  });
484
- it('less than should reject when condition.value and value are null', function () {
485
- var CONDITION = {
484
+ it('less than should reject when condition.value and value are null', () => {
485
+ const CONDITION = {
486
486
  op: '<',
487
487
  value: null
488
488
  };
489
489
  expect((0, _meetsCondition.default)(CONDITION, null)).toBeFalsy();
490
490
  });
491
- it('less than should reject when value is greater than condition.value', function () {
492
- var CONDITION = {
491
+ it('less than should reject when value is greater than condition.value', () => {
492
+ const CONDITION = {
493
493
  op: '<',
494
494
  value: '100'
495
495
  };
496
496
  expect((0, _meetsCondition.default)(CONDITION, '101')).toBeFalsy();
497
497
  });
498
- it('less than should accept when value is less than condition.value', function () {
499
- var CONDITION = {
498
+ it('less than should accept when value is less than condition.value', () => {
499
+ const CONDITION = {
500
500
  op: '<',
501
501
  value: '100'
502
502
  };
503
503
  expect((0, _meetsCondition.default)(CONDITION, '99')).toBeTruthy();
504
504
  });
505
- it('less than should handle values with commas in', function () {
506
- var CONDITION = {
505
+ it('less than should handle values with commas in', () => {
506
+ const CONDITION = {
507
507
  op: '<',
508
508
  value: '10,000'
509
509
  };
510
510
  expect((0, _meetsCondition.default)(CONDITION, '9,999')).toBeTruthy();
511
511
  });
512
- it('greater than should reject when value is null', function () {
513
- var CONDITION = {
512
+ it('greater than should reject when value is null', () => {
513
+ const CONDITION = {
514
514
  op: '>',
515
515
  value: '100'
516
516
  };
517
517
  expect((0, _meetsCondition.default)(CONDITION, null)).toBeFalsy();
518
518
  });
519
- it('greater than should reject when condition.value is null', function () {
520
- var CONDITION = {
519
+ it('greater than should reject when condition.value is null', () => {
520
+ const CONDITION = {
521
521
  op: '>',
522
522
  value: null
523
523
  };
524
524
  expect((0, _meetsCondition.default)(CONDITION, '100')).toBeFalsy();
525
525
  });
526
- it('greater than should reject when condition.value and value are null', function () {
527
- var CONDITION = {
526
+ it('greater than should reject when condition.value and value are null', () => {
527
+ const CONDITION = {
528
528
  op: '>',
529
529
  value: null
530
530
  };
531
531
  expect((0, _meetsCondition.default)(CONDITION, null)).toBeFalsy();
532
532
  });
533
- it('greater than should reject when value is less than condition.value', function () {
534
- var CONDITION = {
533
+ it('greater than should reject when value is less than condition.value', () => {
534
+ const CONDITION = {
535
535
  op: '>',
536
536
  value: '100'
537
537
  };
538
538
  expect((0, _meetsCondition.default)(CONDITION, '99')).toBeFalsy();
539
539
  });
540
- it('greater than should accept when value is greater than condition.value', function () {
541
- var CONDITION = {
540
+ it('greater than should accept when value is greater than condition.value', () => {
541
+ const CONDITION = {
542
542
  op: '>',
543
543
  value: '100'
544
544
  };
545
545
  expect((0, _meetsCondition.default)(CONDITION, '101')).toBeTruthy();
546
546
  });
547
- it('greater than should handle values with commas in', function () {
548
- var CONDITION = {
547
+ it('greater than should handle values with commas in', () => {
548
+ const CONDITION = {
549
549
  op: '>',
550
550
  value: '10,000'
551
551
  };
552
552
  expect((0, _meetsCondition.default)(CONDITION, '10,000,000')).toBeTruthy();
553
553
  });
554
554
  });
555
- describe('operator includes', function () {
556
- it('should accept a string that exists within the value', function () {
557
- var VALUE = ['red', 'green', 'blue'];
558
- var CONDITION = {
555
+ describe('operator includes', () => {
556
+ it('should accept a string that exists within the value', () => {
557
+ const VALUE = ['red', 'green', 'blue'];
558
+ const CONDITION = {
559
559
  op: 'includes',
560
560
  value: 'blue'
561
561
  };
562
562
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
563
563
  });
564
- it('should accept a number that exists within the value', function () {
565
- var VALUE = [4, 5, 6];
566
- var CONDITION = {
564
+ it('should accept a number that exists within the value', () => {
565
+ const VALUE = [4, 5, 6];
566
+ const CONDITION = {
567
567
  op: 'includes',
568
568
  value: 6
569
569
  };
570
570
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
571
571
  });
572
- it('should reject a string that doesnt exist within the value', function () {
573
- var VALUE = ['red', 'green', 'blue'];
574
- var CONDITION = {
572
+ it('should reject a string that doesnt exist within the value', () => {
573
+ const VALUE = ['red', 'green', 'blue'];
574
+ const CONDITION = {
575
575
  op: 'includes',
576
576
  value: 'purple'
577
577
  };
578
578
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
579
579
  });
580
- it('should reject a number that doesnt exist within the value', function () {
581
- var VALUE = [4, 5, 6];
582
- var CONDITION = {
580
+ it('should reject a number that doesnt exist within the value', () => {
581
+ const VALUE = [4, 5, 6];
582
+ const CONDITION = {
583
583
  op: 'includes',
584
584
  value: 7
585
585
  };
586
586
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
587
587
  });
588
- it('should reject a value that is not an array', function () {
589
- var VALUE = 'badValue';
590
- var CONDITION = {
588
+ it('should reject a value that is not an array', () => {
589
+ const VALUE = 'badValue';
590
+ const CONDITION = {
591
591
  op: 'includes',
592
592
  value: 7
593
593
  };
594
594
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
595
595
  });
596
- it('should reject an empty array', function () {
597
- var VALUE = [];
598
- var CONDITION = {
596
+ it('should reject an empty array', () => {
597
+ const VALUE = [];
598
+ const CONDITION = {
599
599
  op: 'includes',
600
600
  value: 7
601
601
  };
602
602
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
603
603
  });
604
604
  });
605
- describe('operator !includes', function () {
606
- it('should reject a string that exists within the value', function () {
607
- var VALUE = ['red', 'green', 'blue'];
608
- var CONDITION = {
605
+ describe('operator !includes', () => {
606
+ it('should reject a string that exists within the value', () => {
607
+ const VALUE = ['red', 'green', 'blue'];
608
+ const CONDITION = {
609
609
  op: '!includes',
610
610
  value: 'blue'
611
611
  };
612
612
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
613
613
  });
614
- it('should reject a number that exists within the value', function () {
615
- var VALUE = [4, 5, 6];
616
- var CONDITION = {
614
+ it('should reject a number that exists within the value', () => {
615
+ const VALUE = [4, 5, 6];
616
+ const CONDITION = {
617
617
  op: '!includes',
618
618
  value: 6
619
619
  };
620
620
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
621
621
  });
622
- it('should accept a string that doesnt exist within the value', function () {
623
- var VALUE = ['red', 'green', 'blue'];
624
- var CONDITION = {
622
+ it('should accept a string that doesnt exist within the value', () => {
623
+ const VALUE = ['red', 'green', 'blue'];
624
+ const CONDITION = {
625
625
  op: '!includes',
626
626
  value: 'purple'
627
627
  };
628
628
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
629
629
  });
630
- it('should accept a number that doesnt exist within the value', function () {
631
- var VALUE = [4, 5, 6];
632
- var CONDITION = {
630
+ it('should accept a number that doesnt exist within the value', () => {
631
+ const VALUE = [4, 5, 6];
632
+ const CONDITION = {
633
633
  op: '!includes',
634
634
  value: 7
635
635
  };
636
636
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
637
637
  });
638
- it('should accept a value that is not an array', function () {
639
- var VALUE = 'badValue';
640
- var CONDITION = {
638
+ it('should accept a value that is not an array', () => {
639
+ const VALUE = 'badValue';
640
+ const CONDITION = {
641
641
  op: '!includes',
642
642
  value: 7
643
643
  };
644
644
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
645
645
  });
646
- it('should accept an empty array', function () {
647
- var VALUE = [];
648
- var CONDITION = {
646
+ it('should accept an empty array', () => {
647
+ const VALUE = [];
648
+ const CONDITION = {
649
649
  op: '!includes',
650
650
  value: 7
651
651
  };
652
652
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
653
653
  });
654
654
  });
655
- describe('operator includesObjectProp', function () {
656
- it('should accept a property that exists within one of the objects in the value', function () {
657
- var VALUE = [{
655
+ describe('operator includesObjectProp', () => {
656
+ it('should accept a property that exists within one of the objects in the value', () => {
657
+ const VALUE = [{
658
658
  id: 1
659
659
  }, {
660
660
  id: 2
661
661
  }, {
662
662
  id: 3
663
663
  }];
664
- var CONDITION = {
664
+ const CONDITION = {
665
665
  op: 'includesObjectProp',
666
666
  key: 'id',
667
667
  value: 2
668
668
  };
669
669
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
670
670
  });
671
- it('should reject a property that doesnt exist within one of the objects in the value', function () {
672
- var VALUE = [{
671
+ it('should reject a property that doesnt exist within one of the objects in the value', () => {
672
+ const VALUE = [{
673
673
  id: 1
674
674
  }, {
675
675
  id: 2
676
676
  }, {
677
677
  id: 3
678
678
  }];
679
- var CONDITION = {
679
+ const CONDITION = {
680
680
  op: 'includesObjectProp',
681
681
  key: 'id',
682
682
  value: 4
683
683
  };
684
684
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
685
685
  });
686
- it('should reject a value that is not an array', function () {
687
- var VALUE = 'badValue';
688
- var CONDITION = {
686
+ it('should reject a value that is not an array', () => {
687
+ const VALUE = 'badValue';
688
+ const CONDITION = {
689
689
  op: 'includesObjectProp',
690
690
  key: 'id',
691
691
  value: 7
692
692
  };
693
693
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
694
694
  });
695
- it('should reject an empty array', function () {
696
- var VALUE = [];
697
- var CONDITION = {
695
+ it('should reject an empty array', () => {
696
+ const VALUE = [];
697
+ const CONDITION = {
698
698
  op: 'includesObjectProp',
699
699
  key: 'id',
700
700
  value: 7
@@ -702,49 +702,49 @@ describe('utils.Condition.meetsCondition', function () {
702
702
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
703
703
  });
704
704
  });
705
- describe('operator !includesObjectProp', function () {
706
- it('should reject a property that exists within one of the objects in the value', function () {
707
- var VALUE = [{
705
+ describe('operator !includesObjectProp', () => {
706
+ it('should reject a property that exists within one of the objects in the value', () => {
707
+ const VALUE = [{
708
708
  id: 1
709
709
  }, {
710
710
  id: 2
711
711
  }, {
712
712
  id: 3
713
713
  }];
714
- var CONDITION = {
714
+ const CONDITION = {
715
715
  op: '!includesObjectProp',
716
716
  key: 'id',
717
717
  value: 2
718
718
  };
719
719
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
720
720
  });
721
- it('should accept a property that doesnt exist within one of the objects in the value', function () {
722
- var VALUE = [{
721
+ it('should accept a property that doesnt exist within one of the objects in the value', () => {
722
+ const VALUE = [{
723
723
  id: 1
724
724
  }, {
725
725
  id: 2
726
726
  }, {
727
727
  id: 3
728
728
  }];
729
- var CONDITION = {
729
+ const CONDITION = {
730
730
  op: '!includesObjectProp',
731
731
  key: 'id',
732
732
  value: 4
733
733
  };
734
734
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
735
735
  });
736
- it('should accept a value that is not an array', function () {
737
- var VALUE = 'badValue';
738
- var CONDITION = {
736
+ it('should accept a value that is not an array', () => {
737
+ const VALUE = 'badValue';
738
+ const CONDITION = {
739
739
  op: '!includesObjectProp',
740
740
  key: 'id',
741
741
  value: 7
742
742
  };
743
743
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
744
744
  });
745
- it('should accept an empty array', function () {
746
- var VALUE = [];
747
- var CONDITION = {
745
+ it('should accept an empty array', () => {
746
+ const VALUE = [];
747
+ const CONDITION = {
748
748
  op: '!includesObjectProp',
749
749
  key: 'id',
750
750
  value: 7
@@ -752,124 +752,124 @@ describe('utils.Condition.meetsCondition', function () {
752
752
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
753
753
  });
754
754
  });
755
- describe('operator includesAllOf', function () {
756
- it('should reject when value is not an array', function () {
757
- var VALUE = 'Not an array';
758
- var CONDITION = {
755
+ describe('operator includesAllOf', () => {
756
+ it('should reject when value is not an array', () => {
757
+ const VALUE = 'Not an array';
758
+ const CONDITION = {
759
759
  op: 'includesAllOf',
760
760
  values: ['a', 'c']
761
761
  };
762
762
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
763
763
  });
764
- it('should reject when value is an empty array', function () {
765
- var VALUE = [];
766
- var CONDITION = {
764
+ it('should reject when value is an empty array', () => {
765
+ const VALUE = [];
766
+ const CONDITION = {
767
767
  op: 'includesAllOf',
768
768
  values: ['a', 'c']
769
769
  };
770
770
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
771
771
  });
772
- it('should accept when the list of values is an empty array', function () {
773
- var VALUE = ['a', 'b', 'c'];
774
- var CONDITION = {
772
+ it('should accept when the list of values is an empty array', () => {
773
+ const VALUE = ['a', 'b', 'c'];
774
+ const CONDITION = {
775
775
  op: 'includesAllOf',
776
776
  values: []
777
777
  };
778
778
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
779
779
  });
780
- it('should accept a list of values that are all in field', function () {
781
- var VALUE = ['a', 'b', 'c'];
782
- var CONDITION = {
780
+ it('should accept a list of values that are all in field', () => {
781
+ const VALUE = ['a', 'b', 'c'];
782
+ const CONDITION = {
783
783
  op: 'includesAllOf',
784
784
  values: ['a', 'c']
785
785
  };
786
786
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
787
787
  });
788
- it('should reject a list of values if any are missing from field', function () {
789
- var VALUE = ['a', 'b', 'c'];
790
- var CONDITION = {
788
+ it('should reject a list of values if any are missing from field', () => {
789
+ const VALUE = ['a', 'b', 'c'];
790
+ const CONDITION = {
791
791
  op: 'includesAllOf',
792
792
  values: ['a', 'd']
793
793
  };
794
794
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
795
795
  });
796
796
  });
797
- describe('operator !includesAllOf', function () {
798
- it('should accept when value is not an array', function () {
799
- var VALUE = 'Not an array';
800
- var CONDITION = {
797
+ describe('operator !includesAllOf', () => {
798
+ it('should accept when value is not an array', () => {
799
+ const VALUE = 'Not an array';
800
+ const CONDITION = {
801
801
  op: '!includesAllOf',
802
802
  values: ['a', 'c']
803
803
  };
804
804
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
805
805
  });
806
- it('should accept when value is an empty array', function () {
807
- var VALUE = [];
808
- var CONDITION = {
806
+ it('should accept when value is an empty array', () => {
807
+ const VALUE = [];
808
+ const CONDITION = {
809
809
  op: '!includesAllOf',
810
810
  values: ['a', 'c']
811
811
  };
812
812
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
813
813
  });
814
- it('should reject when the list of values is an empty array', function () {
815
- var VALUE = ['a', 'b', 'c'];
816
- var CONDITION = {
814
+ it('should reject when the list of values is an empty array', () => {
815
+ const VALUE = ['a', 'b', 'c'];
816
+ const CONDITION = {
817
817
  op: '!includesAllOf',
818
818
  values: []
819
819
  };
820
820
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
821
821
  });
822
- it('should reject a list of values that are all in value', function () {
823
- var VALUE = ['a', 'b', 'c'];
824
- var CONDITION = {
822
+ it('should reject a list of values that are all in value', () => {
823
+ const VALUE = ['a', 'b', 'c'];
824
+ const CONDITION = {
825
825
  op: '!includesAllOf',
826
826
  values: ['a', 'c']
827
827
  };
828
828
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
829
829
  });
830
- it('should accept a list of values if any are missing from value', function () {
831
- var VALUE = ['a', 'b', 'c'];
832
- var CONDITION = {
830
+ it('should accept a list of values if any are missing from value', () => {
831
+ const VALUE = ['a', 'b', 'c'];
832
+ const CONDITION = {
833
833
  op: '!includesAllOf',
834
834
  values: ['a', 'd']
835
835
  };
836
836
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
837
837
  });
838
838
  });
839
- describe('unknown operator', function () {
840
- var op = 'definitely_not_a_real_operator';
841
- it('should reject anything regardless of the value', function () {
842
- var CONDITION = getCondition(op, 'a');
843
- TEST_VALUES.forEach(function (value) {
839
+ describe('unknown operator', () => {
840
+ const op = 'definitely_not_a_real_operator';
841
+ it('should reject anything regardless of the value', () => {
842
+ const CONDITION = getCondition(op, 'a');
843
+ TEST_VALUES.forEach(value => {
844
844
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeFalsy();
845
845
  });
846
846
  });
847
- it('should accept anything even with a null value', function () {
848
- var CONDITION = getCondition(op, null);
849
- TEST_VALUES.forEach(function (value) {
847
+ it('should accept anything even with a null value', () => {
848
+ const CONDITION = getCondition(op, null);
849
+ TEST_VALUES.forEach(value => {
850
850
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeFalsy();
851
851
  });
852
852
  });
853
- it('should accept anything even with a undefined value', function () {
854
- var CONDITION = getCondition(op, null);
855
- TEST_VALUES.forEach(function (value) {
853
+ it('should accept anything even with a undefined value', () => {
854
+ const CONDITION = getCondition(op, null);
855
+ TEST_VALUES.forEach(value => {
856
856
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeFalsy();
857
857
  });
858
858
  });
859
859
  });
860
- describe('invalid condition', function () {
861
- it('should accept anything when the condition is null', function () {
862
- TEST_VALUES.forEach(function (value) {
860
+ describe('invalid condition', () => {
861
+ it('should accept anything when the condition is null', () => {
862
+ TEST_VALUES.forEach(value => {
863
863
  expect((0, _meetsCondition.default)(null, value)).toBeTruthy();
864
864
  });
865
865
  });
866
- it('should accept anything when the condition is undefined', function () {
867
- TEST_VALUES.forEach(function (value) {
866
+ it('should accept anything when the condition is undefined', () => {
867
+ TEST_VALUES.forEach(value => {
868
868
  expect((0, _meetsCondition.default)(undefined, value)).toBeTruthy();
869
869
  });
870
870
  });
871
- it('should accept anything when the condition is not an object', function () {
872
- TEST_VALUES.forEach(function (value) {
871
+ it('should accept anything when the condition is not an object', () => {
872
+ TEST_VALUES.forEach(value => {
873
873
  expect((0, _meetsCondition.default)('condition', value)).toBeTruthy();
874
874
  });
875
875
  });