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

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