Fix tasks not disappearing from the kanban board when moving them between lists

This commit is contained in:
kolaente 2021-02-20 15:35:30 +01:00
parent 08dcc77228
commit 8e2dfcffd5
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 35 additions and 0 deletions

View File

@ -371,5 +371,39 @@ describe('Lists', () => {
cy.url()
.should('contain', `/tasks/${tasks[0].id}`)
})
it('Should remove a task from the kanban board when moving it to another list', () => {
const lists = ListFactory.create(2)
const tasks = TaskFactory.create(5, {
id: '{increment}',
list_id: 1,
bucket_id: 1,
})
const task = tasks[0]
cy.visit('/lists/1/kanban')
cy.getAttached('.kanban .bucket .tasks .task')
.contains(task.title)
.should('be.visible')
.click()
cy.get('.task-view .action-buttons .button')
.contains('Move task')
.click()
cy.get('.task-view .content.details .field .multiselect.control .input-wrapper input')
.type(`${lists[1].title}{enter}`)
// The requests happen with a 200ms timeout. Because of that, the results are not yet there when cypress
// presses enter and we can't simulate pressing on enter to select the item.
cy.get('.task-view .content.details .field .multiselect.control .search-results')
.children()
.first()
.click()
cy.get('.global-notification')
.should('contain', 'Success')
cy.go('back')
cy.get('.kanban .bucket')
.should('not.contain', task.title)
})
})
})

View File

@ -679,6 +679,7 @@ export default {
changeList(list) {
this.task.listId = list.id
this.saveTask()
this.$store.commit('kanban/removeTaskInBucket', this.task)
},
},
}