mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-12 05:10:45 -04:00
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:
@@ -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,
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user