Add live-search visibility test for conversations

It is only shown if the number of messages don't
fit onto the screen.
This commit is contained in:
Tom Byers
2018-08-16 16:15:34 +01:00
parent 3bc7c1c224
commit 7d6714ed68
2 changed files with 29 additions and 1 deletions

View File

@@ -278,6 +278,34 @@ def test_conversation_reply_shows_templates(
)
def test_conversation_reply_shows_live_search_if_list_of_templates_taller_than_screen(
client_request,
fake_uuid,
mock_get_more_service_templates_than_can_fit_onscreen,
):
page = client_request.get(
'main.conversation_reply',
service_id=SERVICE_ONE_ID,
notification_id=fake_uuid,
)
assert page.select('.live-search')
def test_conversation_reply_shows_live_search_if_list_of_templates_fits_onscreen(
client_request,
fake_uuid,
mock_get_service_templates,
):
page = client_request.get(
'main.conversation_reply',
service_id=SERVICE_ONE_ID,
notification_id=fake_uuid,
)
assert not page.select('.live-search')
def test_conversation_reply_redirects_with_phone_number_from_notification(
client_request,
fake_uuid,

View File

@@ -990,7 +990,7 @@ def mock_get_service_templates(mocker):
@pytest.fixture(scope='function')
def mock_get_more_service_templates_than_can_fit_onscreen(mocker):
def _create(service_id):
return create_service_templates(service_id, number_of_templates=10)
return create_service_templates(service_id, number_of_templates=20)
return mocker.patch(
'app.service_api_client.get_service_templates',