fix: make tests work again with new selectors

This commit is contained in:
kolaente 2022-07-21 00:50:03 +02:00
parent 6cb331ee0f
commit 091beecc19
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -11,7 +11,7 @@ describe('List View Gantt', () => {
const tasks = TaskFactory.create(1) const tasks = TaskFactory.create(1)
cy.visit('/lists/1/gantt') cy.visit('/lists/1/gantt')
cy.get('.gantt-chart .tasks') cy.get('#g-gantt-rows-container')
.should('not.contain', tasks[0].title) .should('not.contain', tasks[0].title)
}) })
@ -25,7 +25,7 @@ describe('List View Gantt', () => {
cy.visit('/lists/1/gantt') cy.visit('/lists/1/gantt')
cy.get('.gantt-chart .months') cy.get('.g-timeunits-container')
.should('contain', format(now, 'MMMM')) .should('contain', format(now, 'MMMM'))
.should('contain', format(nextMonth, 'MMMM')) .should('contain', format(nextMonth, 'MMMM'))
}) })
@ -38,14 +38,13 @@ describe('List View Gantt', () => {
}) })
cy.visit('/lists/1/gantt') cy.visit('/lists/1/gantt')
cy.get('.gantt-chart .tasks') cy.get('#g-gantt-rows-container')
.should('not.be.empty') .should('not.be.empty')
cy.get('.gantt-chart .tasks')
.should('contain', tasks[0].title) .should('contain', tasks[0].title)
}) })
it('Shows tasks with no dates after enabling them', () => { it('Shows tasks with no dates after enabling them', () => {
TaskFactory.create(1, { const tasks = TaskFactory.create(1, {
start_date: null, start_date: null,
end_date: null, end_date: null,
}) })
@ -55,13 +54,15 @@ describe('List View Gantt', () => {
.contains('Show tasks which don\'t have dates set') .contains('Show tasks which don\'t have dates set')
.click() .click()
cy.get('.gantt-chart .tasks') cy.get('#g-gantt-rows-container')
.should('not.be.empty') .should('not.be.empty')
cy.get('.gantt-chart .tasks .task.nodate') .should('contain', tasks[0].title)
.should('exist')
}) })
it('Drags a task around', () => { it('Drags a task around', () => {
cy.intercept('**/api/v1/tasks/*')
.as('taskUpdate')
const now = new Date() const now = new Date()
TaskFactory.create(1, { TaskFactory.create(1, {
start_date: formatISO(now), start_date: formatISO(now),
@ -69,10 +70,11 @@ describe('List View Gantt', () => {
}) })
cy.visit('/lists/1/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() .first()
.trigger('mousedown', {which: 1}) .trigger('mousedown', {which: 1})
.trigger('mousemove', {clientX: 500, clientY: 0}) .trigger('mousemove', {clientX: 500, clientY: 0})
.trigger('mouseup', {force: true}) .trigger('mouseup', {force: true})
cy.wait('@taskUpdate')
}) })
}) })