test: 💍 Fix test for header dropdown

This commit is contained in:
Faris Ansari 2019-01-14 14:02:05 +05:30
parent 3e044a5ffa
commit 836b13bd88
2 changed files with 7 additions and 5 deletions

View File

@ -113,12 +113,11 @@ describe('DataTable', function () {
.find('.dt-dropdown__toggle')
.as('toggle')
.click();
cy.getColumnCell(2)
.find('.dt-dropdown__list')
cy.get('.dt-dropdown__list')
.as('dropdown-list')
.should('be.visible');
cy.get('@toggle').click();
cy.getColumnCell(2).click();
cy.get('@dropdown-list').should('not.be.visible');
});
@ -152,6 +151,10 @@ describe('DataTable', function () {
});
describe('Row', function () {
before(function () {
cy.visit('/');
});
it('check / uncheck row', function () {
cy.get('.dt-scrollable .dt-row:first')
.find('input[type="checkbox"]')

View File

@ -43,8 +43,7 @@ Cypress.Commands.add('clickDropdown', (col) => {
});
Cypress.Commands.add('clickDropdownItem', (col, item) => {
return cy.getColumnCell(col)
.find(`.dt-dropdown__list-item:contains("${item}")`)
return cy.get(`.dt-dropdown__list-item:contains("${item}")`)
.click({ force: true });
});