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

LGA-3403 - Add SEND category #71

Merged
merged 4 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions app/categories/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .housing import bp as housing_bp
from .mental_capacity import bp as mental_capacity_bp
from .community_care import bp as community_care_bp
from .send import bp as send_bp
from .family import bp as family_bp
from .benefits import bp as benefits_bp
from .results import bp as results_bp
Expand All @@ -18,6 +19,7 @@
bp.register_blueprint(results_bp)
bp.register_blueprint(asylum_immigration_bp)
bp.register_blueprint(community_care_bp)
bp.register_blueprint(send_bp)
bp.register_blueprint(benefits_bp)

from app.categories import urls # noqa: E402,F401
9 changes: 9 additions & 0 deletions app/categories/send/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from flask import Blueprint

bp = Blueprint(
"send",
__name__,
template_folder="./templates",
)

from app.categories.send import urls # noqa: E402,F401
28 changes: 28 additions & 0 deletions app/categories/send/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from app.categories.send import bp
from app.categories.views import CategoryLandingPage


class SendLandingPage(CategoryLandingPage):
question_title = "Special educational needs and disability (SEND)"

category = "send"

routing_map = {
"child_young_person": "categories.index",
"tribunals": "categories.index",
"child_in_care": "categories.index",
"discrimination": "categories.results.in_scope",
"schools": "categories.results.in_scope",
"disability": "categories.index",
"other": "categories.results.refer",
}


bp.add_url_rule(
"/send/",
view_func=SendLandingPage.as_view(
"landing", template="categories/send/landing.html"
),
)

SendLandingPage.register_routes(blueprint=bp)
2 changes: 1 addition & 1 deletion app/templates/categories/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2 class="govuk-heading-m govuk-!-margin-bottom-4">Most searched problems</h2>

{{ list_item_arrow("Special educational needs and disability (SEND)",
"Help if your child has SEND.",
url_for("categories.index")) }}
url_for("categories.send.landing")) }}
</div>

<br>
Expand Down
55 changes: 55 additions & 0 deletions app/templates/categories/send/landing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{% extends "base.html" %}
{%- from 'govuk_frontend_jinja/components/back-link/macro.html' import govukBackLink -%}
{%- from 'govuk_frontend_jinja/components/exit-this-page/macro.html' import govukExitThisPage -%}
{%- from 'categories/components/list-item.html' import list_item, list_item_small -%}
{%- from 'categories/components/cannot-find-your-problem.html' import cannot_find_your_problem -%}

{% block pageTitle %}{% trans %}Special educational needs and disability (SEND){% endtrans %} - GOV.UK{% endblock %}

{% block beforeContent%}
{{ super() }}
{{ govukBackLink({
'href': url_for('categories.index'),
'text': "Back"
}) }}

{% endblock %}

{% block content %}

{{ super() }}

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-xl">{% trans %}Special educational needs and disability (SEND){% endtrans %}</h1>

{{ list_item(_("Help with a child or young person's SEND)"),
_("Help with schools, other education settings and local authorities. Includes help with education, health and care plans (EHCP) or if a child’s needs are not being met."),
url_for("categories.send.child_young_person")) }}

{{ list_item(_("SEND tribunals"),
_("Applying for or going to a SEND tribunal, appealing a decision by a tribunal."),
url_for("categories.send.tribunals")) }}

{{ list_item(_("Child treated unfairly at school, discrimination"),
_("If a child is treated unfairly at school because of their disability. Or if you were treated badly for complaining about this."),
url_for("categories.send.discrimination")) }}

<br>

<h2 class="govuk-heading-m">{% trans %}More problems{% endtrans %}</h2>

<br>

{{ list_item_small(_("Other problems with schools"),
_("Advice about legal action against a school. Includes if a child is out of school, exclusions, transport to school, judicial reviews."),
url_for("categories.send.schools")) }}

{{ list_item_small(_("Care needs for disability (social care)"),
_("Problems getting the local authority or council to provide or pay for the right care. For carers, children, young people and adults."),
url_for("categories.send.disability")) }}
{{ cannot_find_your_problem(_("SEND"), url_for("categories.send.other"))}}

</div>
</div>
{% endblock %}
Empty file.
47 changes: 47 additions & 0 deletions tests/functional_tests/categories/send/test_send.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from playwright.sync_api import Page, expect
import pytest

child_in_care_heading = "Find problems covered by legal aid"
legaild_aid_available_heading = "Legal aid is available for this type of problem"
ROUTING = [
{
"link_text": "Help with a child or young person's SEND",
"next_page_heading": child_in_care_heading,
},
{
"link_text": "SEND tribunals",
"next_page_heading": child_in_care_heading,
},
{
"link_text": "Child treated unfairly at school, discrimination",
"next_page_heading": legaild_aid_available_heading,
},
{
"link_text": "Other problems with schools",
"next_page_heading": legaild_aid_available_heading,
},
{
"link_text": "Care needs for disability (social care)",
"next_page_heading": child_in_care_heading,
},
{"link_text": "Next steps to get help", "next_page_heading": "Referral page"},
]


@pytest.mark.usefixtures("live_server")
class TestSendLandingPage:
@pytest.mark.parametrize("routing", ROUTING)
def test_onward_routing(self, page: Page, routing: dict):
page.get_by_role(
"link", name="Special educational needs and disability (SEND)"
).click()
page.get_by_role("link", name=routing["link_text"]).click()

next_page_heading = routing["next_page_heading"]
next_page_heading = (
next_page_heading
if isinstance(next_page_heading, list)
else [next_page_heading]
)
for page_heading in next_page_heading:
expect(page.get_by_text(page_heading)).to_be_visible()
Loading