remove option for branding to sometimes not show search

it wouldn't show search if there were under a certain amount of letter
or email branding options - however we know there will always be more
than that amount so lets remove some complexity.

Also, rename the SearchTemplatesForm because it can search anything -
it just prompts you to search by name is all.
This commit is contained in:
Leo Hemsted
2019-02-06 17:32:13 +00:00
parent 7590b3dba9
commit f83910599c
10 changed files with 16 additions and 72 deletions

View File

@@ -2227,37 +2227,6 @@ def test_should_show_branding_styles(
app.service_api_client.get_service.assert_called_once_with(service_one['id'])
def test_should_show_live_search_if_list_of_brand_styles_fits_onscreen(
logged_in_platform_admin_client,
service_one,
mock_get_email_branding_that_can_fit_onscreen,
):
response = logged_in_platform_admin_client.get(url_for(
'main.service_set_email_branding', service_id=service_one['id']
))
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert not page.select('.live-search')
def test_should_show_live_search_if_list_of_brand_styles_taller_than_page(
logged_in_platform_admin_client,
service_one,
mock_get_more_email_branding_than_can_fit_onscreen,
):
response = logged_in_platform_admin_client.get(url_for(
'main.service_set_email_branding', service_id=service_one['id']
))
assert response.status_code == 200
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(
logged_in_platform_admin_client,
service_one,