Skip to content

Commit 930d7ef

Browse files
committed
add parameter no data test
1 parent 9d96052 commit 930d7ef

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

coderd/insights_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,17 @@ func TestTemplateInsights_Golden(t *testing.T) {
12491249
}
12501250
},
12511251
},
1252+
{
1253+
name: "two days ago, no data",
1254+
ignoreTimes: true,
1255+
makeRequest: func(_ []*testTemplate) codersdk.TemplateInsightsRequest {
1256+
twoDaysAgo := time.Now().UTC().Truncate(24*time.Hour).AddDate(0, 0, -2)
1257+
return codersdk.TemplateInsightsRequest{
1258+
StartTime: twoDaysAgo,
1259+
EndTime: twoDaysAgo.AddDate(0, 0, 1),
1260+
}
1261+
},
1262+
},
12521263
},
12531264
},
12541265
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"report": {
3+
"start_time": "0001-01-01T00:00:00Z",
4+
"end_time": "0001-01-01T00:00:00Z",
5+
"template_ids": [],
6+
"active_users": 0,
7+
"apps_usage": [
8+
{
9+
"template_ids": [],
10+
"type": "builtin",
11+
"display_name": "Visual Studio Code",
12+
"slug": "vscode",
13+
"icon": "/icon/code.svg",
14+
"seconds": 0
15+
},
16+
{
17+
"template_ids": [],
18+
"type": "builtin",
19+
"display_name": "JetBrains",
20+
"slug": "jetbrains",
21+
"icon": "/icon/intellij.svg",
22+
"seconds": 0
23+
},
24+
{
25+
"template_ids": [],
26+
"type": "builtin",
27+
"display_name": "Web Terminal",
28+
"slug": "reconnecting-pty",
29+
"icon": "/icon/terminal.svg",
30+
"seconds": 0
31+
},
32+
{
33+
"template_ids": [],
34+
"type": "builtin",
35+
"display_name": "SSH",
36+
"slug": "ssh",
37+
"icon": "/icon/terminal.svg",
38+
"seconds": 0
39+
}
40+
],
41+
"parameters_usage": []
42+
},
43+
"interval_reports": []
44+
}

0 commit comments

Comments
 (0)