-
Notifications
You must be signed in to change notification settings - Fork 355
/
card.spec.ts
32 lines (29 loc) · 1.37 KB
/
card.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
describe('Card Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/card-demo-nav-link');
});
it('Verify that selectable card can be selected and unselected with keyboard input', () => {
cy.get('#selectableCard').focus();
cy.focused().should('have.class', 'pf-m-selectable');
cy.focused().should('not.have.class', 'pf-m-selected');
cy.focused().type('{enter}');
cy.focused().should('have.class', 'pf-m-selected');
cy.focused().type('{enter}');
cy.focused().should('not.have.class', 'pf-m-selected');
});
it('Verify that selectableRaised card can be selected and unselected with keyboard input', () => {
cy.get('#selectableCardRaised').focus();
cy.focused().should('have.class', 'pf-m-selectable-raised');
cy.focused().should('not.have.class', 'pf-m-selected-raised');
cy.focused().type('{enter}');
cy.focused().should('have.class', 'pf-m-selected-raised');
cy.focused().type('{enter}');
cy.focused().should('not.have.class', 'pf-m-selected-raised');
});
it('Verify card is expandable', () => {
cy.get('#expand-card').should('not.have.class', 'pf-m-expanded');
cy.get('#expand-card .pf-c-card__header').should('have.class', 'pf-m-toggle-right');
cy.get('.pf-c-card__header-toggle .pf-c-button').click();
cy.get('#expand-card').should('have.class', 'pf-m-expanded');
});
});