From c483d6c2c92bd74fc68f96eedfc9ee8dfc57f06b Mon Sep 17 00:00:00 2001
From: Jamie Falcus <50366804+jamiefalcus@users.noreply.github.com>
Date: Wed, 18 Mar 2026 15:15:15 +0000
Subject: [PATCH 1/2] PPHA-Add question to change text in hidden span
---
lung_cancer_screening/questions/jinja2/responses.jinja | 2 +-
.../questions/presenters/response_set_presenter.py | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lung_cancer_screening/questions/jinja2/responses.jinja b/lung_cancer_screening/questions/jinja2/responses.jinja
index 38dda98e..95da43eb 100644
--- a/lung_cancer_screening/questions/jinja2/responses.jinja
+++ b/lung_cancer_screening/questions/jinja2/responses.jinja
@@ -56,7 +56,7 @@
"questions:smoking_current",
kwargs={ "tobacco_type": type_history.url_type() },
query={ "change": "True" },
- ) }}" class="nhsuk-link">Change
+ ) }}" class="nhsuk-link" >Change your answers to {{ type_history.title() }} smoking history
{{ summaryList({
"rows": type_history.summary_items()
diff --git a/lung_cancer_screening/questions/presenters/response_set_presenter.py b/lung_cancer_screening/questions/presenters/response_set_presenter.py
index 29fe4e10..83c54dbb 100644
--- a/lung_cancer_screening/questions/presenters/response_set_presenter.py
+++ b/lung_cancer_screening/questions/presenters/response_set_presenter.py
@@ -310,7 +310,8 @@ def _check_your_answer_item(self, question, value, url_lookup_name, kwargs = {})
"items": [
{
"href": reverse(url_lookup_name, kwargs = kwargs, query = self._change_query_params()),
- "text": "Change"
+ "text": "Change",
+ "visuallyHiddenText": f"answer for {question.lower()}"
}
]
}
From f03abd5bbcefb751226164305d369c5d744d57d2 Mon Sep 17 00:00:00 2001
From: Jamie Falcus <50366804+jamiefalcus@users.noreply.github.com>
Date: Wed, 18 Mar 2026 15:44:53 +0000
Subject: [PATCH 2/2] PPHA-671: Review changes
---
.../questions/jinja2/responses.jinja | 2 +-
.../questions/presenters/response_set_presenter.py | 2 +-
.../unit/presenters/test_response_set_presenter.py | 11 +++++++++++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/lung_cancer_screening/questions/jinja2/responses.jinja b/lung_cancer_screening/questions/jinja2/responses.jinja
index 95da43eb..dfe4b7ee 100644
--- a/lung_cancer_screening/questions/jinja2/responses.jinja
+++ b/lung_cancer_screening/questions/jinja2/responses.jinja
@@ -56,7 +56,7 @@
"questions:smoking_current",
kwargs={ "tobacco_type": type_history.url_type() },
query={ "change": "True" },
- ) }}" class="nhsuk-link" >Change your answers to {{ type_history.title() }} smoking history
+ ) }}" class="nhsuk-link" >Change your answers to {{ type_history.title() }} smoking history
{{ summaryList({
"rows": type_history.summary_items()
diff --git a/lung_cancer_screening/questions/presenters/response_set_presenter.py b/lung_cancer_screening/questions/presenters/response_set_presenter.py
index 83c54dbb..83ee2b12 100644
--- a/lung_cancer_screening/questions/presenters/response_set_presenter.py
+++ b/lung_cancer_screening/questions/presenters/response_set_presenter.py
@@ -311,7 +311,7 @@ def _check_your_answer_item(self, question, value, url_lookup_name, kwargs = {})
{
"href": reverse(url_lookup_name, kwargs = kwargs, query = self._change_query_params()),
"text": "Change",
- "visuallyHiddenText": f"answer for {question.lower()}"
+ "visuallyHiddenText": f"answer for {question.lower().rstrip("?")}"
}
]
}
diff --git a/lung_cancer_screening/questions/tests/unit/presenters/test_response_set_presenter.py b/lung_cancer_screening/questions/tests/unit/presenters/test_response_set_presenter.py
index 7e781967..d5907765 100644
--- a/lung_cancer_screening/questions/tests/unit/presenters/test_response_set_presenter.py
+++ b/lung_cancer_screening/questions/tests/unit/presenters/test_response_set_presenter.py
@@ -459,3 +459,14 @@ def test_tobacco_smoking_history_by_type_returns_presenter_grouped_by_type(self)
self.assertEqual(type(result[0]), TobaccoSmokingHistoryTypePresenter)
self.assertEqual(type(result[1]), TobaccoSmokingHistoryTypePresenter)
+
+ @tag("CheckYourAnswers")
+ def test_check_your_answer_item_has_visually_hidden_text(self):
+ presenter = ResponseSetPresenter(self.response_set)
+
+ answers_item = presenter._check_your_answer_item("Have you ever smoked?", "Not answered", "questions:have_you_ever_smoked")
+
+ self.assertEqual(
+ answers_item["actions"]["items"][0]["visuallyHiddenText"],
+ "answer for have you ever smoked"
+ )