Skip to content

Commit

Permalink
test: 💍 Add test for multiple filters
Browse files Browse the repository at this point in the history
  • Loading branch information
netchampfaris committed Oct 16, 2018
1 parent 932afb6 commit 7f779a3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cypress/integration/datatable_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,26 @@ describe('DataTable', function () {
});

beforeEach(function () {
cy.get('.dt-filter[data-col-index=4]').as('filterInput4');
cy.get('.dt-filter[data-col-index=5]').as('filterInput5');
});

afterEach(function () {
cy.get('@filterInput4').clear();
cy.get('@filterInput5').clear();
cy.get('.dt-row[data-row-index=0]').should('be.visible');
});

it('simple text filter', function () {
cy.getCell(4, 0).click().type('{ctrl}f');

cy.get('.dt-filter[data-col-index=4]').as('filterInput4').type('edin');
cy.get('@filterInput4').type('edin');
cy.get('.dt-row[data-row-index=0]').should('be.visible');
cy.get('.dt-row[data-row-index=1]').should('not.be.visible');
cy.get('@filterInput4').clear();

cy.wait(500);

cy.get('@filterInput5').type('15');
cy.get('.dt-row[data-row-index=2]').should('be.visible');
cy.get('.dt-row[data-row-index=15]').should('be.visible');
Expand All @@ -208,5 +212,14 @@ describe('DataTable', function () {
cy.get('.dt-row[data-row-index=4]').should('not.be.visible');
cy.get('.dt-row[data-row-index=5]').should('be.visible');
});

it('multiple filters', function () {
cy.get('@filterInput4').type('to');
cy.get('@filterInput5').type('54');

cy.get('.dt-row[data-row-index=0]').should('be.visible');
cy.get('.dt-row[data-row-index=4]').should('be.visible');
cy.get('.dt-row[data-row-index=1]').should('not.be.visible');
});
});
});

0 comments on commit 7f779a3

Please sign in to comment.