Skip to content

Commit

Permalink
fixed title testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Beverly Nguyen authored and Beverly Nguyen committed Dec 3, 2024
1 parent 66c377c commit 4946bed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
4 changes: 1 addition & 3 deletions app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
<html lang="{{ htmlLang | default('en') }}" class="{{ htmlClasses }}">
<head>
<title>
{% block pageTitle %}
{% block per_page_title %}{% endblock %} – Notify.gov
{% endblock %}
{% block pageTitle %}{% block per_page_title %}{% endblock %} – Notify.gov{% endblock %}
</title>
{% include "components/head.html" %}
</head>
Expand Down
4 changes: 1 addition & 3 deletions app/templates/views/templates/choose.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

{% set page_title = 'Select or create a template' %}

{% block service_page_title %}
{{page_title}}
{% endblock %}
{% block service_page_title %}{{page_title}}{% endblock %}

{% block maincolumn_content %}

Expand Down
9 changes: 2 additions & 7 deletions app/templates/withnav_template.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{% extends "base.html" %}

{% block per_page_title %}
{% if current_org.name %}
{% block org_page_title %}{% endblock %} – {{ current_org.name }}
{% else %}
{% block service_page_title %}{% endblock %} – {{ current_service.name }}
{% endif %}
{% endblock %}
{% block per_page_title %}{% if current_org.name %}{% block org_page_title %}{% endblock %} – {{ current_org.name }}{%
else %}{% block service_page_title %}{% endblock %} – {{ current_service.name }}{% endif %}{% endblock %}

{% block main %}
<div class="grid-container">
Expand Down
13 changes: 7 additions & 6 deletions tests/app/main/views/test_template_folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):

@pytest.mark.parametrize(
(
"expected_title_tag",
"expected_page_title",
"expected_title_tag",
"expected_parent_link_args",
"extra_args",
"expected_nav_links",
Expand All @@ -54,7 +54,7 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
[
(
"Select or create a template – service one – Notify.gov",
"Templates",
"Select or create a template",
[],
{},
["Email", "Text message"],
Expand Down Expand Up @@ -93,7 +93,7 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
),
(
"Select or create a template – service one – Notify.gov",
"Templates",
"Select or create a template",
[],
{"template_type": "all"},
["Email", "Text message"],
Expand Down Expand Up @@ -132,7 +132,7 @@ def _folder(name, folder_id=None, parent=None, users_with_permission=None):
),
(
"Select or create a template – service one – Notify.gov",
"Templates",
"Select or create a template",
[],
{"template_type": "sms"},
["All", "Email"],
Expand Down Expand Up @@ -346,8 +346,9 @@ def test_should_show_templates_folder_page(
**extra_args,
)

assert normalize_spaces(page.select_one("title").text) == expected_title_tag
assert normalize_spaces(page.select_one("h2").text) == expected_page_title

assert normalize_spaces(page.select_one("title").text) == expected_page_title
assert normalize_spaces(page.select_one("h1").text) == expected_title_tag

assert len(page.select("h2 a")) == len(expected_parent_link_args)

Expand Down

0 comments on commit 4946bed

Please sign in to comment.