From 8e2dfcffd5dc8d778ee6b6d3c781464cfd49a6b3 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 20 Feb 2021 15:35:30 +0100 Subject: [PATCH] Fix tasks not disappearing from the kanban board when moving them between lists --- cypress/integration/list/list.spec.js | 34 +++++++++++++++++++++++++++ src/views/tasks/TaskDetailView.vue | 1 + 2 files changed, 35 insertions(+) diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index 28b6b509..c4c3ba57 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -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) + }) }) }) diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index cb838f0a..7943a6fb 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -679,6 +679,7 @@ export default { changeList(list) { this.task.listId = list.id this.saveTask() + this.$store.commit('kanban/removeTaskInBucket', this.task) }, }, }