mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 07:18:26 -04:00
Merge pull request #3180 from alphagov/update-error-page-content
Update error page content
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{% extends "withoutnav_template.html" %}
|
{% extends "withoutnav_template.html" %}
|
||||||
{% block per_page_title %}Bad Request{% endblock %}
|
{% block per_page_title %}Bad request{% endblock %}
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{% extends "withoutnav_template.html" %}
|
{% extends "withoutnav_template.html" %}
|
||||||
{% block per_page_title %}Unauthorized{% endblock %}
|
{% block per_page_title %}You are not authorised to see this page{% endblock %}
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
<h1>401</h1>
|
<h1>You are not authorised to see this page</h1>
|
||||||
<p>You are not authorized to see this page.</p>
|
<p><a href="{{ url_for('.sign_in' )}}">Sign in</a> to GOV.UK Notify and try again.</p>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{% extends "withoutnav_template.html" %}
|
{% extends "withoutnav_template.html" %}
|
||||||
{% block per_page_title %}403{% endblock %}
|
{% block per_page_title %}You are not allowed to see this page{% endblock %}
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
<h1 class="heading-large">
|
<h1 class="heading-large">
|
||||||
403
|
You are not allowed to see this page
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
You do not have permission to view this page.
|
To check your permissions, speak to a member of your team who can manage settings, team and usage.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
{% extends "withoutnav_template.html" %}
|
{% extends "withoutnav_template.html" %}
|
||||||
{% block per_page_title %}Page could not be found{% endblock %}
|
{% block per_page_title %}Page not found{% endblock %}
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
<h1 class="heading-large">
|
<h1 class="heading-large">
|
||||||
Page could not be found
|
Page not found
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
Check you’ve entered the correct web address.
|
If you typed the web address, check it is correct.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If you pasted the web address, check you copied the entire address.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If the web address is correct or you selected a link or button, <a href="{{ url_for('main.support') }}">contact us</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,10 +4,16 @@
|
|||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
<h1 class="heading-large">
|
<h1 class="heading-large">
|
||||||
Page could not be found
|
Page not found
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
Check you’ve entered the correct web address.
|
If you typed the web address, check it is correct.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If you pasted the web address, check you copied the entire address.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If the web address is correct or you selected a link or button, <a href="{{ url_for('main.support') }}">contact us</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
{% extends "withoutnav_template.html" %}
|
{% extends "withoutnav_template.html" %}
|
||||||
{% block per_page_title %}Server error{% endblock %}
|
{% block per_page_title %}Sorry, there’s a problem with the service{% endblock %}
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
<h1 class="heading-large">
|
<h1 class="heading-large">
|
||||||
Sorry, we’re experiencing technical difficulties
|
Sorry, there’s a problem with GOV.UK Notify
|
||||||
</h1>
|
</h1>
|
||||||
<p>Try again later.</p>
|
<p>
|
||||||
|
Try again later.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
You can check our <a href="https://status.notifications.service.gov.uk">system status</a> page to see if there are any known issues.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
To report a problem, email <a href="mailto:notify-support@digital.cabinet-office.gov.uk">notify-support@digital.cabinet-office.gov.uk</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ def test_bad_url_returns_page_not_found(client):
|
|||||||
response = client.get('/bad_url')
|
response = client.get('/bad_url')
|
||||||
assert response.status_code == 404
|
assert response.status_code == 404
|
||||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||||
assert page.h1.string.strip() == 'Page could not be found'
|
assert page.h1.string.strip() == 'Page not found'
|
||||||
|
assert page.title.string.strip() == 'Page not found – GOV.UK Notify'
|
||||||
|
|
||||||
|
|
||||||
def test_load_service_before_request_handles_404(client_request, mocker):
|
def test_load_service_before_request_handles_404(client_request, mocker):
|
||||||
@@ -35,9 +36,10 @@ def test_malformed_token_returns_page_not_found(logged_in_client, url):
|
|||||||
|
|
||||||
assert response.status_code == 404
|
assert response.status_code == 404
|
||||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||||
assert page.h1.string.strip() == 'Page could not be found'
|
assert page.h1.string.strip() == 'Page not found'
|
||||||
flash_banner = page.find('div', class_='banner-dangerous').string.strip()
|
flash_banner = page.find('div', class_='banner-dangerous').string.strip()
|
||||||
assert flash_banner == "There’s something wrong with the link you’ve used."
|
assert flash_banner == "There’s something wrong with the link you’ve used."
|
||||||
|
assert page.title.string.strip() == 'Page not found – GOV.UK Notify'
|
||||||
|
|
||||||
|
|
||||||
def test_csrf_returns_400(logged_in_client, mocker):
|
def test_csrf_returns_400(logged_in_client, mocker):
|
||||||
@@ -50,6 +52,7 @@ def test_csrf_returns_400(logged_in_client, mocker):
|
|||||||
assert response.status_code == 400
|
assert response.status_code == 400
|
||||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||||
assert page.h1.string.strip() == 'Something went wrong, please go back and try again.'
|
assert page.h1.string.strip() == 'Something went wrong, please go back and try again.'
|
||||||
|
assert page.title.string.strip() == 'Bad request – GOV.UK Notify'
|
||||||
|
|
||||||
|
|
||||||
def test_csrf_redirects_to_sign_in_page_if_not_signed_in(client, mocker):
|
def test_csrf_redirects_to_sign_in_page_if_not_signed_in(client, mocker):
|
||||||
@@ -68,3 +71,4 @@ def test_405_returns_something_went_wrong_page(client, mocker):
|
|||||||
assert response.status_code == 405
|
assert response.status_code == 405
|
||||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||||
assert page.h1.string.strip() == 'Something went wrong, please go back and try again.'
|
assert page.h1.string.strip() == 'Something went wrong, please go back and try again.'
|
||||||
|
assert page.title.string.strip() == 'Bad request – GOV.UK Notify'
|
||||||
|
|||||||
@@ -247,8 +247,8 @@ def test_choose_account_should_not_show_back_to_service_link_if_service_archived
|
|||||||
)),
|
)),
|
||||||
(service_two, 403, (
|
(service_two, 403, (
|
||||||
# Page has no ‘back to’ link
|
# Page has no ‘back to’ link
|
||||||
'403 '
|
'You are not allowed to see this page '
|
||||||
'You do not have permission to view this page.'
|
'To check your permissions, speak to a member of your team who can manage settings, team and usage.'
|
||||||
)),
|
)),
|
||||||
))
|
))
|
||||||
def test_should_not_show_back_to_service_if_user_doesnt_belong_to_service(
|
def test_should_not_show_back_to_service_if_user_doesnt_belong_to_service(
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ def test_signed_in_existing_user_cannot_use_anothers_invite(
|
|||||||
_follow_redirects=True,
|
_follow_redirects=True,
|
||||||
_expected_status=403,
|
_expected_status=403,
|
||||||
)
|
)
|
||||||
assert page.h1.string.strip() == '403'
|
assert page.h1.string.strip() == 'You are not allowed to see this page'
|
||||||
flash_banners = page.find_all('div', class_='banner-dangerous')
|
flash_banners = page.find_all('div', class_='banner-dangerous')
|
||||||
assert len(flash_banners) == 1
|
assert len(flash_banners) == 1
|
||||||
banner_contents = flash_banners[0].text.strip()
|
banner_contents = flash_banners[0].text.strip()
|
||||||
|
|||||||
Reference in New Issue
Block a user