@ukhomeoffice/cop-react-form-renderer 2.8.3 → 2.8.4
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.
|
@@ -19,7 +19,14 @@ var getSubmissionStatus = function getSubmissionStatus(formType, pages, currentP
|
|
|
19
19
|
|
|
20
20
|
if (currentPageId === (_models.FormPages.CYA || 'submitForm') && isCompleted) {
|
|
21
21
|
formStatus.tasks[currentTask.name].complete = true;
|
|
22
|
+
} else if ((action === null || action === void 0 ? void 0 : action.type) === _models.PageAction.TYPES.SAVE_AND_NAVIGATE) {
|
|
23
|
+
console.log('pg action sc');
|
|
24
|
+
formStatus.tasks[currentTask.name] = {
|
|
25
|
+
complete: false,
|
|
26
|
+
currentPage: (0, _getNextPageId.default)(formType, pages, currentPageId, action, formData)
|
|
27
|
+
};
|
|
22
28
|
} else {
|
|
29
|
+
console.log('got to else stmt');
|
|
23
30
|
formStatus.tasks[currentTask.name] = {
|
|
24
31
|
complete: false,
|
|
25
32
|
currentPage: currentPageId
|
|
@@ -222,7 +222,7 @@ describe('components', function () {
|
|
|
222
222
|
})
|
|
223
223
|
});
|
|
224
224
|
});
|
|
225
|
-
it("should update the current task with the current page and a false complete flag if the
|
|
225
|
+
it("should update the current task with the current page and a false complete flag if the next page is not '".concat(_models.FormPages.CYA, "'"), function () {
|
|
226
226
|
var CURRENT_PAGE_ID = 'eventDate';
|
|
227
227
|
var TASK_NAME = 'taskName';
|
|
228
228
|
var CURRENT_TASK = {
|
|
@@ -236,7 +236,7 @@ describe('components', function () {
|
|
|
236
236
|
expect((0, _getSubmissionStatus.default)(FORM_TYPE, PAGES, CURRENT_PAGE_ID, ACTION, {}, CURRENT_TASK)).toMatchObject({
|
|
237
237
|
tasks: _defineProperty({}, TASK_NAME, {
|
|
238
238
|
complete: false,
|
|
239
|
-
currentPage:
|
|
239
|
+
currentPage: NEXT_PAGE_ID
|
|
240
240
|
})
|
|
241
241
|
});
|
|
242
242
|
});
|