1
0

Kanban bucket limits (#652)

Fix integration tests

Generate swagger docs

Add test for moving a task between buckets

Add check for bucket limit when updating a task

Add fixture to ensure a bucket with a high limit will never exceed the limit

Refactor bucket limit check into seperate function

Add test for creating and fix

Fix unexported field

Add error in case a task was added to a bucket which has its limit already exceeded

Add migration to add new task field

Add limit field to buckets

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/652
This commit is contained in:
konrad
2020-09-04 14:37:56 +00:00
parent 5317a89623
commit 14d706c91e
11 changed files with 166 additions and 10 deletions

View File

@ -289,9 +289,9 @@ func TestTask(t *testing.T) {
})
t.Run("Bucket", func(t *testing.T) {
t.Run("Normal", func(t *testing.T) {
rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "1"}, `{"bucket_id":2}`)
rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "1"}, `{"bucket_id":3}`)
assert.NoError(t, err)
assert.Contains(t, rec.Body.String(), `"bucket_id":2`)
assert.Contains(t, rec.Body.String(), `"bucket_id":3`)
assert.NotContains(t, rec.Body.String(), `"bucket_id":1`)
})
t.Run("Different List", func(t *testing.T) {
@ -472,9 +472,9 @@ func TestTask(t *testing.T) {
})
t.Run("Bucket", func(t *testing.T) {
t.Run("Normal", func(t *testing.T) {
rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "1"}, `{"title":"Lorem Ipsum","bucket_id":2}`)
rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "1"}, `{"title":"Lorem Ipsum","bucket_id":3}`)
assert.NoError(t, err)
assert.Contains(t, rec.Body.String(), `"bucket_id":2`)
assert.Contains(t, rec.Body.String(), `"bucket_id":3`)
assert.NotContains(t, rec.Body.String(), `"bucket_id":1`)
})
t.Run("Different List", func(t *testing.T) {