Add singular descriptions for libraries

This lets us write nice interface copy like ‘Choose a local authority
from the local authorities library’.
This commit is contained in:
Chris Hill-Scott
2020-08-13 17:33:58 +01:00
parent 72f5dcb91f
commit 1c74d0798a
8 changed files with 37 additions and 17 deletions

View File

@@ -164,6 +164,6 @@ def test_repository_has_all_libraries():
assert len(libraries) == 2
assert [
'Countries',
'Local authorities',
] == [name for _, name, _is_group in libraries]
('Countries', 'country'),
('Local authorities', 'local authority'),
] == [(name, name_singular) for _, name, name_singular, _is_group in libraries]

View File

@@ -320,6 +320,9 @@ def test_choose_broadcast_area_page(
broadcast_message_id=fake_uuid,
library_slug='ctry19',
)
assert normalize_spaces(page.select_one('h1').text) == (
'Choose countries'
)
assert [
(
choice.select_one('input')['value'],
@@ -347,6 +350,9 @@ def test_choose_broadcast_area_page_for_area_with_sub_areas(
broadcast_message_id=fake_uuid,
library_slug='wd20-lad20',
)
assert normalize_spaces(page.select_one('h1').text) == (
'Choose a local authority'
)
partial_url_for = partial(
url_for,
'main.choose_broadcast_sub_area',