Add live search to letter brandings

Matches what we do for email branding, makes the one you’re lookig for
quicker to find.
This commit is contained in:
Chris Hill-Scott
2018-11-05 13:58:22 +00:00
parent 43988661d6
commit 10013a19aa
3 changed files with 14 additions and 15 deletions

View File

@@ -2116,13 +2116,13 @@ def test_set_letter_branding_prepopulates(
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
for element in {'label', 'input[type=radio]'}:
for element in {'label[for^=dvla_org_id]', 'input[type=radio]'}:
assert len(page.select(element)) == len(expected_items)
for index, expected_item in enumerate(expected_items):
expected_value, expected_label = expected_item
assert normalize_spaces(page.select('label')[index].text) == expected_label
assert page.select('input')[index]['value'] == expected_value
assert normalize_spaces(page.select('label[for^=dvla_org_id]')[index].text) == expected_label
assert page.select('input[type=radio]')[index]['value'] == expected_value
assert len(page.select('input[checked]')) == 1
assert page.select('input[checked]')[0]['value'] == expected_selected