Skip to content

Commit

Permalink
fixed e2e test in search #1562
Browse files Browse the repository at this point in the history
  • Loading branch information
kaperoo committed Aug 31, 2023
1 parent 1393cf2 commit 666e15b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/datagateway-search/cypress/e2e/searchBoxContainer.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ describe('SearchBoxContainer Component', () => {
cy.get('.MuiFormHelperText-root').contains('At least one required');
});

it('should display an error when an invalid start date is entered', () => {
cy.get('[aria-label="Start date input"]').type('2009-13-01');
// MUI v6 date pickers don't allow for invalid dates to be entered
it.only('should display an error when an invalid start date is entered', () => {
cy.get('[aria-label="Start date input"]').type('2009-12-00');
cy.get('.MuiFormHelperText-root').contains('Date format: yyyy-MM-dd.');

cy.get('[aria-label="Start date input"]').clear();
// cy.get('[aria-label="Start date input"]').clear();
cy.get('[aria-label="Start date input"]').type('{ctrl}a{backspace}');
cy.get('.MuiFormHelperText-root').should('not.exist');
cy.get('[aria-label="Start date input"]').type('2009-02-30');
cy.get('[aria-label="Start date input"]').type('0000-02-28');
cy.get('.MuiFormHelperText-root').contains('Date format: yyyy-MM-dd.');
});

Expand Down

0 comments on commit 666e15b

Please sign in to comment.