Fix tests & lint

This commit is contained in:
kolaente 2021-07-20 11:00:20 +02:00
parent 733f26f017
commit c7f337f303
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 9 additions and 3 deletions

View file

@ -17,7 +17,6 @@
package files package files
import ( import (
"code.vikunja.io/api/pkg/log"
"io" "io"
"os" "os"
"strconv" "strconv"
@ -25,6 +24,7 @@ import (
"code.vikunja.io/api/pkg/config" "code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/db" "code.vikunja.io/api/pkg/db"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/web" "code.vikunja.io/web"
"github.com/c2h5oh/datasize" "github.com/c2h5oh/datasize"
"github.com/spf13/afero" "github.com/spf13/afero"

View file

@ -195,7 +195,13 @@ func TestTaskComment_ReadAll(t *testing.T) {
comments := result.([]*TaskComment) comments := result.([]*TaskComment)
assert.NoError(t, err) assert.NoError(t, err)
assert.Len(t, comments, 2) assert.Len(t, comments, 2)
assert.Equal(t, int64(-2), comments[0].AuthorID) var foundComment bool
assert.NotNil(t, comments[0].Author) for _, comment := range comments {
if comment.AuthorID == -2 {
foundComment = true
}
assert.NotNil(t, comment.Author)
}
assert.True(t, foundComment)
}) })
} }