Add autocomplete to email address on register form

GOV.UK Design System recommends:
> You should also set the autocomplete attribute to email. This lets
> browsers autofill the email address on a user’s behalf if they’ve
> entered it previously.

Only doing this on the register and sign in forms because it’s unlikely
to be helpful where a user is trying to enter someone else’s email
address.
This commit is contained in:
Chris Hill-Scott
2019-07-16 09:01:21 +01:00
parent 88242c31d1
commit 30eeaec154
4 changed files with 13 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ def test_render_register_returns_template_with_form(client):
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.find('input', attrs={'name': 'auth_type'}).attrs['value'] == 'sms_auth'
assert page.select_one('#email_address')['spellcheck'] == 'false'
assert page.select_one('#email_address')['autocomplete'] == 'email'
assert 'Create an account' in response.get_data(as_text=True)