diff --git a/app/categories/__init__.py b/app/categories/__init__.py index 43310bd32..4c36e596a 100644 --- a/app/categories/__init__.py +++ b/app/categories/__init__.py @@ -5,7 +5,9 @@ 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 .public import bp as public_bp + from .family import bp as family_bp from .benefits import bp as benefits_bp from .results import bp as results_bp @@ -19,6 +21,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(public_bp) bp.register_blueprint(benefits_bp) diff --git a/app/categories/send/__init__.py b/app/categories/send/__init__.py new file mode 100644 index 000000000..1b9f70dad --- /dev/null +++ b/app/categories/send/__init__.py @@ -0,0 +1,9 @@ +from flask import Blueprint + +bp = Blueprint( + "send", + __name__, + template_folder="./templates", +) + +from app.categories.send import urls # noqa: E402,F401 diff --git a/app/categories/send/urls.py b/app/categories/send/urls.py new file mode 100644 index 000000000..17e6cbc01 --- /dev/null +++ b/app/categories/send/urls.py @@ -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) diff --git a/app/templates/categories/index.html b/app/templates/categories/index.html index 2b56be0dc..5c898bbaa 100644 --- a/app/templates/categories/index.html +++ b/app/templates/categories/index.html @@ -49,7 +49,7 @@

Most searched problems

{{ list_item_arrow("Special educational needs and disability (SEND)", "Help if your child has SEND.", - url_for("categories.index")) }} + url_for("categories.send.landing")) }}
diff --git a/app/templates/categories/send/landing.html b/app/templates/categories/send/landing.html new file mode 100644 index 000000000..967c8559d --- /dev/null +++ b/app/templates/categories/send/landing.html @@ -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() }} + +
+
+

{% trans %}Special educational needs and disability (SEND){% endtrans %}

+ + {{ 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")) }} + +
+ +

{% trans %}More problems{% endtrans %}

+ +
+ + {{ 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"))}} + +
+
+{% endblock %} \ No newline at end of file diff --git a/tests/functional_tests/categories/send/__init__.py b/tests/functional_tests/categories/send/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/functional_tests/categories/send/test_send.py b/tests/functional_tests/categories/send/test_send.py new file mode 100644 index 000000000..c481faf8f --- /dev/null +++ b/tests/functional_tests/categories/send/test_send.py @@ -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()