-
Notifications
You must be signed in to change notification settings - Fork 352
/
Copy pathradio.spec.ts
39 lines (34 loc) · 1.23 KB
/
radio.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
describe('Radio Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/radio-demo-nav-link');
});
it('Verify controlled radio', () => {
cy.get('#radio-2').should('be.checked');
cy.get('#radio-1').check();
cy.get('#radio-2').should('not.be.checked');
cy.get('#radio-1').should('be.checked');
});
it('Verify uncontrolled radio', () => {
cy.get('[for="radio-3"]').contains('Uncontrolled radio 1');
cy.get('[for="radio-4"]').contains('Uncontrolled radio 2');
});
it('Verify disabled radio', () => {
cy.get('#radio-5').should('be.checked');
cy.get('#radio-5').should('be.disabled');
cy.get('#radio-6').should('not.be.checked');
cy.get('#radio-6').should('be.disabled');
});
it('Verify body content', () => {
cy.get('#not-standalone-container').within(() => {
cy.get('.pf-c-radio__body').contains('this is the radio body');
});
});
it('Verify standalone radio input', () => {
cy.get('#standalone-container').within(() => {
cy.get('div.pf-c-radio.pf-m-standalone').should('exist');
});
cy.get('#not-standalone-container').within(() => {
cy.get('div.pf-c-radio.pf-m-standalone').should('not.exist');
});
});
});