diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index a79236d1..107b5528 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -436,26 +436,23 @@ describe('Lists', () => { .should('exist') }) + it('Can drag tasks around', () => { + const tasks = TaskFactory.create(2, { + list_id: 1, + bucket_id: 1, + }) + cy.visit('/lists/1/kanban') - // The following test does not work. It seems like vue-smooth-dnd does not use either mousemove or dragstart - // (not sure why this actually works at all?) and as I'm planning to swap that out for vuedraggable/sortable.js - // anyway, I figured it wouldn't be worth the hassle right now. - -// it('Can drag tasks around', () => { -// const tasks = TaskFactory.create(2, { -// list_id: 1, -// bucket_id: 1, -// }) -// cy.visit('/lists/1/kanban') -// -// cy.get('.kanban .bucket .tasks .task') -// .contains(tasks[0].title) -// .first() -// .drag('.kanban .bucket:nth-child(2) .tasks .smooth-dnd-container.vertical') -// .trigger('mousedown', {which: 1}) -// .trigger('mousemove', {clientX: 500, clientY: 0}) -// .trigger('mouseup', {force: true}) -// }) + cy.get('.kanban .bucket .tasks .task') + .contains(tasks[0].title) + .first() + .drag('.kanban .bucket:nth-child(2) .tasks .dropper div') + + cy.get('.kanban .bucket:nth-child(2) .tasks') + .should('contain', tasks[0].title) + cy.get('.kanban .bucket:nth-child(1) .tasks') + .should('not.contain', tasks[0].title) + }) it('Should navigate to the task when the task card is clicked', () => { const tasks = TaskFactory.create(5, { diff --git a/cypress/support/index.js b/cypress/support/index.js index 74c1400d..22ec961f 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -1,3 +1,4 @@ import './commands' import 'cypress-file-upload' +import '@4tw/cypress-drag-drop' diff --git a/package.json b/package.json index a1a7ba0a..25c6d6bf 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "date-fns": "2.23.0", "dompurify": "2.3.0", "highlight.js": "11.1.0", + "is-touch-device": "^1.0.1", "lodash": "4.17.21", "marked": "2.1.3", "register-service-worker": "1.7.2", @@ -32,11 +33,12 @@ "vue-easymde": "1.4.0", "vue-i18n": "8.25.0", "vue-shortkey": "3.1.7", - "vue-smooth-dnd": "0.8.1", + "vuedraggable": "^2.24.3", "vuex": "3.6.2", "workbox-precaching": "6.1.5" }, "devDependencies": { + "@4tw/cypress-drag-drop": "^1.8.0", "@fortawesome/fontawesome-svg-core": "1.2.35", "@fortawesome/free-regular-svg-icons": "5.15.3", "@fortawesome/free-solid-svg-icons": "5.15.3", diff --git a/src/App.vue b/src/App.vue index 9dae1e76..4525a079 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@