mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Adding a test for the dashboard usage area
This commit is contained in:
@@ -1517,6 +1517,7 @@ def test_breadcrumb_shows_if_service_is_suspended(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_service_dashboard_shows_usage(
|
def test_service_dashboard_shows_usage(
|
||||||
|
mocker,
|
||||||
client_request,
|
client_request,
|
||||||
service_one,
|
service_one,
|
||||||
mock_get_service_templates,
|
mock_get_service_templates,
|
||||||
@@ -1526,18 +1527,22 @@ def test_service_dashboard_shows_usage(
|
|||||||
mock_get_free_sms_fragment_limit,
|
mock_get_free_sms_fragment_limit,
|
||||||
permissions,
|
permissions,
|
||||||
):
|
):
|
||||||
|
mocker.patch(
|
||||||
|
"app.service_api_client.get_global_notification_count",
|
||||||
|
return_value={
|
||||||
|
"count": 500,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
service_one["permissions"] = permissions
|
service_one["permissions"] = permissions
|
||||||
page = client_request.get("main.service_dashboard", service_id=SERVICE_ONE_ID)
|
page = client_request.get("main.service_dashboard", service_id=SERVICE_ONE_ID)
|
||||||
|
|
||||||
assert normalize_spaces(page.select_one("[data-key=usage]").text) == (
|
table_rows = page.find_all("tbody")[0].find_all("tr")
|
||||||
"Daily Usage Remaining "
|
|
||||||
"251,800 "
|
assert len(table_rows) == 1
|
||||||
"$29.85 "
|
|
||||||
"spent on text messages"
|
assert "500" in table_rows[0].find_all("td")[0].text
|
||||||
# Disabled for pilot
|
assert "9500" in table_rows[0].find_all("td")[1].text
|
||||||
# '0 '
|
|
||||||
# 'email disabled during SMS pilot'
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_service_dashboard_shows_free_allowance(
|
def test_service_dashboard_shows_free_allowance(
|
||||||
|
|||||||
Reference in New Issue
Block a user