mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-23 14:49:28 +00:00
fix project sort test
This commit is contained in:
parent
58e56cd0c6
commit
74043f7b4c
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user