From 0c631f7e0228ac15f9643e19924eed67bc1447e5 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Sat, 18 Jan 2025 01:03:08 -0500 Subject: [PATCH] chore: fix a small regression with navigateTop/Bottom --- cypress/e2e/example4-model-esm.cy.ts | 8 +++++++ cypress/e2e/example4-model.cy.ts | 8 +++++++ examples/example-0031-row-span-employees.html | 22 ----------------- examples/example4-model-esm.html | 17 ++++++++++++- examples/example4-model.html | 10 +++++++- src/slick.grid.ts | 12 ++++++---- src/styles/example-demo.scss | 24 +++++++++++++++++++ 7 files changed, 73 insertions(+), 28 deletions(-) diff --git a/cypress/e2e/example4-model-esm.cy.ts b/cypress/e2e/example4-model-esm.cy.ts index 199e86a2..a958a5fd 100644 --- a/cypress/e2e/example4-model-esm.cy.ts +++ b/cypress/e2e/example4-model-esm.cy.ts @@ -162,4 +162,12 @@ describe('Example 4 - Model (ESM)', () => { cy.get(`[style*="top: ${GRID_ROW_HEIGHT * 18}px;"] > .slick-cell:nth(2)`).should('contain', '5 days').click(); cy.get('.editor-text').should('not.exist'); }); + + it('should navigate to bottom/top of the grid with command execution', () => { + cy.get('[data-test="navigate-bottom"]').click(); + cy.get('[data-row=49999]').should('contain', 'Task 49999'); + + cy.get('[data-test="navigate-top"]').click(); + cy.get('[data-row=1]').should('contain', 'Task 1'); + }); }); diff --git a/cypress/e2e/example4-model.cy.ts b/cypress/e2e/example4-model.cy.ts index e7f0755c..64c92d92 100644 --- a/cypress/e2e/example4-model.cy.ts +++ b/cypress/e2e/example4-model.cy.ts @@ -49,6 +49,14 @@ describe('Example 4 - Model', () => { }); }); + it('should navigate to bottom/top of the grid with command execution', () => { + cy.get('[data-test="navigate-bottom"]').click(); + cy.get('[data-row=49999]').should('contain', 'Task 49999'); + + cy.get('[data-test="navigate-top"]').click(); + cy.get('[data-row=1]').should('contain', 'Task 1'); + }); + it('Should display "Showing page 1 of 1000" text after changing Pagination to 50 items per page', () => { cy.get('.sgi-lightbulb') .click(); diff --git a/examples/example-0031-row-span-employees.html b/examples/example-0031-row-span-employees.html index 27cf3746..45f1ba2b 100644 --- a/examples/example-0031-row-span-employees.html +++ b/examples/example-0031-row-span-employees.html @@ -9,28 +9,6 @@