fix project sort test

This commit is contained in:
Denys Konovalov 2024-01-21 15:48:45 +01:00
parent 58e56cd0c6
commit 74043f7b4c
No known key found for this signature in database
GPG Key ID: 0037E1B0E33BD2C9

View File

@ -92,19 +92,19 @@ func TestProjectsSort(t *testing.T) {
}{ }{
{ {
sortType: "default", sortType: "default",
wants: []int64{1, 3, 2, 4}, wants: []int64{1, 3, 2, 4, 5, 6},
}, },
{ {
sortType: "oldest", sortType: "oldest",
wants: []int64{4, 2, 3, 1}, wants: []int64{4, 5, 6, 2, 3, 1},
}, },
{ {
sortType: "recentupdate", sortType: "recentupdate",
wants: []int64{1, 3, 2, 4}, wants: []int64{1, 3, 2, 4, 5, 6},
}, },
{ {
sortType: "leastupdate", sortType: "leastupdate",
wants: []int64{4, 2, 3, 1}, wants: []int64{4, 5, 6, 2, 3, 1},
}, },
} }
@ -113,8 +113,8 @@ func TestProjectsSort(t *testing.T) {
OrderBy: GetSearchOrderByBySortType(tt.sortType), OrderBy: GetSearchOrderByBySortType(tt.sortType),
}) })
assert.NoError(t, err) assert.NoError(t, err)
assert.EqualValues(t, int64(4), count) assert.EqualValues(t, int64(6), count)
if assert.Len(t, projects, 4) { if assert.Len(t, projects, 6) {
for i := range projects { for i := range projects {
assert.EqualValues(t, tt.wants[i], projects[i].ID) assert.EqualValues(t, tt.wants[i], projects[i].ID)
} }