From 3b088a9d782bdac468c38e48952527cc5d5eb039 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Sat, 30 Mar 2019 18:09:17 +0530 Subject: [PATCH] test: Add resize column tests --- cypress/integration/column.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cypress/integration/column.js b/cypress/integration/column.js index ccf0d10..f8a3c76 100644 --- a/cypress/integration/column.js +++ b/cypress/integration/column.js @@ -43,4 +43,22 @@ describe('Column', function () { cy.get('.dt-cell--header').should('have.length', 7); }); + + it('resize column with mouse drag', function () { + cy.get('.dt-cell--header-3 .dt-cell__resize-handle').as('resize-handle'); + cy + .get('@resize-handle') + .trigger('mousedown') + .trigger('mousemove', { pageX: 510, pageY: 20, which: 1 }) + .trigger('mouseup'); + + cy.getColumnCell(3).should('have.css', 'width', '123px'); + cy.getCell(3, 1).should('have.css', 'width', '123px'); + }); + + it('resize column using double click', function () { + cy.get('.dt-cell--header-4 .dt-cell__resize-handle').trigger('dblclick'); + cy.getColumnCell(4).should('have.css', 'width', '94px'); + cy.getCell(4, 1).should('have.css', 'width', '94px'); + }); });