Skip to content

Commit afeab94

Browse files
authored
Update heatmap fixtures to restore tests (#8615) (#8616)
* Update heatmap fixtures to restore tests * Add hint to check the fixture age on fail
1 parent cf35355 commit afeab94

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

integrations/api_user_heatmap_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestUserHeatmap(t *testing.T) {
2626
var heatmap []*models.UserHeatmapData
2727
DecodeJSON(t, resp, &heatmap)
2828
var dummyheatmap []*models.UserHeatmapData
29-
dummyheatmap = append(dummyheatmap, &models.UserHeatmapData{Timestamp: 1540080000, Contributions: 1})
29+
dummyheatmap = append(dummyheatmap, &models.UserHeatmapData{Timestamp: 1571616000, Contributions: 1})
3030

3131
assert.Equal(t, dummyheatmap, heatmap)
3232
}

models/fixtures/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
act_user_id: 2
66
repo_id: 2
77
is_private: true
8-
created_unix: 1540139562
8+
created_unix: 1571686356
99

1010
-
1111
id: 2

models/user_heatmap_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
1717
CountResult int
1818
JSONResult string
1919
}{
20-
{2, 1, `[{"timestamp":1540080000,"contributions":1}]`},
20+
{2, 1, `[{"timestamp":1571616000,"contributions":1}]`},
2121
{3, 0, `[]`},
2222
}
2323
// Prepare
@@ -41,7 +41,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
4141
// Get the heatmap and compare
4242
heatmap, err := GetUserHeatmapDataByUser(user)
4343
assert.NoError(t, err)
44-
assert.Equal(t, len(actions), len(heatmap))
44+
assert.Equal(t, len(actions), len(heatmap), "invalid action count: did the test data became too old?")
4545
assert.Equal(t, tc.CountResult, len(heatmap))
4646

4747
//Test JSON rendering

0 commit comments

Comments
 (0)