Skip to content

Commit

Permalink
Merge branch 'main' into grand-calculated-summary-value-source
Browse files Browse the repository at this point in the history
  • Loading branch information
MebinAbraham authored Oct 9, 2023
2 parents e33f43a + bb3f26c commit e59c176
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .schemas-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.73.0
v3.73.1
7 changes: 5 additions & 2 deletions app/questionnaire/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
23 changes: 23 additions & 0 deletions tests/app/questionnaire/test_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 6 additions & 0 deletions tests/functional/spec/list_collector.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});

0 comments on commit e59c176

Please sign in to comment.