forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkbox.spec.ts
42 lines (37 loc) · 1.16 KB
/
checkbox.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
41
42
describe('Checkbox Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/');
cy.get('#checkbox-demo-nav-item-link').click();
cy.url().should('eq', 'http://localhost:3000/checkbox-demo-nav-link');
});
it('Verify first checkbox can be checked', () => {
cy.get('#check-1')
.check()
.should('be.checked');
cy.get('#check-1')
.uncheck()
.should('not.be.checked');
});
it('Verify second checkbox can be checked', () => {
cy.get('#check-2')
.check()
.should('be.checked');
cy.get('#check-2')
.uncheck()
.should('not.be.checked');
});
it('Verify default label', () => {
cy.get('label').contains('Controlled CheckBox');
});
it('Verify body content', () => {
cy.get('.pf-c-check__body').contains('This is the body of checkbox #1');
});
it('Verify standalone checkbox input', () => {
cy.get('#standalone-container').within(() => {
cy.get('div.pf-c-check.pf-m-standalone').should('exist');
});
cy.get('#not-standalone-container').within(() => {
cy.get('div.pf-c-check.pf-m-standalone').should('not.exist');
});
});
});