|
|
@ -17,7 +17,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) { |
|
|
|
CountResult int |
|
|
|
CountResult int |
|
|
|
JSONResult string |
|
|
|
JSONResult string |
|
|
|
}{ |
|
|
|
}{ |
|
|
|
{2, 1, `[{"timestamp":1540080000,"contributions":1}]`}, |
|
|
|
{2, 1, `[{"timestamp":1571616000,"contributions":1}]`}, |
|
|
|
{3, 0, `[]`}, |
|
|
|
{3, 0, `[]`}, |
|
|
|
} |
|
|
|
} |
|
|
|
// Prepare
|
|
|
|
// Prepare
|
|
|
@ -41,7 +41,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) { |
|
|
|
// Get the heatmap and compare
|
|
|
|
// Get the heatmap and compare
|
|
|
|
heatmap, err := GetUserHeatmapDataByUser(user) |
|
|
|
heatmap, err := GetUserHeatmapDataByUser(user) |
|
|
|
assert.NoError(t, err) |
|
|
|
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)) |
|
|
|
assert.Equal(t, tc.CountResult, len(heatmap)) |
|
|
|
|
|
|
|
|
|
|
|
//Test JSON rendering
|
|
|
|
//Test JSON rendering
|
|
|
|