Skip to content

Commit

Permalink
Add header link to schema page
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanjbrown committed Mar 30, 2024
1 parent 87f3702 commit 7130d4f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
9 changes: 7 additions & 2 deletions consultation_analyser/consultations/jinja2/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@
{{ govukHeader({
"homepageUrl": "https://www.gov.uk",
"serviceName": "Consultations Analyser",
"serviceUrl": "/"
}) }}
"serviceUrl": "/",
'navigation': [
{
'href': "/schema",
'text': "Data schema",
'active': request.path == "/schema"
}]}) }}


<div class="govuk-width-container">
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/test_home_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,14 @@ def test_get_question_summary_page(django_app):

assert "Question summary" in question_page
assert f"{question.text}" in question_page


@pytest.mark.django_db
def test_nav_links(django_app):
homepage = django_app.get("/")
assert len(homepage.html.select(".govuk-header__navigation-item--active")) == 0

schema_page = homepage.click("Data schema")

assert len(schema_page.html.select(".govuk-header__navigation-item--active")) == 1
assert "data schema" in schema_page

0 comments on commit 7130d4f

Please sign in to comment.