-
Notifications
You must be signed in to change notification settings - Fork 356
/
Copy pathdatepicker.spec.ts
36 lines (33 loc) · 1.28 KB
/
datepicker.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
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/date-picker-demo-nav-link');
});
// TODO: Reenable with issue #8457
xit('Verify validation error can be cleared from outside', () => {
cy.get('#date-picker-validator > .pf-v6-c-date-picker')
.children()
.within(() => {
cy.get('input');
})
.children()
.click();
cy.focused().clear().type('2020-03-16');
cy.focused().blur();
cy.get('div.pf-m-error').should('exist');
cy.get('button').contains('Set date').click();
cy.get('div.pf-m-error').should('not.exist');
});
it('Verify error can be cleared when resetting the date from outside', () => {
cy.get('#date-picker-clear .pf-v6-c-form-control input').click();
cy.focused().clear().type('something invalid');
cy.focused().blur();
cy.get('div.pf-m-error').should('exist');
cy.get('button').contains('Clear date').click();
cy.get('div.pf-m-error').should('not.exist');
});
it('Verify calendar state can be controlled', () => {
cy.get('#date-picker-controlled .pf-v6-c-popover').should('not.exist');
cy.get('button').contains('Toggle').click();
cy.get('#date-picker-controlled .pf-v6-c-popover').should('exist');
cy.get('button').contains('Toggle').click();
cy.get('#date-picker-controlled .pf-v6-c-popover').should('not.exist');
});