Add more thorough tests for the template search

It would be quite easy to dissociate the search box from the things its
supposed to be searching.

This commit adds assertions to make sure that the things the search box
is targeting are on the page
This commit is contained in:
Chris Hill-Scott
2018-11-10 16:37:29 +00:00
parent e4f8f4e98a
commit d98ec79a9d

View File

@@ -173,8 +173,12 @@ def test_should_show_live_search_if_list_of_templates_taller_than_screen(
'main.choose_template',
service_id=SERVICE_ONE_ID,
)
search = page.select_one('.live-search')
assert page.select('.live-search')
assert search['data-module'] == 'live-search'
assert search['data-targets'] == '#template-list .column-whole'
assert len(page.select(search['data-targets'])) == len(page.select('.message-name')) == 14
def test_should_show_page_for_one_template(