mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-27 13:51:12 -05:00
Merge pull request #3509 from alphagov/fix-broadcast-library-examples
Fix examples on choose broadcast library page
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
|
||||
{% for library in libraries|sort %}
|
||||
<a class="file-list-filename-large govuk-link govuk-link--no-visited-state" href="{{ url_for('.choose_broadcast_area', service_id=current_service.id, library_slug=library.id) }}">{{ library.name }}</a>
|
||||
<p class="file-list-hint-large">{{ library.examples }}</p>
|
||||
<p class="file-list-hint-large">{{ library.get_examples() }}</p>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
from flask import url_for
|
||||
|
||||
from tests.conftest import SERVICE_ONE_ID
|
||||
from tests.conftest import SERVICE_ONE_ID, normalize_spaces
|
||||
|
||||
|
||||
@pytest.mark.parametrize('endpoint, extra_args', (
|
||||
@@ -85,10 +85,34 @@ def test_choose_broadcast_library_page(
|
||||
service_one,
|
||||
):
|
||||
service_one['permissions'] += ['broadcast']
|
||||
client_request.get(
|
||||
page = client_request.get(
|
||||
'.choose_broadcast_library',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
)
|
||||
assert [
|
||||
(normalize_spaces(title.text), normalize_spaces(hint.text))
|
||||
for title, hint in list(zip(
|
||||
page.select('.file-list-filename-large'), page.select('.file-list-hint-large')
|
||||
))
|
||||
] == [
|
||||
(
|
||||
'Counties and Unitary Authorities in England and Wales',
|
||||
'Barking and Dagenham, Barnet, Barnsley and 171 more…',
|
||||
),
|
||||
(
|
||||
'Countries',
|
||||
'England, Northern Ireland, Scotland and Wales',
|
||||
),
|
||||
(
|
||||
'Regions of England',
|
||||
'East Midlands, East of England, London and 6 more…',
|
||||
),
|
||||
]
|
||||
assert page.select_one('a.file-list-filename-large.govuk-link')['href'] == url_for(
|
||||
'.choose_broadcast_area',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
library_slug='counties-and-unitary-authorities-in-england-and-wales',
|
||||
)
|
||||
|
||||
|
||||
def test_choose_broadcast_area_page(
|
||||
|
||||
Reference in New Issue
Block a user