From 92b444f677047f4dd05cef490c8429256c93ae42 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 3 Sep 2021 13:58:56 -0400 Subject: [PATCH 1/2] chore(tests): add Cypress E2E tests to cover IN_CONTAINS filter --- test/cypress/integration/example27.spec.js | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/test/cypress/integration/example27.spec.js b/test/cypress/integration/example27.spec.js index 840cd95b6..6218ac68b 100644 --- a/test/cypress/integration/example27.spec.js +++ b/test/cypress/integration/example27.spec.js @@ -161,4 +161,49 @@ describe('Example 27 - GraphQL Basic API without Pagination', { retries: 1 }, () cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(9)`).should('contain', 'South America'); cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(10)`).should('contain', 'SA'); }); + + it('should Clear all Filters and expect all rows to be back', () => { + cy.get('#grid25') + .find('button.slick-gridmenu-button') + .trigger('click') + .click(); + + cy.get(`.slick-gridmenu:visible`) + .find('.slick-gridmenu-item') + .first() + .find('span') + .contains('Clear all Filters') + .click(); + + cy.get('.right-footer.metrics') + .contains('250 of 250 items'); + }); + + it('should filter Language Native with "French" language and expect only 40 rows in the grid', () => { + cy.get('div.ms-filter.filter-languageName') + .trigger('click'); + + cy.get('.ms-search:visible') + .type('French'); + + cy.get('.ms-drop:visible') + .contains('French') + .click(); + + cy.get('.ms-ok-button:visible') + .click(); + + cy.get('.right-footer.metrics') + .contains('44 of 250 items'); + + cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(1)`).should('contain', 'Belgium'); + cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(6)`).should('contain', 'Dutch, French, German'); + cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(8)`).should('contain', 'nl, fr, de'); + cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(9)`).should('contain', 'Europe'); + + cy.get(`[style="top:${GRID_ROW_HEIGHT * 3}px"] > .slick-cell:nth(1)`).should('contain', 'Benin'); + cy.get(`[style="top:${GRID_ROW_HEIGHT * 3}px"] > .slick-cell:nth(6)`).should('contain', 'French'); + cy.get(`[style="top:${GRID_ROW_HEIGHT * 3}px"] > .slick-cell:nth(8)`).should('contain', 'fr'); + cy.get(`[style="top:${GRID_ROW_HEIGHT * 3}px"] > .slick-cell:nth(9)`).should('contain', 'Africa'); + }); }); From 5ef0c86bbc457fe705ee9eb88ef97683ff2beac6 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Thu, 9 Sep 2021 16:34:58 -0400 Subject: [PATCH 2/2] tests: fix Cypress test --- test/cypress/integration/example27.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/integration/example27.spec.js b/test/cypress/integration/example27.spec.js index 6218ac68b..ca1a9a4af 100644 --- a/test/cypress/integration/example27.spec.js +++ b/test/cypress/integration/example27.spec.js @@ -163,7 +163,7 @@ describe('Example 27 - GraphQL Basic API without Pagination', { retries: 1 }, () }); it('should Clear all Filters and expect all rows to be back', () => { - cy.get('#grid25') + cy.get('#grid27') .find('button.slick-gridmenu-button') .trigger('click') .click();