diff --git a/cypress/e2e/list/list-view-gantt.spec.ts b/cypress/e2e/list/list-view-gantt.spec.ts index 4b5372c40..f5ce93fb1 100644 --- a/cypress/e2e/list/list-view-gantt.spec.ts +++ b/cypress/e2e/list/list-view-gantt.spec.ts @@ -62,7 +62,7 @@ describe('List View Gantt', () => { it('Drags a task around', () => { cy.intercept('**/api/v1/tasks/*') .as('taskUpdate') - + const now = new Date() TaskFactory.create(1, { start_date: formatISO(now), @@ -77,13 +77,13 @@ describe('List View Gantt', () => { .trigger('mouseup', {force: true}) cy.wait('@taskUpdate') }) - + it('Should change the query parameters when selecting a date range', () => { const now = Date.UTC(2022, 10, 9) cy.clock(now, ['Date']) - + cy.visit('/lists/1/gantt') - + cy.get('.list-gantt .gantt-options .field .control input.input.form-control') .click() cy.get('.flatpickr-calendar .flatpickr-innerContainer .dayContainer .flatpickr-day') @@ -92,14 +92,14 @@ describe('List View Gantt', () => { cy.get('.flatpickr-calendar .flatpickr-innerContainer .dayContainer .flatpickr-day') .last() .click() - + cy.url().should('contain', 'dateFrom=2022-09-25') cy.url().should('contain', 'dateTo=2022-11-05') }) - + it('Should change the date range based on date query parameters', () => { cy.visit('/lists/1/gantt?dateFrom=2022-09-25&dateTo=2022-11-05') - + cy.get('.g-timeunits-container') .should('contain', 'September 2022') .should('contain', 'October 2022') @@ -107,4 +107,19 @@ describe('List View Gantt', () => { cy.get('.list-gantt .gantt-options .field .control input.input.form-control') .should('have.value', '25 Sep 2022 to 5 Nov 2022') }) + + it('Should open a task when double clicked on it', () => { + const now = new Date() + const tasks = TaskFactory.create(1, { + start_date: formatISO(now), + end_date: formatISO(now.setDate(now.getDate() + 4)), + }) + cy.visit('/lists/1/gantt') + + cy.get('.gantt-container .g-gantt-chart .g-gantt-row-bars-container .g-gantt-bar') + .dblclick() + + cy.url() + .should('contain', `/tasks/${tasks[0].id}`) + }) }) \ No newline at end of file