Fix tests & lint

This commit is contained in:
kolaente 2021-07-20 11:00:20 +02:00
parent 733f26f017
commit c7f337f303
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 9 additions and 3 deletions

View File

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

View File

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