Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional more problems routing #153

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions app/templates/categories/more-problems.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ <h1 class="govuk-heading-xl govuk-!-margin-bottom-8">{{ title }}</h1>

{{ list_item_small(_("Adopting a child from outside the UK"),
_("Adoption processes in the courts."),
url_for("categories.index")) }}
url_for("find-a-legal-adviser.search", category="mat")) }}

{{ list_item_small(_("Appeal a decision that you cannot work with children or vulnerable adults"),
_("Including if you’re on a ‘barred list’ or disqualified from teaching."),
url_for("categories.index")) }}
url_for("find-a-legal-adviser.search")) }}

{{ list_item_small(_("Anti-social behaviour and gangs"),
_("If you’re accused or taken to court for anti-social behaviour, including being in a gang."),
Expand All @@ -34,43 +34,43 @@ <h1 class="govuk-heading-xl govuk-!-margin-bottom-8">{{ title }}</h1>

{{ list_item_small(_("Compensation for abuse, assault or neglect"),
_("Includes child abuse, sexual assault, abuse of a vulnerable adult. Claims can be against a person or an organisation."),
url_for("categories.index")) }}
url_for("find-a-legal-adviser.search", category="aap")) }}

{{ list_item_small(_("Domestic abuse - if you have been accused"),
_("Legal help if you’ve been accused of domestic abuse or forced marriage. Includes non-molestation orders and other court orders."),
url_for("categories.index")) }}
url_for("categories.domestic_abuse.are_you_at_risk_of_harm")) }}

{{ list_item_small(_("Environmental pollution"),
_("Issues about air, water or land pollution that is harming you or the environment."),
url_for("categories.index")) }}
url_for("find-a-legal-adviser.search", category="pub")) }}

{{ list_item_small(_("Female genital mutilation (FGM)"),
_("If you or someone else is at risk of FGM."),
url_for("categories.index")) }}
url_for("categories.domestic_abuse.are_you_at_risk_of_harm")) }}

{{ list_item_small(_("Forced marriage"),
_("Help with forced marriage and Forced Marriage Protection Orders."),
url_for("categories.index")) }}
url_for("categories.domestic_abuse.are_you_at_risk_of_harm")) }}

{{ list_item_small(_("Inquests for family members"),
_("Advice to prepare for the inquest of a family member."),
url_for("categories.index")) }}
url_for("find-a-legal-adviser.search")) }}

{{ list_item_small(_("Mental health detention"),
_("Help if you’re held in hospital (‘sectioned’), mental health tribunals and community treatment orders."),
url_for("categories.index"))}}
url_for("find-a-legal-adviser.search", category="mhe"))}}

{{ list_item_small(_("Proceeds of Crime Act"),
_("If you’re facing legal action to take your money or other assets."),
url_for("categories.index")) }}
url_for("find-a-legal-adviser.search", category="crm")) }}

{{ list_item_small(_("Terrorism"),
_("If you’re accused of terrorism or financing terrorist groups."),
url_for("categories.index")) }}
url_for("find-a-legal-adviser.search", category="immas", secondary_category="pub")) }}

{{ list_item_small(_("Trafficking, modern slavery"),
_("Help if you’re a victim of human trafficking or modern slavery."),
url_for("categories.index")) }}
url_for("find-a-legal-adviser.search", category="immas")) }}

<div class="govuk-!-margin-top-9 govuk-!-margin-bottom-9">
{{ cannot_find_your_problem(None, url_for("categories.results.cannot_find_problem"))}}
Expand Down
50 changes: 50 additions & 0 deletions tests/functional_tests/categories/test_more_problems.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import pytest
from playwright.sync_api import Page, expect

FALA_ROUTES = [
# Link text, FALA Primary Category, FALA Secondary Category
("Adopting a child from outside the UK", "mat", ""),
(
"Appeal a decision that you cannot work with children or vulnerable adults",
"",
"",
),
("Clinical negligence in babies", "med", ""),
("Compensation for abuse, assault or neglect", "aap", ""),
("Environmental pollution", "pub", ""),
("Inquests for family members", "", ""),
("Mental health detention", "mhe", ""),
("Proceeds of Crime Act", "crm", ""),
("Terrorism", "immas", "pub"),
("Trafficking, modern slavery", "immas", ""),
]

DOMESTIC_ABUSE_ROUTES = [
"Domestic abuse - if you have been accused",
"Female genital mutilation (FGM)",
"Forced marriage",
]


@pytest.mark.usefixtures("live_server")
class TestMoreProblems:
@pytest.mark.parametrize("route, primary_category, secondary_category", FALA_ROUTES)
def test_fala_routes(
self, page: Page, route: str, primary_category: str, secondary_category: str
):
page.get_by_role("link", name="More problems covered by legal aid").click()
page.get_by_role("link", name=route).click()
expect(page.get_by_role("heading", name="Find a legal adviser")).to_be_visible()
if primary_category:
assert f"category={primary_category}" in page.url
if secondary_category:
assert f"secondary_category={secondary_category}" in page.url

@pytest.mark.parametrize("route", DOMESTIC_ABUSE_ROUTES)
def test_domestic_abuse_routes(self, page: Page, route: str):
"""These pages route to the "Are you worried about someone's safety?" page in the domestic abuse journey."""
page.get_by_role("link", name="More problems covered by legal aid").click()
page.get_by_role("link", name=route).click()
expect(
page.get_by_role("heading", name="Are you worried about someone's safety?")
).to_be_visible()
Loading