Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 4b10d01

Browse files
authored
Merge pull request #827 from ghiscoding/bugfix/in-contains-filter-sanitize-html
chore(tests): add Cypress E2E tests to cover IN_CONTAINS filter
2 parents 87f301b + 5ef0c86 commit 4b10d01

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

test/cypress/integration/example27.spec.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,49 @@ describe('Example 27 - GraphQL Basic API without Pagination', { retries: 1 }, ()
161161
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(9)`).should('contain', 'South America');
162162
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(10)`).should('contain', 'SA');
163163
});
164+
165+
it('should Clear all Filters and expect all rows to be back', () => {
166+
cy.get('#grid27')
167+
.find('button.slick-gridmenu-button')
168+
.trigger('click')
169+
.click();
170+
171+
cy.get(`.slick-gridmenu:visible`)
172+
.find('.slick-gridmenu-item')
173+
.first()
174+
.find('span')
175+
.contains('Clear all Filters')
176+
.click();
177+
178+
cy.get('.right-footer.metrics')
179+
.contains('250 of 250 items');
180+
});
181+
182+
it('should filter Language Native with "French" language and expect only 40 rows in the grid', () => {
183+
cy.get('div.ms-filter.filter-languageName')
184+
.trigger('click');
185+
186+
cy.get('.ms-search:visible')
187+
.type('French');
188+
189+
cy.get('.ms-drop:visible')
190+
.contains('French')
191+
.click();
192+
193+
cy.get('.ms-ok-button:visible')
194+
.click();
195+
196+
cy.get('.right-footer.metrics')
197+
.contains('44 of 250 items');
198+
199+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(1)`).should('contain', 'Belgium');
200+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(6)`).should('contain', 'Dutch, French, German');
201+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(8)`).should('contain', 'nl, fr, de');
202+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 0}px"] > .slick-cell:nth(9)`).should('contain', 'Europe');
203+
204+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 3}px"] > .slick-cell:nth(1)`).should('contain', 'Benin');
205+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 3}px"] > .slick-cell:nth(6)`).should('contain', 'French');
206+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 3}px"] > .slick-cell:nth(8)`).should('contain', 'fr');
207+
cy.get(`[style="top:${GRID_ROW_HEIGHT * 3}px"] > .slick-cell:nth(9)`).should('contain', 'Africa');
208+
});
164209
});

0 commit comments

Comments
 (0)