forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tablesortable.spec.ts
40 lines (36 loc) · 883 Bytes
/
tablesortable.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
describe('Table Sortable Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/table-sortable-demo-nav-link');
});
it('Verify table string', () => {
cy.get('caption').contains('Sortable Table');
});
it('Check number of rows', () => {
cy.get('.pf-c-table')
.find('tr')
.should('have.length', 4);
});
it('Check number of columns', () => {
cy.get('thead')
.find('th')
.should('have.length', 5);
});
it('Test sortable transformer', () => {
cy.get('.pf-c-table__sort').should('exist');
cy.get('.pf-c-table__sort')
.first()
.click();
cy.get('td')
.first()
.contains('a');
cy.get('.pf-c-table__sort')
.first()
.click();
cy.get('.pf-c-table__sort')
.last()
.click();
cy.get('td')
.eq(2)
.contains('a');
});
});