From c7f337f303354d47db9f1b1bb7d8a27f71b3f868 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 20 Jul 2021 11:00:20 +0200 Subject: [PATCH] Fix tests & lint --- pkg/files/files.go | 2 +- pkg/models/task_comments_test.go | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/files/files.go b/pkg/files/files.go index 1357434d..58986647 100644 --- a/pkg/files/files.go +++ b/pkg/files/files.go @@ -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" diff --git a/pkg/models/task_comments_test.go b/pkg/models/task_comments_test.go index ea272e27..5397888d 100644 --- a/pkg/models/task_comments_test.go +++ b/pkg/models/task_comments_test.go @@ -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) }) }