generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add next steps alternate help page * Update unit and functional tests * Temporarily enable staging deployment for demo * Remove old referral page * Add immigration and asylum article category name * Revert "Remove old referral page" This reverts commit acd3ca2. * Add additional functionality tests * Open ECF link in a new tab * Remove staging deployment * Update unit tests to assert correct immigration help organisations are called * Update functional tests for new education category * Add exceptional-case-funding component to reduce duplication * Replace 2x br with margin bottom on the body
- Loading branch information
1 parent
c564d81
commit ddaeae9
Showing
13 changed files
with
188 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
app/templates/categories/components/exceptional-case-funding.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% macro exceptionalCaseFundingSidebar(category) %} | ||
<aside class="sidebar"> | ||
<h2 class="govuk-heading-m">{% trans %}Exceptional cases{% endtrans %}</h2> | ||
{% if category == 'education' %} | ||
<p class="govuk-body">{% trans %}In exceptional cases or if your case is going to a judicial review, legal aid may still be available.{% endtrans %}</p> | ||
{% else %} | ||
<p class="govuk-body">{% trans %}In exceptional cases, legal aid may still be available.{% endtrans %}</p> | ||
{% endif %} | ||
{% set fala_url = url_for("find-a-legal-adviser.search", category=fala_category_code.lower() if fala_category_code else None) %} | ||
{% set fala_link %}<a class='govuk-link' href={{ fala_url }}>{% trans %}ask a legal adviser{% endtrans %}</a> {% endset %} | ||
<p class="govuk-body">{% trans fala_link=fala_link %}You can {{fala_link}} if an application might succeed in your case and how to apply.{% endtrans %}</p> | ||
{% set ecf_link %}<a href='https://www.gov.uk/legal-aid-apply-for-exceptional-case-funding' rel='external' class='govuk-link' target="_blank">{% trans %}apply directly{% endtrans %}</a>{% endset %} | ||
<p class="govuk-body">{% trans ecf_link=ecf_link %}You can also {{ ecf_link }} to the Legal Aid Agency.{% endtrans %}</p> | ||
</aside> | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{% extends 'base.html' %} | ||
{%- from 'components/back_link.html' import govukBackLink -%} | ||
{%- from 'govuk_frontend_jinja/components/button/macro.html' import govukButton %} | ||
{%- from 'categories/components/help-organisations.html' import helpOrganisationsList %} | ||
{%- from 'categories/components/exceptional-case-funding.html' import exceptionalCaseFundingSidebar %} | ||
|
||
{% block beforeContent %} | ||
{{ super() }} | ||
{{ govukBackLink() }} | ||
{% endblock %} | ||
|
||
{% set title = _("Next steps to get help") %} | ||
{% block pageTitle %}{{ title }} - GOV.UK{% endblock %} | ||
|
||
|
||
{% set alternate_help_intro_text %} | ||
{% if category.code == "domestic_abuse" %} | ||
{{ _("These organisations give free, independent advice for problems about domestic abuse.") }} | ||
{% elif category.code == "public_law" %} | ||
{{ _("These organisations give free, independent advice for problems with police and public organisations.") }} | ||
{% elif category.code == "mental_health" %} | ||
{{ _("These organisations give free, independent advice for problems about mental health and mental capacity.") }} | ||
{% elif category.code == "asylum_and_immigration" %} | ||
{{ _("These organisations give free, independent advice for problems about asylum and immigration.") }} | ||
{% elif category.code == "community_care" %} | ||
{{ _("These organisations give free, independent advice for problems about disability and old age (social care).") }} | ||
{% elif category.code == "benefits" %} | ||
{{ _("These organisations give free, independent advice for problems about benefits.") }} | ||
{% elif category.code == "family" %} | ||
{{ _("These organisations give free, independent advice for problems about children, families and relationships.") }} | ||
{% elif category.code == "housing" %} | ||
{{ _("These organisations give free, independent advice for problems about housing.") }} | ||
{% elif category.code == "discrimination" %} | ||
{{ _("These organisations give free, independent advice for problems about discrimination.") }} | ||
{% elif category.code == "send" %} | ||
{{ _("These organisations give free, independent advice for problems about special educational needs (SEND).") }} | ||
{% else %} | ||
{{ _("These organisations give free, independent advice.") }} | ||
{% endif %} | ||
{% endset %} | ||
|
||
{% block content %} | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-xl">{{ title }}</h1> | ||
|
||
<h2 class="govuk-heading-l">{% trans %}Find other free or low-cost legal help{% endtrans %}</h2> | ||
|
||
{% set citizens_advice_link %}<a class="govuk-link" href="https://www.citizensadvice.org.uk/law-and-courts/legal-system/finding-free-or-affordable-legal-help/" target="_blank">{% trans %}free or affordable legal help (opens new tab).{% endtrans %}</a>{% endset %} | ||
<p class="govuk-body">{% trans %}The Citizen’s Advice website explains how to find {% endtrans %}{{ citizens_advice_link }}</p> | ||
|
||
|
||
{% set survey_link %}<a class="govuk-link" href="https://www.gov.uk/done/check-if-civil-legal-advice-can-help-you" target="_blank">What did you think of this service?</a>{% endset %} | ||
<p class="govuk-body">{{ survey_link }} (takes 30 seconds)</p> | ||
|
||
<h2 class="govuk-heading-l">{% trans %}Speak to an advice organisation{% endtrans %}</h2> | ||
|
||
{% if organisations %} | ||
{# We use lowercase_category_name rather than lower, to not convert acronyms to lowercase #} | ||
<p class="govuk-body">{{ alternate_help_intro_text }}</p> | ||
{{ helpOrganisationsList(organisations, truncate=5) }} | ||
{% endif %} | ||
|
||
|
||
</div> | ||
<div class="govuk-grid-column-one-third"> | ||
{{ exceptionalCaseFundingSidebar(category) }} | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import pytest | ||
from playwright.sync_api import Page, expect | ||
|
||
|
||
@pytest.mark.usefixtures("live_server") | ||
@pytest.mark.parametrize( | ||
"category_name, expected_text", | ||
[ | ||
pytest.param( | ||
"Children, families, relationships", | ||
"These organisations give free, independent advice for problems about children, families and relationships.", | ||
id="family-category", | ||
), | ||
pytest.param( | ||
"Police and public organisations", | ||
"These organisations give free, independent advice for problems with police and public organisations.", | ||
id="public-law-category", | ||
), | ||
pytest.param( | ||
"Mental capacity, mental health", | ||
"These organisations give free, independent advice for problems about mental health and mental capacity.", | ||
id="mental-health-category", | ||
), | ||
pytest.param( | ||
"Asylum and immigration", | ||
"These organisations give free, independent advice for problems about asylum and immigration.", | ||
id="asylum-immigration-category", | ||
), | ||
pytest.param( | ||
"Care needs for disability and old age (social care)", | ||
"These organisations give free, independent advice for problems about disability and old age (social care).", | ||
id="community-care-category", | ||
), | ||
pytest.param( | ||
"Housing, homelessness, losing your home", | ||
"These organisations give free, independent advice for problems about housing.", | ||
id="housing-category", | ||
), | ||
pytest.param( | ||
"Special educational needs and disability (SEND)", | ||
"These organisations give free, independent advice for problems about special educational needs (SEND).", | ||
id="send-category", | ||
), | ||
], | ||
) | ||
def test_category_next_steps_page(page: Page, category_name: str, expected_text: str): | ||
page.get_by_role("link", name=category_name).click() | ||
page.get_by_role("link", name="Next steps to get help").click() | ||
page.get_by_role("button", name="Next steps to get help").click() | ||
expect(page.get_by_role("heading", name="Next steps to get help")).to_be_visible() | ||
expect(page.get_by_text(expected_text)).to_be_visible() | ||
|
||
|
||
def test_discrimination_next_steps_page(page: Page): | ||
page.get_by_role("link", name="Discrimination").click() | ||
page.get_by_role("checkbox", name="School, college, university").check() | ||
page.get_by_role("button", name="Continue").click() | ||
page.get_by_role("checkbox", name="None of these").check() | ||
page.get_by_role("button", name="Continue").click() | ||
page.get_by_role("button", name="Next steps to get help").click() | ||
expect(page.get_by_role("heading", name="Next steps to get help")).to_be_visible() | ||
expect( | ||
page.get_by_text( | ||
"These organisations give free, independent advice for problems about discrimination." | ||
) | ||
).to_be_visible() | ||
|
||
|
||
def test_benefits_next_steps_page(page: Page): | ||
page.get_by_role("link", name="Benefits").click() | ||
page.get_by_role("radio", name="None of these").check() | ||
page.get_by_role("button", name="Continue").click() | ||
page.get_by_role("button", name="Next steps to get help").click() | ||
expect(page.get_by_role("heading", name="Next steps to get help")).to_be_visible() | ||
expect( | ||
page.get_by_text( | ||
"These organisations give free, independent advice for problems about benefits." | ||
) | ||
).to_be_visible() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters