From d90ea52893dcdb1ffa31c0ec4f42943cce785472 Mon Sep 17 00:00:00 2001 From: Kacper Roemer Date: Thu, 31 Aug 2023 13:51:00 +0100 Subject: [PATCH] workaround for the '.clear' method in search e2e tests #1562 --- .../cypress/e2e/searchBoxContainer.cy.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/datagateway-search/cypress/e2e/searchBoxContainer.cy.ts b/packages/datagateway-search/cypress/e2e/searchBoxContainer.cy.ts index f981948f3..3f404aeb2 100644 --- a/packages/datagateway-search/cypress/e2e/searchBoxContainer.cy.ts +++ b/packages/datagateway-search/cypress/e2e/searchBoxContainer.cy.ts @@ -54,12 +54,13 @@ describe('SearchBoxContainer Component', () => { }); it('should display an error when an invalid end date is entered', () => { - cy.get('[aria-label="End date input"]').type('2009-13-01'); + cy.get('[aria-label="End date input"]').type('2009-12-00'); cy.get('.MuiFormHelperText-root').contains('Date format: yyyy-MM-dd.'); - cy.get('[aria-label="End date input"]').clear(); + // cy.get('[aria-label="End date input"]').clear(); + cy.get('[aria-label="End date input"]').type('{ctrl}a{backspace}'); cy.get('.MuiFormHelperText-root').should('not.exist'); - cy.get('[aria-label="End date input"]').type('2009-02-30'); + cy.get('[aria-label="End date input"]').type('0000-02-28'); cy.get('.MuiFormHelperText-root').contains('Date format: yyyy-MM-dd.'); });