test: verify task bucket assignment for list views with manual buckets
This commit is contained in:
parent
939eba7b44
commit
a32f759228
|
|
@ -158,6 +158,31 @@ func TestTask_Create(t *testing.T) {
|
|||
require.Error(t, err)
|
||||
assert.True(t, user.IsErrUserDoesNotExist(err))
|
||||
})
|
||||
t.Run("task assigned to list view with manual buckets", func(t *testing.T) {
|
||||
db.LoadAndAssertFixtures(t)
|
||||
s := db.NewSession()
|
||||
defer s.Close()
|
||||
|
||||
task := &Task{
|
||||
Title: "Test list view bucket assignment",
|
||||
ProjectID: 1,
|
||||
}
|
||||
err := task.Create(s, usr)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, s.Commit())
|
||||
|
||||
// Task should be assigned to default bucket of the list view with manual buckets (view 161, bucket 41)
|
||||
db.AssertExists(t, "task_buckets", map[string]interface{}{
|
||||
"task_id": task.ID,
|
||||
"bucket_id": 41,
|
||||
"project_view_id": 161,
|
||||
}, false)
|
||||
// Task should also still be assigned to the kanban view's default bucket
|
||||
db.AssertExists(t, "task_buckets", map[string]interface{}{
|
||||
"task_id": task.ID,
|
||||
"bucket_id": 1,
|
||||
}, false)
|
||||
})
|
||||
t.Run("default bucket different", func(t *testing.T) {
|
||||
db.LoadAndAssertFixtures(t)
|
||||
s := db.NewSession()
|
||||
|
|
|
|||
Loading…
Reference in New Issue