test: fix failing tests

This commit is contained in:
Ejaaz Khan 2025-02-19 17:40:17 +05:30
parent f1c2cd916c
commit 6d381d8f6b
2 changed files with 10 additions and 10 deletions

View File

@ -61,7 +61,7 @@ describe('Cell', function () {
cy.clickCell(2, 0) cy.clickCell(2, 0)
.type('{ctrl}{rightarrow}'); .type('{ctrl}{rightarrow}');
cy.get('.dt-cell--focus') cy.get('.dt-cell--focus')
.should('have.class', 'dt-cell--7-0'); .should('have.class', 'dt-cell--11-0');
}); });
it('cell selection using shift + arrow keys', function () { it('cell selection using shift + arrow keys', function () {

View File

@ -29,35 +29,35 @@ describe('Column', function () {
.its('currentSort.colIndex') .its('currentSort.colIndex')
.should('eq', 2); .should('eq', 2);
cy.get('.dt-scrollable .dt-row:first') cy.get('.dt-scrollable .dt-row:first div:nth-of-type(3)')
.contains('Airi Satou'); .contains('Airi Satou');
cy.clickDropdownItem(2, 'Reset sorting'); cy.clickDropdownItem(2, 'Reset sorting');
}); });
it('removes column using dropdown action', function () { it('removes column using dropdown action', function () {
cy.get('.dt-cell--header').should('have.length', 8); cy.get('.dt-cell--header').should('have.length', 12);
cy.clickDropdown(5); cy.clickDropdown(5);
cy.clickDropdownItem(5, 'Remove column'); cy.clickDropdownItem(5, 'Remove column');
cy.get('.dt-cell--header').should('have.length', 7); cy.get('.dt-cell--header').should('have.length', 11);
}); });
it('resize column with mouse drag', function () { it('resize column with mouse drag', function () {
cy.get('.dt-cell--header-3 .dt-cell__resize-handle').as('resize-handle'); cy.get('.dt-cell--header-4 .dt-cell__resize-handle').as('resize-handle');
cy cy
.get('@resize-handle') .get('@resize-handle')
.trigger('mousedown') .trigger('mousedown')
.trigger('mousemove', { pageX: 510, pageY: 20, which: 1 }) .trigger('mousemove', { pageX: 710, pageY: 20, which: 1 })
.trigger('mouseup'); .trigger('mouseup');
cy.getColumnCell(3) cy.getColumnCell(4)
.should('have.css', 'width') .should('have.css', 'width')
.and('match', /13\dpx/); .and('match', /^82\d*(\.\d+)?px$/);
cy.getCell(3, 1) cy.getCell(4, 1)
.should('have.css', 'width') .should('have.css', 'width')
.and('match', /13\dpx/); .and('match', /^82\d*(\.\d+)?px$/);
}); });
it('resize column using double click', function () { it('resize column using double click', function () {