From 3ed0cc14379aba3bc78161f701a2b91c9d2612f7 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 6 Sep 2018 12:02:40 +0100 Subject: [PATCH] Fix live search on email brand selection At some point the element with a `class` of `brand-styles` was removed from the page, meaning the search stopped working. --- app/templates/views/service-settings/set-email-branding.html | 2 +- tests/app/main/views/test_service_settings.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/templates/views/service-settings/set-email-branding.html b/app/templates/views/service-settings/set-email-branding.html index ee8d8d73e..b79c7a542 100644 --- a/app/templates/views/service-settings/set-email-branding.html +++ b/app/templates/views/service-settings/set-email-branding.html @@ -17,7 +17,7 @@
- {{ live_search(target_selector='.brand_styles .multiple-choice', show=show_search_box, form=search_form, label='Search branding styles by name') }} + {{ live_search(target_selector='.multiple-choice', show=show_search_box, form=search_form, label='Search branding styles by name') }} {{ radios(form.branding_style) }}
diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 28a2792d3..abace066a 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -1926,6 +1926,9 @@ def test_should_show_live_search_if_list_of_brand_styles_taller_than_page( page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') assert page.select('.live-search') + search_target = page.select_one('.live-search')['data-targets'] + assert search_target == '.multiple-choice' + assert len(page.select(search_target)) == 9 def test_should_send_branding_and_organisations_to_preview(