aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeripath2019-10-21 22:19:27 +0100
committerGitHub2019-10-21 22:19:27 +0100
commit10e549df7d5031e3ea5cbecccaf079f8ef0f9769 (patch)
treeceef51bfaf35f002307e843e6bfc77990b28180b
parent519f69eb418b5704beacfeeedef169b53b8f69e6 (diff)
Update heatmap fixtures to restore tests (#8615) (#8617)
* Update heatmap fixtures to restore tests * Add hint to check the fixture age on fail
-rw-r--r--integrations/api_user_heatmap_test.go2
-rw-r--r--models/fixtures/action.yml2
-rw-r--r--models/user_heatmap_test.go4
3 files changed, 4 insertions, 4 deletions
diff --git a/integrations/api_user_heatmap_test.go b/integrations/api_user_heatmap_test.go
index 5c65dc1bc..fd98a17ef 100644
--- a/integrations/api_user_heatmap_test.go
+++ b/integrations/api_user_heatmap_test.go
@@ -24,7 +24,7 @@ func TestUserHeatmap(t *testing.T) {
var heatmap []*models.UserHeatmapData
DecodeJSON(t, resp, &heatmap)
var dummyheatmap []*models.UserHeatmapData
- dummyheatmap = append(dummyheatmap, &models.UserHeatmapData{Timestamp: 1540080000, Contributions: 1})
+ dummyheatmap = append(dummyheatmap, &models.UserHeatmapData{Timestamp: 1571616000, Contributions: 1})
assert.Equal(t, dummyheatmap, heatmap)
}
diff --git a/models/fixtures/action.yml b/models/fixtures/action.yml
index 34a1a8b2b..e8a6d531f 100644
--- a/models/fixtures/action.yml
+++ b/models/fixtures/action.yml
@@ -5,7 +5,7 @@
act_user_id: 2
repo_id: 2
is_private: true
- created_unix: 1540139562
+ created_unix: 1571686356
-
id: 2
diff --git a/models/user_heatmap_test.go b/models/user_heatmap_test.go
index a71202d85..f882b3524 100644
--- a/models/user_heatmap_test.go
+++ b/models/user_heatmap_test.go
@@ -17,7 +17,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
CountResult int
JSONResult string
}{
- {2, 1, `[{"timestamp":1540080000,"contributions":1}]`},
+ {2, 1, `[{"timestamp":1571616000,"contributions":1}]`},
{3, 0, `[]`},
}
// Prepare
@@ -41,7 +41,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
// Get the heatmap and compare
heatmap, err := GetUserHeatmapDataByUser(user)
assert.NoError(t, err)
- assert.Equal(t, len(actions), len(heatmap))
+ assert.Equal(t, len(actions), len(heatmap), "invalid action count: did the test data became too old?")
assert.Equal(t, tc.CountResult, len(heatmap))
//Test JSON rendering