From 666e15be7477f85af61f109cce0d2b01e6353371 Mon Sep 17 00:00:00 2001 From: Kacper Roemer Date: Thu, 31 Aug 2023 09:42:18 +0100 Subject: [PATCH] fixed e2e test in search #1562 --- .../cypress/e2e/searchBoxContainer.cy.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/datagateway-search/cypress/e2e/searchBoxContainer.cy.ts b/packages/datagateway-search/cypress/e2e/searchBoxContainer.cy.ts index dc0d8e74b..955e3f4ad 100644 --- a/packages/datagateway-search/cypress/e2e/searchBoxContainer.cy.ts +++ b/packages/datagateway-search/cypress/e2e/searchBoxContainer.cy.ts @@ -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.'); });