1
0

fix(kanban): reset done and default bucket when the bucket itself is deleted

Resolves https://github.com/go-vikunja/vikunja/issues/234
This commit is contained in:
kolaente
2024-03-12 22:23:35 +01:00
parent e1c972d64d
commit 5b2b7f7bdc
2 changed files with 40 additions and 7 deletions

View File

@ -197,6 +197,23 @@ func TestBucket_Delete(t *testing.T) {
"project_id": 18,
}, false)
})
t.Run("done bucket should be reset", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
s := db.NewSession()
defer s.Close()
b := &Bucket{
ID: 3,
ProjectID: 1,
}
err := b.Delete(s, user)
require.NoError(t, err)
db.AssertMissing(t, "projects", map[string]interface{}{
"id": 1,
"done_bucket_id": 3,
})
})
}
func TestBucket_Update(t *testing.T) {