mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
use sent_at instead of updated_at
This commit is contained in:
@@ -90,7 +90,7 @@ def view_notification(service_id, notification_id, error_message=None):
|
|||||||
partials=get_single_notification_partials(notification),
|
partials=get_single_notification_partials(notification),
|
||||||
created_by=notification.get("created_by"),
|
created_by=notification.get("created_by"),
|
||||||
created_at=notification["created_at"],
|
created_at=notification["created_at"],
|
||||||
updated_at=notification["updated_at"],
|
updated_at=notification["sent_at"],
|
||||||
help=get_help_argument(),
|
help=get_help_argument(),
|
||||||
notification_id=notification["id"],
|
notification_id=notification["id"],
|
||||||
can_receive_inbound=(current_service.has_permission("inbound_sms")),
|
can_receive_inbound=(current_service.has_permission("inbound_sms")),
|
||||||
|
|||||||
@@ -160,8 +160,8 @@ def test_can_show_notifications(
|
|||||||
assert normalize_spaces(
|
assert normalize_spaces(
|
||||||
first_row.select_one(".table-field-right-aligned .align-with-message-body").text
|
first_row.select_one(".table-field-right-aligned .align-with-message-body").text
|
||||||
) in [
|
) in [
|
||||||
"Delivered 1 January at 02:01 US/Eastern",
|
"Delivered 1 January at 02:00 US/Eastern",
|
||||||
"Delivered 1 January at 01:01 US/Eastern",
|
"Delivered 1 January at 01:00 US/Eastern",
|
||||||
]
|
]
|
||||||
|
|
||||||
assert page_title in page.h1.text.strip()
|
assert page_title in page.h1.text.strip()
|
||||||
@@ -661,31 +661,31 @@ def test_redacts_templates_that_should_be_redacted(
|
|||||||
(
|
(
|
||||||
"email",
|
"email",
|
||||||
"temporary-failure",
|
"temporary-failure",
|
||||||
"Inbox not accepting messages right now 27 September at 08:31 US/Eastern",
|
"Inbox not accepting messages right now 27 September at 08:30 US/Eastern",
|
||||||
False,
|
False,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"email",
|
"email",
|
||||||
"permanent-failure",
|
"permanent-failure",
|
||||||
"Email address does not exist 27 September at 08:31 US/Eastern",
|
"Email address does not exist 27 September at 08:30 US/Eastern",
|
||||||
False,
|
False,
|
||||||
),
|
),
|
||||||
("email", "delivered", "Delivered 27 September at 08:31 US/Eastern", True),
|
("email", "delivered", "Delivered 27 September at 08:30 US/Eastern", True),
|
||||||
("sms", "created", "Sending since 27 September at 08:30 US/Eastern", True),
|
("sms", "created", "Sending since 27 September at 08:30 US/Eastern", True),
|
||||||
("sms", "sending", "Sending since 27 September at 08:30 US/Eastern", True),
|
("sms", "sending", "Sending since 27 September at 08:30 US/Eastern", True),
|
||||||
(
|
(
|
||||||
"sms",
|
"sms",
|
||||||
"temporary-failure",
|
"temporary-failure",
|
||||||
"Phone not accepting messages right now 27 September at 08:31 US/Eastern",
|
"Phone not accepting messages right now 27 September at 08:30 US/Eastern",
|
||||||
False,
|
False,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"sms",
|
"sms",
|
||||||
"permanent-failure",
|
"permanent-failure",
|
||||||
"Not delivered 27 September at 08:31 US/Eastern",
|
"Not delivered 27 September at 08:30 US/Eastern",
|
||||||
False,
|
False,
|
||||||
),
|
),
|
||||||
("sms", "delivered", "Delivered 27 September at 08:31 US/Eastern", True),
|
("sms", "delivered", "Delivered 27 September at 08:30 US/Eastern", True),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_sending_status_hint_displays_correctly_on_notifications_page(
|
def test_sending_status_hint_displays_correctly_on_notifications_page(
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ def test_should_show_page_for_one_job(
|
|||||||
|
|
||||||
assert page.h1.text.strip() == "thisisatest.csv"
|
assert page.h1.text.strip() == "thisisatest.csv"
|
||||||
assert " ".join(page.find("tbody").find("tr").text.split()) == (
|
assert " ".join(page.find("tbody").find("tr").text.split()) == (
|
||||||
"2021234567 template content Delivered 1 January at 06:10 US/Eastern"
|
"2021234567 template content Delivered 1 January at 06:09 US/Eastern"
|
||||||
)
|
)
|
||||||
assert page.find("div", {"data-key": "notifications"})["data-resource"] == url_for(
|
assert page.find("div", {"data-key": "notifications"})["data-resource"] == url_for(
|
||||||
"main.view_job_updates",
|
"main.view_job_updates",
|
||||||
@@ -109,7 +109,7 @@ def test_should_show_page_for_one_job(
|
|||||||
assert page.find("span", {"id": "time-left"}).text == "Data available for 7 days"
|
assert page.find("span", {"id": "time-left"}).text == "Data available for 7 days"
|
||||||
|
|
||||||
assert normalize_spaces(page.select_one("tbody tr").text) == normalize_spaces(
|
assert normalize_spaces(page.select_one("tbody tr").text) == normalize_spaces(
|
||||||
"2021234567 " "template content " "Delivered 1 January at 06:10 US/Eastern"
|
"2021234567 " "template content " "Delivered 1 January at 06:09 US/Eastern"
|
||||||
)
|
)
|
||||||
assert page.select_one("tbody tr a")["href"] == url_for(
|
assert page.select_one("tbody tr a")["href"] == url_for(
|
||||||
"main.view_notification",
|
"main.view_notification",
|
||||||
@@ -424,7 +424,7 @@ def test_should_show_updates_for_one_job_as_json(
|
|||||||
assert "2021234567" in content["notifications"]
|
assert "2021234567" in content["notifications"]
|
||||||
assert "Status" in content["notifications"]
|
assert "Status" in content["notifications"]
|
||||||
assert "Delivered" in content["notifications"]
|
assert "Delivered" in content["notifications"]
|
||||||
assert "00:01" in content["notifications"]
|
assert "00:00" in content["notifications"]
|
||||||
assert "Sent by Test User on 1 January at 00:00" in content["status"]
|
assert "Sent by Test User on 1 January at 00:00" in content["status"]
|
||||||
|
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@ def test_should_show_updates_for_scheduled_job_as_json(
|
|||||||
assert "2021234567" in content["notifications"]
|
assert "2021234567" in content["notifications"]
|
||||||
assert "Status" in content["notifications"]
|
assert "Status" in content["notifications"]
|
||||||
assert "Delivered" in content["notifications"]
|
assert "Delivered" in content["notifications"]
|
||||||
assert "00:01" in content["notifications"]
|
assert "00:00" in content["notifications"]
|
||||||
assert "Sent by Test User on 1 June at 16:00" in content["status"]
|
assert "Sent by Test User on 1 June at 16:00" in content["status"]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user