@ukhomeoffice/cop-react-form-renderer 6.15.5-alpha → 6.15.5

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 (42) hide show
  1. package/dist/components/CollectionSummary/BannerStrip.scss +4 -0
  2. package/dist/components/FormComponent/FormComponent.js +6 -0
  3. package/dist/components/FormComponent/helpers/addLabel.js +3 -2
  4. package/dist/components/FormPage/FormPage.js +28 -17
  5. package/dist/components/FormPage/FormPage.test.js +53 -0
  6. package/dist/components/FormRenderer/FormRenderer.js +5 -10
  7. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/cop-reassign-task-to-rcc.json +445 -0
  8. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-component-show-when-in-component-and-page.json +62 -0
  9. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-page-same-component-reused.json +61 -0
  10. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-page-same-component-reused-one-shown.json +74 -0
  11. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-airpax-change-what-happened-before.json +300 -0
  12. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-component-show-when-in-component-and-page.json +6 -0
  13. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-page-same-component-reused.json +6 -0
  14. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-page-same-component-reused-one-shown.json +8 -0
  15. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/reassign-to-rcc.json +72 -0
  16. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/cop-airpax-change-what-happened-after.json +280 -0
  17. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-component-show-when-in-component-and-page-removed.json +5 -0
  18. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-page-same-component-reused-removed.json +5 -0
  19. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-page-same-component-reused-one-shown-removed.json +7 -0
  20. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.js +259 -289
  21. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.test.js +78 -27
  22. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.js +387 -0
  23. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.test.js +559 -0
  24. package/dist/components/FormRenderer/onCYAAction.js +5 -1
  25. package/dist/components/FormRenderer/onCYAAction.test.js +5 -0
  26. package/dist/components/FormRenderer/onPageAction.js +0 -1
  27. package/dist/hooks/useGetRequest.js +15 -15
  28. package/dist/hooks/useRefData.js +3 -2
  29. package/dist/utils/Component/getComponentTests/getComponent.multifile.test.js +2 -1
  30. package/dist/utils/Component/getDefaultValueFromConfig.js +2 -1
  31. package/dist/utils/Condition/meetsCondition.js +26 -12
  32. package/dist/utils/Condition/meetsCondition.test.js +21 -0
  33. package/dist/utils/Data/getAutocompleteSource.js +68 -51
  34. package/dist/utils/Data/getAutocompleteSource.test.js +31 -18
  35. package/dist/utils/Operate/doesContainValue.js +34 -0
  36. package/dist/utils/Operate/doesContainValue.test.js +75 -0
  37. package/dist/utils/Operate/runPageOperations.js +2 -0
  38. package/dist/utils/Validate/validateOnPageLoad.js +23 -0
  39. package/dist/utils/Validate/validateOnPageLoad.test.js +88 -0
  40. package/package.json +4 -4
  41. package/dist/components/FormRenderer/helpers/deleteNodeByPath.js +0 -29
  42. package/dist/components/FormRenderer/helpers/deleteNodeByPath.test.js +0 -56
@@ -4,6 +4,9 @@ var _index = _interopRequireDefault(require("./index"));
4
4
  var _formHiddenComponent = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/forms/form-hidden-component.json"));
5
5
  var _dataHiddenComponent = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/data-hidden-component.json"));
6
6
  var _dataHiddenComponentRemoved = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/data-hidden-component-removed.json"));
7
+ var _formHiddenComponentShowWhenInComponentAndPage = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/forms/form-hidden-component-show-when-in-component-and-page.json"));
8
+ var _dataHiddenComponentShowWhenInComponentAndPage = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/data-hidden-component-show-when-in-component-and-page.json"));
9
+ var _dataHiddenComponentShowWhenInComponentAndPageRemoved = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/data-hidden-component-show-when-in-component-and-page-removed.json"));
7
10
  var _formHiddenEmbeddedComponent = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/forms/form-hidden-embedded-component.json"));
8
11
  var _dataHiddenEmbeddedComponent = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/data-hidden-embedded-component.json"));
9
12
  var _dataHiddenEmbeddedComponentRemoved = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/data-hidden-embedded-component-removed.json"));
@@ -34,6 +37,12 @@ var _dataNestedAnswersHiddenByOptionRemoved = _interopRequireDefault(require("..
34
37
  var _formHiddenPage = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/forms/form-hidden-page.json"));
35
38
  var _dataHiddenPage = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/data-hidden-page.json"));
36
39
  var _dataHiddenPageRemoved = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/data-hidden-page-removed.json"));
40
+ var _formHiddenPageSameComponentReused = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/forms/form-hidden-page-same-component-reused.json"));
41
+ var _dataHiddenPageSameComponentReused = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/data-hidden-page-same-component-reused.json"));
42
+ var _dataHiddenPageSameComponentReusedRemoved = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/data-hidden-page-same-component-reused-removed.json"));
43
+ var _formPageSameComponentReusedOneShown = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/forms/form-page-same-component-reused-one-shown.json"));
44
+ var _dataPageSameComponentReusedOneShown = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/data-page-same-component-reused-one-shown.json"));
45
+ var _dataPageSameComponentReusedOneShownRemoved = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/data-page-same-component-reused-one-shown-removed.json"));
37
46
  var _formHiddenPageComponentUsedElsewhere = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/forms/form-hidden-page-component-used-elsewhere.json"));
38
47
  var _dataHiddenPageComponentUsedElsewhere = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/data-hidden-page-component-used-elsewhere.json"));
39
48
  var _dataHiddenPageComponentUsedElsewhereRemoved = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/data-hidden-page-component-used-elsewhere-removed.json"));
@@ -76,12 +85,18 @@ var _copMandecRemoveCriminalityBefore = _interopRequireDefault(require("../clear
76
85
  var _copMandecRemoveCriminalityAfter = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/cop-mandec-remove-criminality-after.json"));
77
86
  var _copMandecRemoveUnspentConvictionsBefore = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/cop-mandec-remove-unspent-convictions-before.json"));
78
87
  var _copMandecRemoveUnspentConvictionsAfter = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/cop-mandec-remove-unspent-convictions-after.json"));
88
+ var _copReassignTaskToRcc = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/forms/cop-reassign-task-to-rcc.json"));
89
+ var _reassignToRcc = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/reassign-to-rcc.json"));
79
90
  var _formCopAirpax = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/forms/form-cop-airpax.json"));
80
91
  var _copAirpaxRemovePhotosBefore = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/cop-airpax-remove-photos-before.json"));
81
92
  var _copAirpaxRemovePhotosAfter = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/cop-airpax-remove-photos-after.json"));
93
+ var _copAirpaxChangeWhatHappenedBefore = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/cop-airpax-change-what-happened-before.json"));
94
+ var _copAirpaxChangeWhatHappenedAfter = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/cop-airpax-change-what-happened-after.json"));
82
95
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
83
96
  // Hidden component
84
97
 
98
+ // Hidden component with show_when in page and component
99
+
85
100
  // Hidden embedded component
86
101
 
87
102
  // Hidden collection component
@@ -102,6 +117,10 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
102
117
 
103
118
  // Hidden page
104
119
 
120
+ // Hidden page containing same component reused
121
+
122
+ // should show component when reused but only one show_when true
123
+
105
124
  // Hidden page with component used elsewhere
106
125
 
107
126
  // Hidden component with show_when rule referring to a collection
@@ -132,90 +151,110 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
132
151
 
133
152
  // Mandec Unspent convictions
134
153
 
154
+ // TMS reassign-task-to-rcc
155
+
135
156
  // Airpax photos
136
157
 
137
158
  describe('FormRenderer', () => {
138
159
  describe('helpers', () => {
139
160
  describe('clearOutUncompletedRoutes', () => {
140
- it('should remove hidden component', () => {
161
+ it('should remove hidden component.', () => {
141
162
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenComponent.default));
142
163
  const form = JSON.parse(JSON.stringify(_formHiddenComponent.default));
143
164
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
144
165
  expect(result).toEqual(_dataHiddenComponentRemoved.default);
145
166
  });
146
- it('should remove hidden component embedded in page', () => {
167
+ it('should remove hidden component with show_when in page and component.', () => {
168
+ const submissionData = JSON.parse(JSON.stringify(_dataHiddenComponentShowWhenInComponentAndPage.default));
169
+ const form = JSON.parse(JSON.stringify(_formHiddenComponentShowWhenInComponentAndPage.default));
170
+ const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
171
+ expect(result).toEqual(_dataHiddenComponentShowWhenInComponentAndPageRemoved.default);
172
+ });
173
+ it('should remove hidden component embedded in page.', () => {
147
174
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenEmbeddedComponent.default));
148
175
  const form = JSON.parse(JSON.stringify(_formHiddenEmbeddedComponent.default));
149
176
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
150
177
  expect(result).toEqual(_dataHiddenEmbeddedComponentRemoved.default);
151
178
  });
152
- it('should remove hidden collection component', () => {
179
+ it('should remove hidden collection component.', () => {
153
180
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenCollectionComponent.default));
154
181
  const form = JSON.parse(JSON.stringify(_formHiddenCollectionComponent.default));
155
182
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
156
183
  expect(result).toEqual(_dataHiddenCollectionComponentRemoved.default);
157
184
  });
158
- it('should remove hidden embedded collection component', () => {
185
+ it('should remove hidden embedded collection component.', () => {
159
186
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenEmbeddedCollectionComponent.default));
160
187
  const form = JSON.parse(JSON.stringify(_formHiddenEmbeddedCollectionComponent.default));
161
188
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
162
189
  expect(result).toEqual(_dataHiddenEmbeddedCollectionComponentRemoved.default);
163
190
  });
164
- it('should remove hidden containerised component', () => {
191
+ it('should remove hidden containerised component.', () => {
165
192
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenContainerisedComponent.default));
166
193
  const form = JSON.parse(JSON.stringify(_formHiddenContainerisedComponent.default));
167
194
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
168
195
  expect(result).toEqual(_dataHiddenContainerisedComponentRemoved.default);
169
196
  });
170
- it('should remove hidden multi-level containerised components', () => {
197
+ it('should remove hidden multi-level containerised components.', () => {
171
198
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenMultilevelContainerisedComponent.default));
172
199
  const form = JSON.parse(JSON.stringify(_formHiddenMultilevelContainerisedComponent.default));
173
200
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
174
201
  expect(result).toEqual(_dataHiddenMultilevelContainerisedComponentRemoved.default);
175
202
  });
176
- it('should remove hidden leaf-level in a multi-level containerised component', () => {
203
+ it('should remove hidden leaf-level in a multi-level containerised component.', () => {
177
204
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenMultilevelContainerisedComponentLeafHidden.default));
178
205
  const form = JSON.parse(JSON.stringify(_formHiddenMultilevelContainerisedComponentLeafHidden.default));
179
206
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
180
207
  expect(result).toEqual(_dataHiddenMultilevelContainerisedComponentLeafHiddenRemoved.default);
181
208
  });
182
- it('should remove hidden component with options', () => {
209
+ it('should remove hidden component with options.', () => {
183
210
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenOptions.default));
184
211
  const form = JSON.parse(JSON.stringify(_formHiddenOptions.default));
185
212
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
186
213
  expect(result).toEqual(_dataHiddenOptionsRemoved.default);
187
214
  });
188
- it('should remove hidden component with nested questions in options', () => {
215
+ it('should remove hidden component with nested questions in options.', () => {
189
216
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenComponentWithNestedQuestions.default));
190
217
  const form = JSON.parse(JSON.stringify(_formHiddenComponentWithNestedQuestions.default));
191
218
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
192
219
  expect(result).toEqual(_dataHiddenComponentWithNestedQuestionsRemoved.default);
193
220
  });
194
- it('should remove answers associated with unselected options in a containerised component', () => {
221
+ it('should remove answers associated with unselected options in a containerised component.', () => {
195
222
  const submissionData = JSON.parse(JSON.stringify(_dataNestedAnswersHiddenByOption.default));
196
223
  const form = JSON.parse(JSON.stringify(_formNestedAnswersHiddenByOption.default));
197
224
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
198
225
  expect(result).toEqual(_dataNestedAnswersHiddenByOptionRemoved.default);
199
226
  });
200
- it('should remove hidden page', () => {
227
+ it('should remove hidden page.', () => {
201
228
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenPage.default));
202
229
  const form = JSON.parse(JSON.stringify(_formHiddenPage.default));
203
230
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
204
231
  expect(result).toEqual(_dataHiddenPageRemoved.default);
205
232
  });
206
- it('should remove a hidden collection on a page', () => {
233
+ it('should remove hidden page with same component reused.', () => {
234
+ const submissionData = JSON.parse(JSON.stringify(_dataHiddenPageSameComponentReused.default));
235
+ const form = JSON.parse(JSON.stringify(_formHiddenPageSameComponentReused.default));
236
+ const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
237
+ expect(result).toEqual(_dataHiddenPageSameComponentReusedRemoved.default);
238
+ });
239
+ it('should show component when reused but only one show_when true.', () => {
240
+ const submissionData = JSON.parse(JSON.stringify(_dataPageSameComponentReusedOneShown.default));
241
+ const form = JSON.parse(JSON.stringify(_formPageSameComponentReusedOneShown.default));
242
+ const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
243
+ expect(result).toEqual(_dataPageSameComponentReusedOneShownRemoved.default);
244
+ });
245
+ it('should remove a hidden collection on a page.', () => {
207
246
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenPageCollection.default));
208
247
  const form = JSON.parse(JSON.stringify(_formHiddenPageCollection.default));
209
248
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
210
249
  expect(result).toEqual(_dataHiddenPageCollectionRemoved.default);
211
250
  });
212
- it('hidden component with show_when rule referring to a collection', () => {
251
+ it('hidden component with show_when rule referring to a collection.', () => {
213
252
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenComponentReferringToCollection.default));
214
253
  const form = JSON.parse(JSON.stringify(_formHiddenComponentReferringToCollection.default));
215
254
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
216
255
  expect(result).toEqual(_dataHiddenComponentReferringToCollectionRemoved.default);
217
256
  });
218
- it('hidden component with show_when rule referring to a hidden collection', () => {
257
+ it('hidden component with show_when rule referring to a hidden collection.', () => {
219
258
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenComponentReferringToHiddenCollection.default));
220
259
  const form = JSON.parse(JSON.stringify(_formHiddenComponentReferringToHiddenCollection.default));
221
260
  try {
@@ -225,84 +264,96 @@ describe('FormRenderer', () => {
225
264
  expect(error.message).toContain('It is not possible to reliably clean hidden data when a component is dependent');
226
265
  }
227
266
  });
228
- it('should remove hidden collection components whether they are dependent on data inside or outside the collection', () => {
267
+ it('should remove hidden collection components whether they are dependent on data inside or outside the collection.', () => {
229
268
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenCollectionComponentDependentOnExternalData.default));
230
269
  const form = JSON.parse(JSON.stringify(_formHiddenCollectionComponentDependentOnExternalData.default));
231
270
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
232
271
  expect(result).toEqual(_dataHiddenCollectionComponentDependentOnExternalDataRemoved.default);
233
272
  });
234
- it('should not remove component on hidden page if component used elsewhere', () => {
273
+ it('should not remove component on hidden page if component used elsewhere.', () => {
235
274
  const submissionData = JSON.parse(JSON.stringify(_dataHiddenPageComponentUsedElsewhere.default));
236
275
  const form = JSON.parse(JSON.stringify(_formHiddenPageComponentUsedElsewhere.default));
237
276
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
238
277
  expect(result).toEqual(_dataHiddenPageComponentUsedElsewhereRemoved.default);
239
278
  });
240
- it('chained show_whens should be resolved from the end of the chain backup to the start', () => {
279
+ it('chained show_whens should be resolved from the end of the chain backup to the start.', () => {
241
280
  const submissionData = JSON.parse(JSON.stringify(_dataChainedComponentShowWhens.default));
242
281
  const form = JSON.parse(JSON.stringify(_formChainedComponentShowWhens.default));
243
282
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
244
283
  expect(result).toEqual(_dataChainedComponentShowWhensRemoved.default);
245
284
  });
246
- it('chained show_whens when top level dependency is field within refdata object', () => {
285
+ it('chained show_whens when top level dependency is field within refdata object.', () => {
247
286
  const submissionData = JSON.parse(JSON.stringify(_dataChainedComponentShowWhensRefdata.default));
248
287
  const form = JSON.parse(JSON.stringify(_formChainedComponentShowWhensRefdata.default));
249
288
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
250
289
  expect(result).toEqual(_dataChainedComponentShowWhensRefdataRemoved.default);
251
290
  });
252
- it('chained show_whens should be resolved from the end of the chain backup to the start, even if the target and dependent components are in containers thus having segmented paths', () => {
291
+ it('chained show_whens should be resolved from the end of the chain backup to the start, even if the target and dependent components are in containers thus having segmented paths.', () => {
253
292
  const submissionData = JSON.parse(JSON.stringify(_dataChainedComponentShowWhensContainerised.default));
254
293
  const form = JSON.parse(JSON.stringify(_formChainedComponentShowWhensContainerised.default));
255
294
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
256
295
  expect(result).toEqual(_dataChainedComponentShowWhensContainerisedRemoved.default);
257
296
  });
258
- it('chained show_whens when the component at the end of the chain is hidden indirectly via page show_when', () => {
297
+ it('chained show_whens when the component at the end of the chain is hidden indirectly via page show_when.', () => {
259
298
  const submissionData = JSON.parse(JSON.stringify(_dataChainedShowWhensPageHidden.default));
260
299
  const form = JSON.parse(JSON.stringify(_formChainedShowWhensPageHidden.default));
261
300
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
262
301
  expect(result).toEqual(_dataChainedShowWhensPageHiddenRemoved.default);
263
302
  });
264
- it('chained show_whens when the dependent component is nested single question', () => {
303
+ it('chained show_whens when the dependent component is nested single question.', () => {
265
304
  const submissionData = JSON.parse(JSON.stringify(_dataChainedComponentShowWhensDependentComponentNested.default));
266
305
  const form = JSON.parse(JSON.stringify(_formChainedComponentShowWhensDependentComponentNested.default));
267
306
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
268
307
  expect(result).toEqual(_dataChainedComponentShowWhensDependentComponentNestedRemoved.default);
269
308
  });
270
- it('chained show_whens when the target component is nested', () => {
309
+ it('chained show_whens when the target component is nested.', () => {
271
310
  const submissionData = JSON.parse(JSON.stringify(_dataChainedComponentShowWhensTargetComponentNested.default));
272
311
  const form = JSON.parse(JSON.stringify(_formChainedComponentShowWhensTargetComponentNested.default));
273
312
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
274
313
  expect(result).toEqual(_dataChainedComponentShowWhensTargetComponentNestedRemoved.default);
275
314
  });
276
- it('chained show_whens when the dependent component is nested entire block', () => {
315
+ it('chained show_whens when the dependent component is nested entire block.', () => {
277
316
  const submissionData = JSON.parse(JSON.stringify(_dataChainedComponentShowWhensDependentComponentNestedBlock.default));
278
317
  const form = JSON.parse(JSON.stringify(_formChainedComponentShowWhensDependentComponentNestedBlock.default));
279
318
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
280
319
  expect(result).toEqual(_dataChainedComponentShowWhensDependentComponentNestedBlockRemoved.default);
281
320
  });
282
- it('business interests removed from mandec', () => {
321
+ it('business interests removed from mandec.', () => {
283
322
  const submissionData = JSON.parse(JSON.stringify(_copMandecRemoveBusinessInterestsBefore.default));
284
323
  const form = JSON.parse(JSON.stringify(_formCopMandec.default));
285
324
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
286
325
  expect(result).toEqual(_copMandecRemoveBusinessInterestsAfter.default);
287
326
  });
288
- it('criminality removed from mandec', () => {
327
+ it('criminality removed from mandec.', () => {
289
328
  const submissionData = JSON.parse(JSON.stringify(_copMandecRemoveCriminalityBefore.default));
290
329
  const form = JSON.parse(JSON.stringify(_formCopMandec.default));
291
330
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
292
331
  expect(result).toEqual(_copMandecRemoveCriminalityAfter.default);
293
332
  });
294
- it('Unspent convictions removed from mandec', () => {
333
+ it('Unspent convictions removed from mandec.', () => {
295
334
  const submissionData = JSON.parse(JSON.stringify(_copMandecRemoveUnspentConvictionsBefore.default));
296
335
  const form = JSON.parse(JSON.stringify(_formCopMandec.default));
297
336
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
298
337
  expect(result).toEqual(_copMandecRemoveUnspentConvictionsAfter.default);
299
338
  });
300
- it('photos removed from airpax', () => {
339
+ it('Reassign to RCC form, preserved fields not cleansed.', () => {
340
+ const submissionData = JSON.parse(JSON.stringify(_reassignToRcc.default));
341
+ const form = JSON.parse(JSON.stringify(_copReassignTaskToRcc.default));
342
+ const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
343
+ expect(result).toEqual(_reassignToRcc.default);
344
+ });
345
+ it('photos removed from airpax.', () => {
301
346
  const submissionData = JSON.parse(JSON.stringify(_copAirpaxRemovePhotosBefore.default));
302
347
  const form = JSON.parse(JSON.stringify(_formCopAirpax.default));
303
348
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
304
349
  expect(result).toEqual(_copAirpaxRemovePhotosAfter.default);
305
350
  });
351
+ it('airpax change whatHappened to hide whoDecidedSelection.', () => {
352
+ const submissionData = JSON.parse(JSON.stringify(_copAirpaxChangeWhatHappenedBefore.default));
353
+ const form = JSON.parse(JSON.stringify(_formCopAirpax.default));
354
+ const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
355
+ expect(result).toEqual(_copAirpaxChangeWhatHappenedAfter.default);
356
+ });
306
357
  });
307
358
  });
308
359
  });