From d1f0a986771c97b1b9f15279b8401e405dd3a7b3 Mon Sep 17 00:00:00 2001 From: petechd <53475968+petechd@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:33:08 +0100 Subject: [PATCH 1/2] Schemas v3.73.1 (#1222) --- .schemas-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.schemas-version b/.schemas-version index 865d40f9b1..e8a603bd9e 100644 --- a/.schemas-version +++ b/.schemas-version @@ -1 +1 @@ -v3.73.0 +v3.73.1 From bb3f26c50f1a42c5219047d25d4785667372efed Mon Sep 17 00:00:00 2001 From: liamtoozer Date: Mon, 9 Oct 2023 14:20:22 +0100 Subject: [PATCH 2/2] Return to list collector summary when navigating back from submit page (#1223) --- app/questionnaire/router.py | 7 ++++-- tests/app/questionnaire/test_router.py | 23 ++++++++++++++++++++ tests/functional/spec/list_collector.spec.js | 6 +++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/app/questionnaire/router.py b/app/questionnaire/router.py index 0a239ba7f8..4da768ab39 100644 --- a/app/questionnaire/router.py +++ b/app/questionnaire/router.py @@ -69,8 +69,11 @@ def get_first_incomplete_location_in_questionnaire_url(self) -> str: return self.get_next_location_url_for_end_of_section() def get_last_location_in_questionnaire_url(self) -> str | None: - section_key = self._get_last_complete_section_key() - if section_key: + if section_key := self._get_last_complete_section_key(): + if self.can_display_section_summary(section_key): + return url_for( + "questionnaire.get_section", section_id=section_key.section_id + ) routing_path = self.routing_path(section_key) return self.get_last_location_in_section(routing_path).url() diff --git a/tests/app/questionnaire/test_router.py b/tests/app/questionnaire/test_router.py index b1085c584b..a4ac2e6dc2 100644 --- a/tests/app/questionnaire/test_router.py +++ b/tests/app/questionnaire/test_router.py @@ -1781,6 +1781,29 @@ def test_last_block_not_on_path(self): assert completed_block_not_on_path == last_completed_block_in_progress_store assert expected_location_url == last_location_url + @pytest.mark.usefixtures("app") + def test_list_collector_final_summary_returns_to_section_summary(self): + self.schema = load_schema_from_name("test_list_collector_list_summary") + + self.progress_store = ProgressStore( + [ + ProgressDict( + section_id="section", + block_ids=[ + "introduction", + "primary-person-list-collector", + "list-collector", + "visitor-list-collector", + ], + status=CompletionStatus.COMPLETED, + ) + ] + ) + + last_location_url = self.router.get_last_location_in_questionnaire_url() + + assert "/questionnaire/sections/section/" == last_location_url + class TestRouterSectionResume(RouterTestCase): @pytest.mark.usefixtures("app") diff --git a/tests/functional/spec/list_collector.spec.js b/tests/functional/spec/list_collector.spec.js index a446b6d816..977b913957 100644 --- a/tests/functional/spec/list_collector.spec.js +++ b/tests/functional/spec/list_collector.spec.js @@ -231,5 +231,11 @@ describe("List Collector", () => { await $(PeopleListSectionSummaryPage.peopleListRemoveLink(2)).click(); await expect(await $(SectionSummaryListCollectorRemovePage.individualResponseGuidance()).isExisting()).to.equal(true); }); + + it("When the user reaches the submit page and navigates back, They should see the Section Summary", async () => { + await click(PeopleListSectionSummaryPage.submit()); + await click(SubmitPage.previous()); + await expect(await browser.getUrl()).to.contain(PeopleListSectionSummaryPage.pageName); + }); }); });