@ukhomeoffice/cop-react-form-renderer 5.45.2-alpha → 5.48.1-bravo

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 (353) hide show
  1. package/dist/components/CheckYourAnswers/Answer.js +12 -12
  2. package/dist/components/CheckYourAnswers/Answer.test.js +127 -92
  3. package/dist/components/CheckYourAnswers/CheckYourAnswers.js +131 -101
  4. package/dist/components/CheckYourAnswers/CheckYourAnswers.test.js +769 -464
  5. package/dist/components/CollectionPage/CollectionPage.js +58 -66
  6. package/dist/components/CollectionPage/CollectionPage.test.js +342 -300
  7. package/dist/components/CollectionSummary/BannerStrip.js +12 -12
  8. package/dist/components/CollectionSummary/BannerStrip.test.js +59 -63
  9. package/dist/components/CollectionSummary/CollectionSummary.js +88 -61
  10. package/dist/components/CollectionSummary/CollectionSummary.test.js +96 -102
  11. package/dist/components/CollectionSummary/Confirmation.js +12 -14
  12. package/dist/components/CollectionSummary/Confirmation.test.js +63 -68
  13. package/dist/components/CollectionSummary/SummaryCard.js +148 -109
  14. package/dist/components/CollectionSummary/SummaryCard.scss +1 -1
  15. package/dist/components/CollectionSummary/SummaryCard.test.js +927 -905
  16. package/dist/components/CollectionSummary/SummaryCardValidationContext.js +29 -23
  17. package/dist/components/CollectionSummary/SummaryCardValidationContext.test.js +73 -61
  18. package/dist/components/FormComponent/Collection.js +107 -73
  19. package/dist/components/FormComponent/Collection.test.js +945 -809
  20. package/dist/components/FormComponent/Container.js +38 -40
  21. package/dist/components/FormComponent/Container.test.js +345 -314
  22. package/dist/components/FormComponent/FormComponent.js +70 -67
  23. package/dist/components/FormComponent/FormComponent.test.js +342 -284
  24. package/dist/components/FormComponent/helpers/addLabel.js +7 -4
  25. package/dist/components/FormComponent/helpers/getComponentDisabled.js +1 -1
  26. package/dist/components/FormComponent/helpers/getComponentDisabled.test.js +7 -7
  27. package/dist/components/FormComponent/helpers/getComponentError.js +5 -3
  28. package/dist/components/FormComponent/helpers/getComponentError.test.js +14 -14
  29. package/dist/components/FormComponent/helpers/getComponentFieldSet.js +4 -3
  30. package/dist/components/FormComponent/helpers/getComponentFieldSet.test.js +6 -6
  31. package/dist/components/FormComponent/helpers/index.js +4 -4
  32. package/dist/components/FormPage/FormPage.js +80 -65
  33. package/dist/components/FormPage/FormPage.test.js +163 -127
  34. package/dist/components/FormRenderer/FormRenderer.js +181 -144
  35. package/dist/components/FormRenderer/FormRenderer.test.js +1115 -730
  36. package/dist/components/FormRenderer/handlers/cyaAction.js +2 -2
  37. package/dist/components/FormRenderer/handlers/getPageId.js +3 -1
  38. package/dist/components/FormRenderer/handlers/getPageId.test.js +14 -14
  39. package/dist/components/FormRenderer/handlers/handlers.test.js +32 -32
  40. package/dist/components/FormRenderer/handlers/index.js +1 -1
  41. package/dist/components/FormRenderer/handlers/navigate.js +3 -3
  42. package/dist/components/FormRenderer/handlers/submissionError.js +1 -1
  43. package/dist/components/FormRenderer/helpers/canActionProceed.js +5 -1
  44. package/dist/components/FormRenderer/helpers/canActionProceed.test.js +47 -11
  45. package/dist/components/FormRenderer/helpers/canCYASubmit.js +3 -1
  46. package/dist/components/FormRenderer/helpers/canCYASubmit.test.js +20 -16
  47. package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.js +22 -17
  48. package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.test.js +16 -16
  49. package/dist/components/FormRenderer/helpers/getCYA.js +5 -3
  50. package/dist/components/FormRenderer/helpers/getCYA.test.js +11 -11
  51. package/dist/components/FormRenderer/helpers/getFormState.js +7 -5
  52. package/dist/components/FormRenderer/helpers/getFormState.test.js +10 -10
  53. package/dist/components/FormRenderer/helpers/getNextPageId.js +24 -13
  54. package/dist/components/FormRenderer/helpers/getNextPageId.test.js +67 -67
  55. package/dist/components/FormRenderer/helpers/getPage.js +4 -2
  56. package/dist/components/FormRenderer/helpers/getPage.test.js +11 -11
  57. package/dist/components/FormRenderer/helpers/getRelevantPages.js +9 -7
  58. package/dist/components/FormRenderer/helpers/getRelevantPages.test.js +14 -14
  59. package/dist/components/FormRenderer/helpers/getSubmissionStatus.js +5 -5
  60. package/dist/components/FormRenderer/helpers/getSubmissionStatus.test.js +91 -97
  61. package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.js +60 -62
  62. package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.test.js +73 -71
  63. package/dist/components/FormRenderer/helpers/index.js +1 -1
  64. package/dist/components/FormRenderer/onCYAAction.js +51 -59
  65. package/dist/components/FormRenderer/onCYAAction.test.js +152 -164
  66. package/dist/components/FormRenderer/onPageAction.js +40 -44
  67. package/dist/components/FormRenderer/onPageAction.test.js +206 -223
  68. package/dist/components/FormRenderer/onTaskAction.js +13 -9
  69. package/dist/components/FormRenderer/onTaskAction.test.js +88 -93
  70. package/dist/components/PageActions/ActionButton.js +15 -12
  71. package/dist/components/PageActions/ActionButton.test.js +78 -56
  72. package/dist/components/PageActions/PageActions.js +10 -10
  73. package/dist/components/PageActions/PageActions.test.js +115 -86
  74. package/dist/components/SummaryList/GroupAction.js +17 -9
  75. package/dist/components/SummaryList/GroupAction.test.js +33 -37
  76. package/dist/components/SummaryList/RowAction.js +16 -11
  77. package/dist/components/SummaryList/RowAction.test.js +33 -37
  78. package/dist/components/SummaryList/SummaryList.js +26 -21
  79. package/dist/components/SummaryList/SummaryList.test.js +166 -143
  80. package/dist/components/SummaryList/SummaryListHeadingRow.js +4 -6
  81. package/dist/components/SummaryList/SummaryListRow.js +4 -6
  82. package/dist/components/SummaryList/SummaryListTitleRow.js +3 -5
  83. package/dist/components/SummaryList/helpers/getGroupActionAttributes.js +5 -3
  84. package/dist/components/SummaryList/helpers/getGroupActionAttributes.test.js +22 -22
  85. package/dist/components/SummaryList/helpers/getRowActionAttributes.js +5 -3
  86. package/dist/components/SummaryList/helpers/getRowActionAttributes.test.js +22 -22
  87. package/dist/components/SummaryList/helpers/index.js +1 -1
  88. package/dist/components/TaskList/Task.js +29 -19
  89. package/dist/components/TaskList/Task.test.js +76 -83
  90. package/dist/components/TaskList/TaskList.js +71 -45
  91. package/dist/components/TaskList/TaskList.test.js +111 -113
  92. package/dist/components/TaskList/TaskState.js +5 -7
  93. package/dist/components/TaskList/TaskState.test.js +45 -52
  94. package/dist/components/index.js +7 -7
  95. package/dist/context/HooksContext/HooksContext.js +79 -58
  96. package/dist/context/HooksContext/HooksContext.test.js +35 -26
  97. package/dist/context/HooksContext/index.js +4 -3
  98. package/dist/context/ValidationContext/ValidationContext.js +72 -32
  99. package/dist/context/ValidationContext/ValidationContext.test.js +59 -47
  100. package/dist/context/ValidationContext/index.js +4 -3
  101. package/dist/context/index.js +2 -2
  102. package/dist/hooks/index.js +10 -9
  103. package/dist/hooks/useAxios.js +40 -14
  104. package/dist/hooks/useGetRequest.js +97 -61
  105. package/dist/hooks/useHooks.js +3 -1
  106. package/dist/hooks/useRefData.js +39 -26
  107. package/dist/hooks/useValidation.js +3 -1
  108. package/dist/index.js +14 -13
  109. package/dist/models/CollectionLabels.js +1 -1
  110. package/dist/models/ComponentTypes.js +25 -25
  111. package/dist/models/EventTypes.js +4 -4
  112. package/dist/models/FormPages.js +4 -4
  113. package/dist/models/FormTypes.js +8 -8
  114. package/dist/models/HubFormats.js +3 -3
  115. package/dist/models/PageAction.js +38 -44
  116. package/dist/models/TaskStates.js +28 -30
  117. package/dist/models/index.js +9 -9
  118. package/dist/setupTests.js +31 -30
  119. package/dist/utils/CheckYourAnswers/getCYAAction.js +5 -5
  120. package/dist/utils/CheckYourAnswers/getCYAAction.test.js +54 -52
  121. package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.js +25 -15
  122. package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.test.js +35 -33
  123. package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.js +31 -17
  124. package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.test.js +44 -42
  125. package/dist/utils/CheckYourAnswers/getCYARow.js +6 -6
  126. package/dist/utils/CheckYourAnswers/getCYARow.test.js +86 -86
  127. package/dist/utils/CheckYourAnswers/getCYARowForGroup.js +24 -18
  128. package/dist/utils/CheckYourAnswers/getCYARowForGroup.test.js +16 -15
  129. package/dist/utils/CheckYourAnswers/getCYARowsForCollection.js +36 -33
  130. package/dist/utils/CheckYourAnswers/getCYARowsForCollection.test.js +60 -58
  131. package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.js +88 -79
  132. package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.test.js +124 -146
  133. package/dist/utils/CheckYourAnswers/getCYARowsForContainer.js +20 -25
  134. package/dist/utils/CheckYourAnswers/getCYARowsForContainer.test.js +97 -103
  135. package/dist/utils/CheckYourAnswers/getCYARowsForPage.js +18 -13
  136. package/dist/utils/CheckYourAnswers/getCYARowsForPage.test.js +76 -70
  137. package/dist/utils/CheckYourAnswers/index.js +1 -1
  138. package/dist/utils/CheckYourAnswers/showComponentCYA.js +4 -4
  139. package/dist/utils/CheckYourAnswers/showComponentCYA.test.js +24 -24
  140. package/dist/utils/CollectionPage/addCollectionPageEntry.js +1 -1
  141. package/dist/utils/CollectionPage/addCollectionPageEntry.test.js +5 -5
  142. package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.js +2 -2
  143. package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.test.js +17 -17
  144. package/dist/utils/CollectionPage/duplicateCollectionPageEntry.js +18 -9
  145. package/dist/utils/CollectionPage/duplicateCollectionPageEntry.test.js +22 -27
  146. package/dist/utils/CollectionPage/getCollectionPageActiveId.js +2 -2
  147. package/dist/utils/CollectionPage/getCollectionPageActiveId.test.js +10 -10
  148. package/dist/utils/CollectionPage/getCollectionPageActiveIndex.js +11 -7
  149. package/dist/utils/CollectionPage/getCollectionPageActiveIndex.test.js +22 -22
  150. package/dist/utils/CollectionPage/getCollectionPageData.js +12 -8
  151. package/dist/utils/CollectionPage/getCollectionPageData.test.js +19 -19
  152. package/dist/utils/CollectionPage/getQuickEditPage.js +19 -19
  153. package/dist/utils/CollectionPage/getQuickEditPage.test.js +16 -12
  154. package/dist/utils/CollectionPage/index.js +1 -1
  155. package/dist/utils/CollectionPage/mergeCollectionPages.js +30 -29
  156. package/dist/utils/CollectionPage/mergeCollectionPages.test.js +17 -17
  157. package/dist/utils/CollectionPage/removeCollectionPageEntry.js +6 -4
  158. package/dist/utils/CollectionPage/removeCollectionPageEntry.test.js +10 -10
  159. package/dist/utils/CollectionPage/setCollectionPageData.js +12 -8
  160. package/dist/utils/CollectionPage/setCollectionPageData.test.js +17 -17
  161. package/dist/utils/Component/addShowWhen.js +8 -4
  162. package/dist/utils/Component/addShowWhen.test.js +37 -37
  163. package/dist/utils/Component/applyToComponentTree.js +18 -18
  164. package/dist/utils/Component/applyToComponentTree.test.js +32 -27
  165. package/dist/utils/Component/cleanAttributes.js +13 -10
  166. package/dist/utils/Component/cleanAttributes.test.js +18 -17
  167. package/dist/utils/Component/elevateNestedComponents.js +5 -5
  168. package/dist/utils/Component/elevateNestedComponents.test.js +30 -30
  169. package/dist/utils/Component/getComponent.js +95 -88
  170. package/dist/utils/Component/getComponentTests/getComponent.autocomplete.test.js +17 -18
  171. package/dist/utils/Component/getComponentTests/getComponent.calculation.test.js +59 -46
  172. package/dist/utils/Component/getComponentTests/getComponent.checkboxes.test.js +48 -39
  173. package/dist/utils/Component/getComponentTests/getComponent.date.test.js +33 -23
  174. package/dist/utils/Component/getComponentTests/getComponent.details.test.js +18 -20
  175. package/dist/utils/Component/getComponentTests/getComponent.email.test.js +22 -17
  176. package/dist/utils/Component/getComponentTests/getComponent.file.test.js +25 -20
  177. package/dist/utils/Component/getComponentTests/getComponent.heading.test.js +9 -10
  178. package/dist/utils/Component/getComponentTests/getComponent.html.test.js +15 -17
  179. package/dist/utils/Component/getComponentTests/getComponent.insetText.test.js +8 -9
  180. package/dist/utils/Component/getComponentTests/getComponent.list.test.js +15 -17
  181. package/dist/utils/Component/getComponentTests/getComponent.multifile.test.js +26 -22
  182. package/dist/utils/Component/getComponentTests/getComponent.nested.test.js +175 -155
  183. package/dist/utils/Component/getComponentTests/getComponent.paragraph.test.js +15 -17
  184. package/dist/utils/Component/getComponentTests/getComponent.phoneNumber.test.js +22 -17
  185. package/dist/utils/Component/getComponentTests/getComponent.radios.test.js +70 -57
  186. package/dist/utils/Component/getComponentTests/getComponent.select.test.js +22 -17
  187. package/dist/utils/Component/getComponentTests/getComponent.text.test.js +22 -17
  188. package/dist/utils/Component/getComponentTests/getComponent.textArea.test.js +38 -31
  189. package/dist/utils/Component/getComponentTests/getComponent.time.test.js +29 -20
  190. package/dist/utils/Component/getComponentTests/getComponent.unknown.test.js +2 -2
  191. package/dist/utils/Component/getComponentTests/getComponent.warningText.test.js +8 -9
  192. package/dist/utils/Component/getDefaultValue.js +8 -6
  193. package/dist/utils/Component/getDefaultValue.test.js +12 -12
  194. package/dist/utils/Component/getDefaultValueFromConfig.js +22 -23
  195. package/dist/utils/Component/getDefaultValueFromConfig.test.js +31 -31
  196. package/dist/utils/Component/index.js +1 -1
  197. package/dist/utils/Component/isEditable.js +4 -2
  198. package/dist/utils/Component/isEditable.test.js +15 -14
  199. package/dist/utils/Component/optionIsSelected.js +1 -1
  200. package/dist/utils/Component/optionIsSelected.test.js +9 -9
  201. package/dist/utils/Component/setupContainerComponentsPath.js +29 -27
  202. package/dist/utils/Component/setupContainerComponentsPath.test.js +11 -11
  203. package/dist/utils/Component/showComponent.js +1 -1
  204. package/dist/utils/Component/showComponent.test.js +28 -28
  205. package/dist/utils/Component/wrapInFormGroup.js +2 -2
  206. package/dist/utils/Condition/index.js +1 -1
  207. package/dist/utils/Condition/meetsAllConditions.js +7 -7
  208. package/dist/utils/Condition/meetsAllConditions.test.js +17 -17
  209. package/dist/utils/Condition/meetsCondition.js +17 -14
  210. package/dist/utils/Condition/meetsCondition.test.js +376 -376
  211. package/dist/utils/Condition/meetsOneCondition.js +5 -5
  212. package/dist/utils/Condition/meetsOneCondition.test.js +16 -16
  213. package/dist/utils/Condition/setupConditions.js +18 -13
  214. package/dist/utils/Condition/setupConditions.test.js +7 -7
  215. package/dist/utils/Container/getEditableComponents.js +5 -3
  216. package/dist/utils/Container/getEditableComponents.test.js +45 -43
  217. package/dist/utils/Container/index.js +1 -1
  218. package/dist/utils/Container/setupNesting.js +20 -16
  219. package/dist/utils/Container/setupNesting.test.js +30 -27
  220. package/dist/utils/Container/showContainer.js +7 -3
  221. package/dist/utils/Container/showContainer.test.js +30 -30
  222. package/dist/utils/Data/applyFormula.js +48 -38
  223. package/dist/utils/Data/applyFormula.test.js +20 -20
  224. package/dist/utils/Data/getAutocompleteSource.js +26 -18
  225. package/dist/utils/Data/getAutocompleteSource.test.js +86 -80
  226. package/dist/utils/Data/getDataPath.js +28 -18
  227. package/dist/utils/Data/getDataPath.test.js +12 -12
  228. package/dist/utils/Data/getOptions.js +25 -19
  229. package/dist/utils/Data/getOptions.test.js +20 -20
  230. package/dist/utils/Data/getSourceData.js +19 -6
  231. package/dist/utils/Data/getSourceData.test.js +80 -84
  232. package/dist/utils/Data/index.js +1 -1
  233. package/dist/utils/Data/refDataToOptions.js +13 -10
  234. package/dist/utils/Data/refDataToOptions.test.js +19 -19
  235. package/dist/utils/Data/setDataItem.js +8 -7
  236. package/dist/utils/Data/setDataItem.test.js +37 -37
  237. package/dist/utils/Data/setupFormData.js +21 -13
  238. package/dist/utils/Data/setupFormData.test.js +50 -51
  239. package/dist/utils/Data/setupRefDataUrlForComponent.js +26 -20
  240. package/dist/utils/Data/setupRefDataUrlForComponent.test.js +24 -24
  241. package/dist/utils/FormPage/applyConditionalProperties.js +9 -5
  242. package/dist/utils/FormPage/applyConditionalProperties.test.js +18 -15
  243. package/dist/utils/FormPage/getFormPage.js +16 -15
  244. package/dist/utils/FormPage/getFormPage.test.js +46 -47
  245. package/dist/utils/FormPage/getFormPages.js +12 -7
  246. package/dist/utils/FormPage/getFormPages.test.js +23 -20
  247. package/dist/utils/FormPage/getPageActions.js +15 -9
  248. package/dist/utils/FormPage/getPageActions.test.js +32 -32
  249. package/dist/utils/FormPage/getPageTitle.js +2 -2
  250. package/dist/utils/FormPage/getPageTitle.test.js +22 -22
  251. package/dist/utils/FormPage/getParagraphFromText.js +7 -5
  252. package/dist/utils/FormPage/getParagraphFromText.test.js +6 -6
  253. package/dist/utils/FormPage/index.js +1 -1
  254. package/dist/utils/FormPage/showFormPage.js +7 -3
  255. package/dist/utils/FormPage/showFormPage.test.js +32 -32
  256. package/dist/utils/FormPage/showFormPageCYA.js +1 -1
  257. package/dist/utils/FormPage/showFormPageCYA.test.js +8 -8
  258. package/dist/utils/FormPage/useComponent.js +28 -21
  259. package/dist/utils/FormPage/useComponent.test.js +79 -78
  260. package/dist/utils/Format/formatData.js +1 -1
  261. package/dist/utils/Format/formatData.test.js +18 -18
  262. package/dist/utils/Format/formatDataForComponent.js +6 -5
  263. package/dist/utils/Format/formatDataForComponent.test.js +77 -50
  264. package/dist/utils/Format/formatDataForForm.js +8 -6
  265. package/dist/utils/Format/formatDataForForm.test.js +15 -13
  266. package/dist/utils/Format/formatDataForPage.js +5 -4
  267. package/dist/utils/Format/formatDataForPage.test.js +23 -20
  268. package/dist/utils/Format/index.js +1 -1
  269. package/dist/utils/Hub/getFormHub.js +1 -1
  270. package/dist/utils/Hub/getFormHub.test.js +31 -28
  271. package/dist/utils/Hub/index.js +1 -1
  272. package/dist/utils/Meta/constants.js +2 -2
  273. package/dist/utils/Meta/documents/getDocuments.js +1 -1
  274. package/dist/utils/Meta/documents/getDocuments.test.js +16 -24
  275. package/dist/utils/Meta/documents/index.js +1 -1
  276. package/dist/utils/Meta/documents/setDocumentsForField.js +16 -14
  277. package/dist/utils/Meta/documents/setDocumentsForField.test.js +34 -68
  278. package/dist/utils/Meta/index.js +1 -1
  279. package/dist/utils/Operate/checkValueIsTruthy.js +2 -2
  280. package/dist/utils/Operate/checkValueIsTruthy.test.js +16 -16
  281. package/dist/utils/Operate/getFirstOf.js +5 -5
  282. package/dist/utils/Operate/getFirstOf.test.js +31 -31
  283. package/dist/utils/Operate/getIndexOfMatchingValueIn.js +10 -10
  284. package/dist/utils/Operate/getIndexOfMatchingValueIn.test.js +46 -46
  285. package/dist/utils/Operate/index.js +1 -1
  286. package/dist/utils/Operate/persistValueInFormData.js +3 -3
  287. package/dist/utils/Operate/persistValueInFormData.test.js +20 -22
  288. package/dist/utils/Operate/runPageOperations.js +7 -7
  289. package/dist/utils/Operate/runPageOperations.test.js +36 -35
  290. package/dist/utils/Operate/setValueInFormData.js +2 -2
  291. package/dist/utils/Operate/setValueInFormData.test.js +16 -16
  292. package/dist/utils/Operate/shouldRun.js +6 -6
  293. package/dist/utils/Operate/shouldRun.test.js +26 -21
  294. package/dist/utils/Validate/additional/conditionallyRequired.js +4 -4
  295. package/dist/utils/Validate/additional/conditionallyRequired.test.js +18 -18
  296. package/dist/utils/Validate/additional/index.js +10 -8
  297. package/dist/utils/Validate/additional/index.test.js +12 -12
  298. package/dist/utils/Validate/additional/mustBeAfter.js +2 -2
  299. package/dist/utils/Validate/additional/mustBeAfter.test.js +40 -40
  300. package/dist/utils/Validate/additional/mustBeBefore.js +2 -2
  301. package/dist/utils/Validate/additional/mustBeBefore.test.js +28 -28
  302. package/dist/utils/Validate/additional/mustBeEarlierDateTime.js +11 -7
  303. package/dist/utils/Validate/additional/mustBeEarlierDateTime.test.js +41 -37
  304. package/dist/utils/Validate/additional/mustBeGreaterThan.js +2 -2
  305. package/dist/utils/Validate/additional/mustBeGreaterThan.test.js +18 -18
  306. package/dist/utils/Validate/additional/mustBeInTheFuture.js +2 -2
  307. package/dist/utils/Validate/additional/mustBeInTheFuture.test.js +12 -12
  308. package/dist/utils/Validate/additional/mustBeInThePast.js +3 -3
  309. package/dist/utils/Validate/additional/mustBeInThePast.test.js +12 -12
  310. package/dist/utils/Validate/additional/mustBeLessThan.js +2 -2
  311. package/dist/utils/Validate/additional/mustBeLessThan.test.js +17 -17
  312. package/dist/utils/Validate/additional/mustBeLongerThan.js +1 -1
  313. package/dist/utils/Validate/additional/mustBeLongerThan.test.js +16 -16
  314. package/dist/utils/Validate/additional/mustBeNumbersOnly.js +2 -2
  315. package/dist/utils/Validate/additional/mustBeNumbersOnly.test.js +20 -20
  316. package/dist/utils/Validate/additional/mustBeShorterThan.js +1 -1
  317. package/dist/utils/Validate/additional/mustBeShorterThan.test.js +16 -16
  318. package/dist/utils/Validate/additional/mustBeUniqueInCollection.js +35 -0
  319. package/dist/utils/Validate/additional/mustBeUniqueInCollection.test.js +127 -0
  320. package/dist/utils/Validate/additional/mustEnterAtLeastOne.js +2 -2
  321. package/dist/utils/Validate/additional/mustEnterAtLeastOne.test.js +16 -14
  322. package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.js +1 -1
  323. package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.test.js +12 -12
  324. package/dist/utils/Validate/additional/mustNotContainSql.js +4 -3
  325. package/dist/utils/Validate/additional/mustNotContainSql.test.js +14 -14
  326. package/dist/utils/Validate/additional/mustSelectOnlyOne.js +2 -2
  327. package/dist/utils/Validate/additional/mustSelectOnlyOne.test.js +26 -28
  328. package/dist/utils/Validate/additional/utils.js +22 -9
  329. package/dist/utils/Validate/index.js +1 -1
  330. package/dist/utils/Validate/validateCollection.js +25 -19
  331. package/dist/utils/Validate/validateCollection.test.js +66 -74
  332. package/dist/utils/Validate/validateComponent.js +16 -18
  333. package/dist/utils/Validate/validateComponent.test.js +146 -167
  334. package/dist/utils/Validate/validateContainer.js +19 -14
  335. package/dist/utils/Validate/validateContainer.test.js +45 -49
  336. package/dist/utils/Validate/validateDate.js +17 -11
  337. package/dist/utils/Validate/validateDate.test.js +29 -28
  338. package/dist/utils/Validate/validateEmail.js +8 -6
  339. package/dist/utils/Validate/validateEmail.test.js +25 -25
  340. package/dist/utils/Validate/validateMultifile.js +7 -5
  341. package/dist/utils/Validate/validateMultifile.test.js +18 -17
  342. package/dist/utils/Validate/validatePage.js +18 -17
  343. package/dist/utils/Validate/validatePage.test.js +182 -185
  344. package/dist/utils/Validate/validateRegex.js +5 -3
  345. package/dist/utils/Validate/validateRegex.test.js +14 -14
  346. package/dist/utils/Validate/validateRequired.js +6 -4
  347. package/dist/utils/Validate/validateRequired.test.js +18 -18
  348. package/dist/utils/Validate/validateTextArea.js +6 -4
  349. package/dist/utils/Validate/validateTextArea.test.js +20 -20
  350. package/dist/utils/Validate/validateTime.js +14 -7
  351. package/dist/utils/Validate/validateTime.test.js +14 -14
  352. package/dist/utils/index.js +9 -7
  353. package/package.json +1 -1
@@ -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', () => {
8
- const getCondition = (operator, val) => {
7
+ describe('utils.Condition.meetsCondition', function () {
8
+ var getCondition = function getCondition(operator, val) {
9
9
  if (['in', 'nin'].includes(operator)) {
10
10
  return {
11
11
  op: operator,
@@ -17,759 +17,759 @@ describe('utils.Condition.meetsCondition', () => {
17
17
  value: val
18
18
  };
19
19
  };
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), () => {
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 () {
24
24
  // Should match...
25
- it('should match two nulls', () => {
26
- const VALUE = null;
27
- const CONDITION = getCondition(op, null);
25
+ it('should match two nulls', function () {
26
+ var VALUE = null;
27
+ var CONDITION = getCondition(op, null);
28
28
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
29
29
  });
30
- it('should match two undefineds', () => {
31
- const VALUE = undefined;
32
- const CONDITION = getCondition(op, undefined);
30
+ it('should match two undefineds', function () {
31
+ var VALUE = undefined;
32
+ var CONDITION = getCondition(op, undefined);
33
33
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
34
34
  });
35
- it('should match two identical strings', () => {
36
- const VALUE = 'value';
37
- const CONDITION = getCondition(op, 'value');
35
+ it('should match two identical strings', function () {
36
+ var VALUE = 'value';
37
+ var CONDITION = getCondition(op, 'value');
38
38
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
39
39
  });
40
- it('should match two empty strings', () => {
41
- const VALUE = '';
42
- const CONDITION = getCondition(op, '');
40
+ it('should match two empty strings', function () {
41
+ var VALUE = '';
42
+ var CONDITION = getCondition(op, '');
43
43
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
44
44
  });
45
- it('should match two identical numbers', () => {
46
- const VALUE = 3;
47
- const CONDITION = getCondition(op, 3);
45
+ it('should match two identical numbers', function () {
46
+ var VALUE = 3;
47
+ var CONDITION = getCondition(op, 3);
48
48
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
49
49
  });
50
- it('should match two zeroes', () => {
51
- const VALUE = 0;
52
- const CONDITION = getCondition(op, 0);
50
+ it('should match two zeroes', function () {
51
+ var VALUE = 0;
52
+ var CONDITION = getCondition(op, 0);
53
53
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
54
54
  });
55
- it('should match two boolean trues', () => {
56
- const VALUE = true;
57
- const CONDITION = getCondition(op, true);
55
+ it('should match two boolean trues', function () {
56
+ var VALUE = true;
57
+ var CONDITION = getCondition(op, true);
58
58
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
59
59
  });
60
- it('should match two boolean falses', () => {
61
- const VALUE = false;
62
- const CONDITION = getCondition(op, false);
60
+ it('should match two boolean falses', function () {
61
+ var VALUE = false;
62
+ var CONDITION = getCondition(op, false);
63
63
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
64
64
  });
65
- it('should match environmentContext value with data object', () => {
66
- const VALUE = 'Bob';
67
- const DATA = {
65
+ it('should match environmentContext value with data object', function () {
66
+ var VALUE = 'Bob';
67
+ var DATA = {
68
68
  environmentContext: {
69
69
  currentUser: 'Bob'
70
70
  }
71
71
  };
72
- const CONDITION = getCondition(op, 'field::environmentContext.currentUser');
72
+ var 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', () => {
78
- const VALUE = null;
79
- const CONDITION = getCondition(op, undefined);
77
+ it('should reject a null and undefined', function () {
78
+ var VALUE = null;
79
+ var CONDITION = getCondition(op, undefined);
80
80
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
81
81
  });
82
- it('should reject a null and empty string', () => {
83
- const VALUE = null;
84
- const CONDITION = getCondition(op, '');
82
+ it('should reject a null and empty string', function () {
83
+ var VALUE = null;
84
+ var CONDITION = getCondition(op, '');
85
85
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
86
86
  });
87
- it('should reject an undefined and empty string', () => {
88
- const VALUE = undefined;
89
- const CONDITION = getCondition(op, '');
87
+ it('should reject an undefined and empty string', function () {
88
+ var VALUE = undefined;
89
+ var 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', () => {
93
- const VALUE = ' ';
94
- const CONDITION = getCondition(op, '');
92
+ it('should reject a string of just whitespace and empty string', function () {
93
+ var VALUE = ' ';
94
+ var 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", () => {
98
- const VALUE = '3';
99
- const CONDITION = getCondition(op, 3);
97
+ it("should reject the string number '3' and the number 3", function () {
98
+ var VALUE = '3';
99
+ var 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', () => {
103
- const VALUE = true;
104
- const CONDITION = getCondition(op, 1);
102
+ it('should reject a boolean true and the number 1', function () {
103
+ var VALUE = true;
104
+ var 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', () => {
108
- const VALUE = false;
109
- const CONDITION = getCondition(op, 0);
107
+ it('should reject a boolean false and a zero', function () {
108
+ var VALUE = false;
109
+ var 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', () => {
116
- ['ne', 'neq', '!=', '<>'].forEach(op => {
117
- describe("operator ".concat(op), () => {
115
+ describe('inequality operators', function () {
116
+ ['ne', 'neq', '!=', '<>'].forEach(function (op) {
117
+ describe("operator ".concat(op), function () {
118
118
  // Should reject...
119
- it('should reject two nulls', () => {
120
- const VALUE = null;
121
- const CONDITION = getCondition(op, null);
119
+ it('should reject two nulls', function () {
120
+ var VALUE = null;
121
+ var CONDITION = getCondition(op, null);
122
122
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
123
123
  });
124
- it('should reject two undefineds', () => {
125
- const VALUE = undefined;
126
- const CONDITION = getCondition(op, undefined);
124
+ it('should reject two undefineds', function () {
125
+ var VALUE = undefined;
126
+ var CONDITION = getCondition(op, undefined);
127
127
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
128
128
  });
129
- it('should reject two identical strings', () => {
130
- const VALUE = 'value';
131
- const CONDITION = getCondition(op, 'value');
129
+ it('should reject two identical strings', function () {
130
+ var VALUE = 'value';
131
+ var CONDITION = getCondition(op, 'value');
132
132
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
133
133
  });
134
- it('should reject two empty strings', () => {
135
- const VALUE = '';
136
- const CONDITION = getCondition(op, '');
134
+ it('should reject two empty strings', function () {
135
+ var VALUE = '';
136
+ var CONDITION = getCondition(op, '');
137
137
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
138
138
  });
139
- it('should reject two identical numbers', () => {
140
- const VALUE = 3;
141
- const CONDITION = getCondition(op, 3);
139
+ it('should reject two identical numbers', function () {
140
+ var VALUE = 3;
141
+ var CONDITION = getCondition(op, 3);
142
142
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
143
143
  });
144
- it('should reject two zeroes', () => {
145
- const VALUE = 0;
146
- const CONDITION = getCondition(op, 0);
144
+ it('should reject two zeroes', function () {
145
+ var VALUE = 0;
146
+ var CONDITION = getCondition(op, 0);
147
147
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
148
148
  });
149
- it('should reject two boolean trues', () => {
150
- const VALUE = true;
151
- const CONDITION = getCondition(op, true);
149
+ it('should reject two boolean trues', function () {
150
+ var VALUE = true;
151
+ var CONDITION = getCondition(op, true);
152
152
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
153
153
  });
154
- it('should reject two boolean falses', () => {
155
- const VALUE = false;
156
- const CONDITION = getCondition(op, false);
154
+ it('should reject two boolean falses', function () {
155
+ var VALUE = false;
156
+ var CONDITION = getCondition(op, false);
157
157
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
158
158
  });
159
- it('should reject environmentContext value with data object', () => {
160
- const VALUE = 'Bob';
161
- const DATA = {
159
+ it('should reject environmentContext value with data object', function () {
160
+ var VALUE = 'Bob';
161
+ var DATA = {
162
162
  environmentContext: {
163
163
  currentUser: 'Bob'
164
164
  }
165
165
  };
166
- const CONDITION = getCondition(op, 'field::environmentContext.currentUser');
166
+ var 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', () => {
172
- const VALUE = null;
173
- const CONDITION = getCondition(op, undefined);
171
+ it('should match a null and undefined', function () {
172
+ var VALUE = null;
173
+ var CONDITION = getCondition(op, undefined);
174
174
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
175
175
  });
176
- it('should match a null and empty string', () => {
177
- const VALUE = null;
178
- const CONDITION = getCondition(op, '');
176
+ it('should match a null and empty string', function () {
177
+ var VALUE = null;
178
+ var CONDITION = getCondition(op, '');
179
179
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
180
180
  });
181
- it('should match an undefined and empty string', () => {
182
- const VALUE = undefined;
183
- const CONDITION = getCondition(op, '');
181
+ it('should match an undefined and empty string', function () {
182
+ var VALUE = undefined;
183
+ var 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', () => {
187
- const VALUE = ' ';
188
- const CONDITION = getCondition(op, '');
186
+ it('should match a string of just whitespace and empty string', function () {
187
+ var VALUE = ' ';
188
+ var 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", () => {
192
- const VALUE = '3';
193
- const CONDITION = getCondition(op, 3);
191
+ it("should match the string number '3' and the number 3", function () {
192
+ var VALUE = '3';
193
+ var 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', () => {
197
- const VALUE = true;
198
- const CONDITION = getCondition(op, 1);
196
+ it('should match a boolean true and the number 1', function () {
197
+ var VALUE = true;
198
+ var 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', () => {
202
- const VALUE = false;
203
- const CONDITION = getCondition(op, 0);
201
+ it('should match a boolean false and a zero', function () {
202
+ var VALUE = false;
203
+ var 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', () => {
210
- const op = 'in';
209
+ describe('operator in', function () {
210
+ var op = 'in';
211
211
 
212
212
  // Should match...
213
- it('should match a string that is in the values array', () => {
214
- const VALUE = 'alpha';
215
- const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
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']);
216
216
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
217
217
  });
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]);
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]);
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', () => {
226
- const VALUE = 'delta';
227
- const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
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']);
228
228
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
229
229
  });
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']);
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']);
233
233
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
234
234
  });
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 => {
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) {
238
238
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeFalsy();
239
239
  });
240
240
  });
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 => {
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) {
244
244
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeFalsy();
245
245
  });
246
246
  });
247
247
  });
248
- describe('operator nin', () => {
249
- const op = 'nin';
248
+ describe('operator nin', function () {
249
+ var op = 'nin';
250
250
 
251
251
  // Should reject...
252
- it('should reject a string that is in the values array', () => {
253
- const VALUE = 'alpha';
254
- const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
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']);
255
255
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
256
256
  });
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]);
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]);
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', () => {
265
- const VALUE = 'delta';
266
- const CONDITION = getCondition(op, ['alpha', 'bravo', 'charlie']);
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']);
267
267
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
268
268
  });
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']);
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']);
272
272
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
273
273
  });
274
- it('should match anything when the values array is empty', () => {
275
- const CONDITION = getCondition(op, []);
276
- TEST_VALUES.forEach(value => {
274
+ it('should match anything when the values array is empty', function () {
275
+ var CONDITION = getCondition(op, []);
276
+ TEST_VALUES.forEach(function (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', () => {
281
- const CONDITION = getCondition(op, null);
282
- TEST_VALUES.forEach(value => {
280
+ it('should match anything when the values array is null', function () {
281
+ var CONDITION = getCondition(op, null);
282
+ TEST_VALUES.forEach(function (value) {
283
283
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeTruthy();
284
284
  });
285
285
  });
286
286
  });
287
- describe('operator contains', () => {
288
- const op = 'contains';
287
+ describe('operator contains', function () {
288
+ var op = 'contains';
289
289
 
290
290
  // Should match...
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);
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);
295
295
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
296
296
  });
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);
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);
301
301
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
302
302
  });
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);
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);
307
307
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
308
308
  });
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);
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);
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', () => {
316
- const FIELD = ['Alpha', 'bravo', 'charlie'];
317
- const VALUE = 'alpha';
318
- const CONDITION = getCondition(op, VALUE);
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);
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', () => {
324
- const FIELD = ['alpha', 'bravo', 'charlie'];
325
- const VALUE = 'delta';
326
- const CONDITION = getCondition(op, VALUE);
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);
327
327
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
328
328
  });
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);
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);
333
333
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
334
334
  });
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);
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);
339
339
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
340
340
  });
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);
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);
345
345
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
346
346
  });
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);
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);
351
351
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
352
352
  });
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);
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);
357
357
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
358
358
  });
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);
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);
363
363
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
364
364
  });
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);
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);
369
369
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
370
370
  });
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);
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);
375
375
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
376
376
  });
377
377
  });
378
- describe('operator !contains', () => {
379
- const op = '!contains';
378
+ describe('operator !contains', function () {
379
+ var op = '!contains';
380
380
 
381
381
  // Should match...
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);
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);
386
386
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
387
387
  });
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);
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);
392
392
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
393
393
  });
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);
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);
398
398
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
399
399
  });
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);
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);
404
404
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
405
405
  });
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);
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);
410
410
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
411
411
  });
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);
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);
416
416
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
417
417
  });
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);
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);
422
422
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
423
423
  });
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);
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);
428
428
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeTruthy();
429
429
  });
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);
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);
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', () => {
439
- const FIELD = ['alpha', 'bravo', 'charlie'];
440
- const VALUE = 'alpha';
441
- const CONDITION = getCondition(op, VALUE);
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);
442
442
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
443
443
  });
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);
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);
448
448
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
449
449
  });
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);
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);
454
454
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
455
455
  });
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);
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);
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', () => {
463
- const FIELD = ['Alpha', 'bravo', 'charlie'];
464
- const VALUE = 'alpha';
465
- const CONDITION = getCondition(op, VALUE);
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);
466
466
  expect((0, _meetsCondition.default)(CONDITION, FIELD)).toBeFalsy();
467
467
  });
468
468
  });
469
- describe('numerical operators', () => {
470
- it('less than should reject when value is null', () => {
471
- const CONDITION = {
469
+ describe('numerical operators', function () {
470
+ it('less than should reject when value is null', function () {
471
+ var 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', () => {
478
- const CONDITION = {
477
+ it('less than should reject when condition.value is null', function () {
478
+ var 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', () => {
485
- const CONDITION = {
484
+ it('less than should reject when condition.value and value are null', function () {
485
+ var 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', () => {
492
- const CONDITION = {
491
+ it('less than should reject when value is greater than condition.value', function () {
492
+ var 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', () => {
499
- const CONDITION = {
498
+ it('less than should accept when value is less than condition.value', function () {
499
+ var 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', () => {
506
- const CONDITION = {
505
+ it('less than should handle values with commas in', function () {
506
+ var 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', () => {
513
- const CONDITION = {
512
+ it('greater than should reject when value is null', function () {
513
+ var 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', () => {
520
- const CONDITION = {
519
+ it('greater than should reject when condition.value is null', function () {
520
+ var 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', () => {
527
- const CONDITION = {
526
+ it('greater than should reject when condition.value and value are null', function () {
527
+ var 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', () => {
534
- const CONDITION = {
533
+ it('greater than should reject when value is less than condition.value', function () {
534
+ var 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', () => {
541
- const CONDITION = {
540
+ it('greater than should accept when value is greater than condition.value', function () {
541
+ var 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', () => {
548
- const CONDITION = {
547
+ it('greater than should handle values with commas in', function () {
548
+ var 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', () => {
556
- it('should accept a string that exists within the value', () => {
557
- const VALUE = ['red', 'green', 'blue'];
558
- const CONDITION = {
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 = {
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', () => {
565
- const VALUE = [4, 5, 6];
566
- const CONDITION = {
564
+ it('should accept a number that exists within the value', function () {
565
+ var VALUE = [4, 5, 6];
566
+ var 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', () => {
573
- const VALUE = ['red', 'green', 'blue'];
574
- const CONDITION = {
572
+ it('should reject a string that doesnt exist within the value', function () {
573
+ var VALUE = ['red', 'green', 'blue'];
574
+ var 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', () => {
581
- const VALUE = [4, 5, 6];
582
- const CONDITION = {
580
+ it('should reject a number that doesnt exist within the value', function () {
581
+ var VALUE = [4, 5, 6];
582
+ var 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', () => {
589
- const VALUE = 'badValue';
590
- const CONDITION = {
588
+ it('should reject a value that is not an array', function () {
589
+ var VALUE = 'badValue';
590
+ var 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', () => {
597
- const VALUE = [];
598
- const CONDITION = {
596
+ it('should reject an empty array', function () {
597
+ var VALUE = [];
598
+ var 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', () => {
606
- it('should reject a string that exists within the value', () => {
607
- const VALUE = ['red', 'green', 'blue'];
608
- const CONDITION = {
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 = {
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', () => {
615
- const VALUE = [4, 5, 6];
616
- const CONDITION = {
614
+ it('should reject a number that exists within the value', function () {
615
+ var VALUE = [4, 5, 6];
616
+ var 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', () => {
623
- const VALUE = ['red', 'green', 'blue'];
624
- const CONDITION = {
622
+ it('should accept a string that doesnt exist within the value', function () {
623
+ var VALUE = ['red', 'green', 'blue'];
624
+ var 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', () => {
631
- const VALUE = [4, 5, 6];
632
- const CONDITION = {
630
+ it('should accept a number that doesnt exist within the value', function () {
631
+ var VALUE = [4, 5, 6];
632
+ var 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', () => {
639
- const VALUE = 'badValue';
640
- const CONDITION = {
638
+ it('should accept a value that is not an array', function () {
639
+ var VALUE = 'badValue';
640
+ var 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', () => {
647
- const VALUE = [];
648
- const CONDITION = {
646
+ it('should accept an empty array', function () {
647
+ var VALUE = [];
648
+ var 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 includesAllOf', () => {
656
- it('should reject when value is not an array', () => {
657
- const VALUE = 'Not an array';
658
- const CONDITION = {
655
+ describe('operator includesAllOf', function () {
656
+ it('should reject when value is not an array', function () {
657
+ var VALUE = 'Not an array';
658
+ var CONDITION = {
659
659
  op: 'includesAllOf',
660
660
  values: ['a', 'c']
661
661
  };
662
662
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
663
663
  });
664
- it('should reject when value is an empty array', () => {
665
- const VALUE = [];
666
- const CONDITION = {
664
+ it('should reject when value is an empty array', function () {
665
+ var VALUE = [];
666
+ var CONDITION = {
667
667
  op: 'includesAllOf',
668
668
  values: ['a', 'c']
669
669
  };
670
670
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
671
671
  });
672
- it('should accept when the list of values is an empty array', () => {
673
- const VALUE = ['a', 'b', 'c'];
674
- const CONDITION = {
672
+ it('should accept when the list of values is an empty array', function () {
673
+ var VALUE = ['a', 'b', 'c'];
674
+ var CONDITION = {
675
675
  op: 'includesAllOf',
676
676
  values: []
677
677
  };
678
678
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
679
679
  });
680
- it('should accept a list of values that are all in field', () => {
681
- const VALUE = ['a', 'b', 'c'];
682
- const CONDITION = {
680
+ it('should accept a list of values that are all in field', function () {
681
+ var VALUE = ['a', 'b', 'c'];
682
+ var CONDITION = {
683
683
  op: 'includesAllOf',
684
684
  values: ['a', 'c']
685
685
  };
686
686
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
687
687
  });
688
- it('should reject a list of values if any are missing from field', () => {
689
- const VALUE = ['a', 'b', 'c'];
690
- const CONDITION = {
688
+ it('should reject a list of values if any are missing from field', function () {
689
+ var VALUE = ['a', 'b', 'c'];
690
+ var CONDITION = {
691
691
  op: 'includesAllOf',
692
692
  values: ['a', 'd']
693
693
  };
694
694
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
695
695
  });
696
696
  });
697
- describe('operator !includesAllOf', () => {
698
- it('should accept when value is not an array', () => {
699
- const VALUE = 'Not an array';
700
- const CONDITION = {
697
+ describe('operator !includesAllOf', function () {
698
+ it('should accept when value is not an array', function () {
699
+ var VALUE = 'Not an array';
700
+ var CONDITION = {
701
701
  op: '!includesAllOf',
702
702
  values: ['a', 'c']
703
703
  };
704
704
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
705
705
  });
706
- it('should accept when value is an empty array', () => {
707
- const VALUE = [];
708
- const CONDITION = {
706
+ it('should accept when value is an empty array', function () {
707
+ var VALUE = [];
708
+ var CONDITION = {
709
709
  op: '!includesAllOf',
710
710
  values: ['a', 'c']
711
711
  };
712
712
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
713
713
  });
714
- it('should reject when the list of values is an empty array', () => {
715
- const VALUE = ['a', 'b', 'c'];
716
- const CONDITION = {
714
+ it('should reject when the list of values is an empty array', function () {
715
+ var VALUE = ['a', 'b', 'c'];
716
+ var CONDITION = {
717
717
  op: '!includesAllOf',
718
718
  values: []
719
719
  };
720
720
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
721
721
  });
722
- it('should reject a list of values that are all in value', () => {
723
- const VALUE = ['a', 'b', 'c'];
724
- const CONDITION = {
722
+ it('should reject a list of values that are all in value', function () {
723
+ var VALUE = ['a', 'b', 'c'];
724
+ var CONDITION = {
725
725
  op: '!includesAllOf',
726
726
  values: ['a', 'c']
727
727
  };
728
728
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeFalsy();
729
729
  });
730
- it('should accept a list of values if any are missing from value', () => {
731
- const VALUE = ['a', 'b', 'c'];
732
- const CONDITION = {
730
+ it('should accept a list of values if any are missing from value', function () {
731
+ var VALUE = ['a', 'b', 'c'];
732
+ var CONDITION = {
733
733
  op: '!includesAllOf',
734
734
  values: ['a', 'd']
735
735
  };
736
736
  expect((0, _meetsCondition.default)(CONDITION, VALUE)).toBeTruthy();
737
737
  });
738
738
  });
739
- describe('unknown operator', () => {
740
- const op = 'definitely_not_a_real_operator';
741
- it('should reject anything regardless of the value', () => {
742
- const CONDITION = getCondition(op, 'a');
743
- TEST_VALUES.forEach(value => {
739
+ describe('unknown operator', function () {
740
+ var op = 'definitely_not_a_real_operator';
741
+ it('should reject anything regardless of the value', function () {
742
+ var CONDITION = getCondition(op, 'a');
743
+ TEST_VALUES.forEach(function (value) {
744
744
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeFalsy();
745
745
  });
746
746
  });
747
- it('should accept anything even with a null value', () => {
748
- const CONDITION = getCondition(op, null);
749
- TEST_VALUES.forEach(value => {
747
+ it('should accept anything even with a null value', function () {
748
+ var CONDITION = getCondition(op, null);
749
+ TEST_VALUES.forEach(function (value) {
750
750
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeFalsy();
751
751
  });
752
752
  });
753
- it('should accept anything even with a undefined value', () => {
754
- const CONDITION = getCondition(op, null);
755
- TEST_VALUES.forEach(value => {
753
+ it('should accept anything even with a undefined value', function () {
754
+ var CONDITION = getCondition(op, null);
755
+ TEST_VALUES.forEach(function (value) {
756
756
  expect((0, _meetsCondition.default)(CONDITION, value)).toBeFalsy();
757
757
  });
758
758
  });
759
759
  });
760
- describe('invalid condition', () => {
761
- it('should accept anything when the condition is null', () => {
762
- TEST_VALUES.forEach(value => {
760
+ describe('invalid condition', function () {
761
+ it('should accept anything when the condition is null', function () {
762
+ TEST_VALUES.forEach(function (value) {
763
763
  expect((0, _meetsCondition.default)(null, value)).toBeTruthy();
764
764
  });
765
765
  });
766
- it('should accept anything when the condition is undefined', () => {
767
- TEST_VALUES.forEach(value => {
766
+ it('should accept anything when the condition is undefined', function () {
767
+ TEST_VALUES.forEach(function (value) {
768
768
  expect((0, _meetsCondition.default)(undefined, value)).toBeTruthy();
769
769
  });
770
770
  });
771
- it('should accept anything when the condition is not an object', () => {
772
- TEST_VALUES.forEach(value => {
771
+ it('should accept anything when the condition is not an object', function () {
772
+ TEST_VALUES.forEach(function (value) {
773
773
  expect((0, _meetsCondition.default)('condition', value)).toBeTruthy();
774
774
  });
775
775
  });