From 7d61635182f397a157d4b52286341bd71b5c6a4c Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 21 Jul 2022 00:50:03 +0200 Subject: [PATCH] fix: make tests work again with new selectors --- cypress/e2e/list/list-view-gantt.spec.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/list/list-view-gantt.spec.ts b/cypress/e2e/list/list-view-gantt.spec.ts index 69805a30..c2a501c9 100644 --- a/cypress/e2e/list/list-view-gantt.spec.ts +++ b/cypress/e2e/list/list-view-gantt.spec.ts @@ -11,7 +11,7 @@ describe('List View Gantt', () => { const tasks = TaskFactory.create(1) cy.visit('/lists/1/gantt') - cy.get('.gantt-chart .tasks') + cy.get('#g-gantt-rows-container') .should('not.contain', tasks[0].title) }) @@ -23,7 +23,7 @@ describe('List View Gantt', () => { cy.visit('/lists/1/gantt') - cy.get('.gantt-chart .months') + cy.get('.g-timeunits-container') .should('contain', format(now, 'MMMM')) .should('contain', format(nextMonth, 'MMMM')) }) @@ -36,14 +36,13 @@ describe('List View Gantt', () => { }) cy.visit('/lists/1/gantt') - cy.get('.gantt-chart .tasks') + cy.get('#g-gantt-rows-container') .should('not.be.empty') - cy.get('.gantt-chart .tasks') .should('contain', tasks[0].title) }) it('Shows tasks with no dates after enabling them', () => { - TaskFactory.create(1, { + const tasks = TaskFactory.create(1, { start_date: null, end_date: null, }) @@ -53,13 +52,15 @@ describe('List View Gantt', () => { .contains('Show tasks which don\'t have dates set') .click() - cy.get('.gantt-chart .tasks') + cy.get('#g-gantt-rows-container') .should('not.be.empty') - cy.get('.gantt-chart .tasks .task.nodate') - .should('exist') + .should('contain', tasks[0].title) }) it('Drags a task around', () => { + cy.intercept('**/api/v1/tasks/*') + .as('taskUpdate') + const now = new Date() TaskFactory.create(1, { start_date: formatISO(now), @@ -67,10 +68,11 @@ describe('List View Gantt', () => { }) cy.visit('/lists/1/gantt') - cy.get('.gantt-chart .tasks .task') + cy.get('#g-gantt-rows-container .g-gantt-row .g-gantt-row-bars-container div .g-gantt-bar') .first() .trigger('mousedown', {which: 1}) .trigger('mousemove', {clientX: 500, clientY: 0}) .trigger('mouseup', {force: true}) + cy.wait('@taskUpdate') }) }) \ No newline at end of file