Skip to content

Commit aa4908c

Browse files
LGA 3447: Exit this service out of scope (#138)
* Add cannot find your problem page * Add routes into cannot find your problem page * Add functionality tests * Fix functionality tests * Add space between content and next steps button
1 parent bdf86cd commit aa4908c

File tree

9 files changed

+86
-6
lines changed

9 files changed

+86
-6
lines changed

app/categories/community_care/urls.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class CommunityCareLandingPage(CategoryLandingPage):
2525
(COMMUNITY_CARE.sub.care_leaver, FALA_REDIRECT),
2626
],
2727
"more": [],
28-
"other": "categories.results.refer",
28+
"other": "categories.results.cannot_find_problem",
2929
}
3030

3131

app/categories/mental_capacity/urls.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class MentalCapacityLandingPage(CategoryLandingPage):
3737
(MENTAL_CAPACITY.sub.social_care, "categories.community_care.landing"),
3838
],
3939
"more": [],
40-
"other": "categories.results.refer",
40+
"other": "categories.results.cannot_find_problem",
4141
}
4242

4343

app/categories/results/urls.py

+6
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@
1515
"/refer",
1616
view_func=ResultPage.as_view("refer", template="categories/refer.html"),
1717
)
18+
bp.add_url_rule(
19+
"/cannot-find-problem",
20+
view_func=ResultPage.as_view(
21+
"cannot_find_problem", template="categories/cannot-find-problem.html"
22+
),
23+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{% extends 'base.html' %}
2+
{%- from 'components/back_link.html' import govukBackLink -%}
3+
{%- from 'govuk_frontend_jinja/components/button/macro.html' import govukButton %}
4+
5+
{% block beforeContent %}
6+
{{ super() }}
7+
{{ govukBackLink() }}
8+
{% endblock %}
9+
10+
{% set title = _("Sorry, you’re not likely to get legal aid") %}
11+
{% block pageTitle %}{{ title }} - GOV.UK{% endblock %}
12+
13+
14+
{% block content %}
15+
<div class="govuk-grid-row">
16+
<div class="govuk-grid-column-two-thirds">
17+
<h1 class="govuk-heading-xl">{{ title }}</h1>
18+
19+
<p class="govuk-body">If you cannot find your problem, it’s probably not covered by legal aid.</p>
20+
21+
<br>
22+
23+
{{ govukButton({
24+
"text": _("Next steps to get help"),
25+
"href": url_for("categories.index"),
26+
}) }}
27+
28+
</div>
29+
</div>
30+
{% endblock %}

app/templates/categories/more-problems.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ <h1 class="govuk-heading-xl govuk-!-margin-bottom-8">{{ title }}</h1>
7373
url_for("categories.index")) }}
7474

7575
<div class="govuk-!-margin-top-9 govuk-!-margin-bottom-9">
76-
{{ cannot_find_your_problem(None, url_for("categories.index"))}}
76+
{{ cannot_find_your_problem(None, url_for("categories.results.cannot_find_problem"))}}
7777
</div>
7878
</div>
7979
</div>

app/templates/categories/public/landing.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ <h1 class="govuk-heading-xl">{% trans %}Legal action against police and public o
4545
<br>
4646
<br>
4747

48-
{{ cannot_find_your_problem("", url_for("categories.results.refer", category="pub"))}}
48+
{{ cannot_find_your_problem("", url_for("categories.results.cannot_find_problem"))}}
4949

5050
</div>
5151
</div>

tests/functional_tests/categories/community_care/test_community_care.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
{
3636
"link_text": "Next steps to get help",
37-
"next_page_heading": "Legal aid doesn’t cover all types of problem",
37+
"next_page_heading": "Sorry, you’re not likely to get legal aid",
3838
},
3939
]
4040

tests/functional_tests/categories/mental_capacity/test_mental_capacity.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
"link_text": "Next steps to get help",
31-
"next_page_heading": "Legal aid doesn’t cover all types of problem",
31+
"next_page_heading": "Sorry, you’re not likely to get legal aid",
3232
},
3333
]
3434

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import pytest
2+
from playwright.sync_api import Page, expect
3+
4+
CANNOT_FIND_PROBLEM_HEADING = "Sorry, you’re not likely to get legal aid"
5+
6+
7+
@pytest.mark.usefixtures("live_server")
8+
def test_more_problems(page: Page):
9+
page.get_by_role("link", name="More problems covered by legal aid").click()
10+
page.get_by_role("link", name="Next steps to get help").click()
11+
expect(
12+
page.get_by_role("heading", name=CANNOT_FIND_PROBLEM_HEADING)
13+
).to_be_visible()
14+
15+
16+
@pytest.mark.usefixtures("live_server")
17+
def test_community_care(page: Page):
18+
page.get_by_role(
19+
"link", name="Care needs for disability and old age (social care)"
20+
).click()
21+
page.get_by_role("link", name="Next steps to get help").click()
22+
expect(
23+
page.get_by_role("heading", name=CANNOT_FIND_PROBLEM_HEADING)
24+
).to_be_visible()
25+
26+
27+
@pytest.mark.usefixtures("live_server")
28+
def test_public_law(page: Page):
29+
page.get_by_role(
30+
"link", name="Legal action against police and public organisations"
31+
).click()
32+
page.get_by_role("link", name="Next steps to get help").click()
33+
expect(
34+
page.get_by_role("heading", name=CANNOT_FIND_PROBLEM_HEADING)
35+
).to_be_visible()
36+
37+
38+
@pytest.mark.usefixtures("live_server")
39+
def test_mental_capacity(page: Page):
40+
page.get_by_role("link", name="Mental capacity, mental health").click()
41+
page.get_by_role("link", name="Next steps to get help").click()
42+
expect(
43+
page.get_by_role("heading", name=CANNOT_FIND_PROBLEM_HEADING)
44+
).to_be_visible()

0 commit comments

Comments
 (0)