mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(coderd): humanize duration on notifications (#14333)
This commit is contained in:
@@ -691,7 +691,7 @@ func TestNotificationTemplatesCanRender(t *testing.T) {
|
||||
"reason": "breached the template's threshold for inactivity",
|
||||
"initiator": "autobuild",
|
||||
"dormancyHours": "24",
|
||||
"timeTilDormant": "24h",
|
||||
"timeTilDormant": "24 hours",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -716,7 +716,20 @@ func TestNotificationTemplatesCanRender(t *testing.T) {
|
||||
"name": "bobby-workspace",
|
||||
"reason": "template updated to new dormancy policy",
|
||||
"dormancyHours": "24",
|
||||
"timeTilDormant": "24h",
|
||||
"timeTilDormant": "24 hours",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "TemplateWorkspaceMarkedForDeletionInOneWeek",
|
||||
id: notifications.TemplateWorkspaceMarkedForDeletion,
|
||||
payload: types.MessagePayload{
|
||||
UserName: "bobby",
|
||||
Labels: map[string]string{
|
||||
"name": "bobby-workspace",
|
||||
"reason": "template updated to new dormancy policy",
|
||||
"dormancyHours": "168", // 168 hours = 7 days = 1 week
|
||||
"timeTilDormant": "1 week",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user