Revert "Replace govuk template with govuk frontend components"

This commit is contained in:
Tom Byers
2019-11-25 10:37:35 +00:00
committed by GitHub
parent db255c7cf3
commit e02f94f238
47 changed files with 356 additions and 939 deletions

View File

@@ -88,7 +88,7 @@ def test_choose_account_should_show_choose_accounts_page(
mock_get_organisation,
):
resp = client_request.get('main.choose_account')
page = resp.find('main', {'id': 'main-content'})
page = resp.find('div', {'id': 'content'}).main
assert normalize_spaces(page.h1.text) == 'Choose service'
outer_list_items = page.select('nav ul')[0].select('li')
@@ -144,7 +144,7 @@ def test_choose_account_should_show_choose_accounts_page_if_no_services(
'services': []
}
resp = client_request.get('main.choose_account')
page = resp.find('main', {'id': 'main-content'})
page = resp.find('div', {'id': 'content'}).main
links = page.findAll('a')
assert len(links) == 1
@@ -182,8 +182,8 @@ def test_choose_account_should_show_back_to_service_link(
):
resp = client_request.get('main.choose_account')
service_navigation = resp.find('div', {'class': 'navigation-service'})
back_to_service_link = service_navigation.a
page = resp.find('div', {'id': 'content'})
back_to_service_link = page.find('div', {'class': 'navigation-service'}).a
assert back_to_service_link['href'] == url_for('main.show_accounts_or_dashboard')
assert back_to_service_link.text == 'Back to service one'
@@ -273,7 +273,7 @@ def test_should_not_show_back_to_service_if_user_doesnt_belong_to_service(
)
assert normalize_spaces(
page.select_one('header + .govuk-width-container').text
page.select_one('#content').text
).startswith(
normalize_spaces(page_text)
)

View File

@@ -172,8 +172,10 @@ def test_css_is_served_from_correct_path(client_request):
page.select('link[rel=stylesheet]')
):
assert link['href'].startswith([
'https://static.example.com/stylesheets/govuk-template.css?',
'https://static.example.com/stylesheets/govuk-template-print.css?',
'https://static.example.com/stylesheets/fonts.css?',
'https://static.example.com/stylesheets/main.css?',
'https://static.example.com/stylesheets/print.css?',
][index])

View File

@@ -227,9 +227,10 @@ def test_notification_page_shows_page_for_letter_notification(
letter_images = page.select('main img')
assert len(letter_images) == count_of_pages
for index in range(count_of_pages):
for index in range(1, count_of_pages + 1):
assert page.select('img')[index]['src'].endswith(
'.png?page={}'.format(index + 1)
'.png?page={}'.format(index)
)
assert len(mock_page_count.call_args_list) == 1

View File

@@ -94,7 +94,7 @@ def test_show_correct_title_and_description_for_sender_type(
assert page.select_one('h1').text == expected_title
for element in ('legend', 'legend .govuk-visually-hidden'):
for element in ('legend', 'legend .visually-hidden'):
assert normalize_spaces(page.select_one(element).text) == expected_description

View File

@@ -1187,8 +1187,8 @@ def test_non_gov_user_is_told_they_cant_go_live(
assert normalize_spaces(page.select_one('main p').text) == (
'Only team members with a government email address can request to go live.'
)
assert len(page.select('form')) == 0
assert len(page.select('button')) == 1
assert page.select('form') == []
assert page.select('button') == []
@pytest.mark.parametrize('consent_to_research, displayed_consent', (

View File

@@ -835,7 +835,7 @@ def test_delete_template_folder_should_request_confirmation(
assert page.select_one('input[name=name]')['value'] == 'sacrifice'
assert len(page.select('form')) == 2
assert len(page.select('button')) == 3
assert len(page.select('button')) == 2
assert 'action' not in page.select('form')[0]
assert page.select('form button')[0].text == 'Yes, delete'