mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Make inbox page update using AJAX
Fairly self-explanatory. Uses the same pattern of breaking things up into functions as the jobs page.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
from functools import partial
|
||||
import copy
|
||||
from unittest.mock import call, ANY
|
||||
@@ -220,6 +221,30 @@ def test_anyone_can_see_inbox(
|
||||
)
|
||||
|
||||
|
||||
def test_view_inbox_updates(
|
||||
logged_in_client,
|
||||
service_one,
|
||||
mocker,
|
||||
mock_get_inbound_sms_with_no_messages,
|
||||
):
|
||||
|
||||
service_one['permissions'] = ['inbound_sms']
|
||||
|
||||
mock_get_partials = mocker.patch(
|
||||
'app.main.views.dashboard.get_inbox_partials',
|
||||
return_value={'messages': 'foo'},
|
||||
)
|
||||
|
||||
response = logged_in_client.get(url_for(
|
||||
'main.inbox_updates', service_id=SERVICE_ONE_ID,
|
||||
))
|
||||
|
||||
assert response.status_code == 200
|
||||
assert json.loads(response.get_data(as_text=True)) == {'messages': 'foo'}
|
||||
|
||||
mock_get_partials.assert_called_once_with(SERVICE_ONE_ID)
|
||||
|
||||
|
||||
def test_should_show_recent_templates_on_dashboard(
|
||||
logged_in_client,
|
||||
mocker,
|
||||
|
||||
Reference in New Issue
Block a user