diff --git a/cypress/integration/table/search.spec.ts b/cypress/integration/table/search.spec.ts index f882ddf4a..ae5836b32 100644 --- a/cypress/integration/table/search.spec.ts +++ b/cypress/integration/table/search.spec.ts @@ -40,6 +40,8 @@ describe('Search', () => { }).as('getSettings'); cy.visit('/', { + // For some reason this doesn't work with date pickers v6 + // Commenting out for now // need these to ensure Date picker media queries pass // ref: https://mui.com/x/react-date-pickers/getting-started/#testing-caveats // onBeforeLoad: (win) => { @@ -1199,7 +1201,7 @@ describe('Search', () => { ); }); - // .clear doesn't work for some reason with datepickers in v6 + // .clear doesn't work with datepickers in v6 // cy.findByLabelText('from, date-time input').clear(); cy.findByLabelText('from, date-time input').type('{ctrl+a}{backspace}'); cy.findByLabelText('from, date-time input').type('2022-01-11_00:00'); @@ -1213,7 +1215,7 @@ describe('Search', () => { cy.clearMocks(); - // .clear doesn't work for some reason with datepickers in v6 + // .clear doesn't work with datepickers in v6 // cy.findByLabelText('from, date-time input').clear(); cy.findByLabelText('from, date-time input').type('{ctrl+a}{backspace}'); cy.findByLabelText('from, date-time input').type('2022-01-02_00:00'); @@ -1269,7 +1271,7 @@ describe('Search', () => { expect(gte).equal('2022-01-02T00:00:00'); }); - // .clear doesn't work for some reason with datepickers in v6 + // .clear doesn't work with datepickers in v6 // cy.findByLabelText('from, date-time input').clear(); cy.findByLabelText('from, date-time input').type('{ctrl+a}{backspace}'); cy.findByLabelText('from, date-time input').type('2022-01-01_00:00'); diff --git a/e2e/plotting.spec.ts b/e2e/plotting.spec.ts index 12d720b7f..5c8120a70 100644 --- a/e2e/plotting.spec.ts +++ b/e2e/plotting.spec.ts @@ -279,12 +279,19 @@ test('user can add from and to dates to timestamp on x-axis', async ({ await popup.locator('[aria-label="line chart"]').click(); - await popup - .locator('[aria-label="from, date-time input"]') - .fill('2022-01-03 00:00:00'); - await popup - .locator('[aria-label="to, date-time input"]') - .fill('2022-01-10 00:00:00'); + // .fill doesn't work with date-pickers v6 + // await popup + // .locator('[aria-label="from, date-time input"]') + // .fill('2022-01-03 00:00'); + await popup.locator('[aria-label="to, date-time input"]').click(); + await popup.keyboard.type('202201100000'); + + // .fill doesn't work with date-pickers v6 + // await popup + // .locator('[aria-label="to, date-time input"]') + // .fill('2022-01-10 00:00'); + await popup.locator('[aria-label="from, date-time input"]').click(); + await popup.keyboard.type('202201030000'); await popup.locator('label:has-text("Search all channels")').fill('Shot Num'); diff --git a/src/search/components/dateTime.component.tsx b/src/search/components/dateTime.component.tsx index b950c0383..5f02459f2 100644 --- a/src/search/components/dateTime.component.tsx +++ b/src/search/components/dateTime.component.tsx @@ -274,7 +274,7 @@ const DateTimeSearch = (props: DateTimeSearchProps): React.ReactElement => { format="yyyy-MM-dd HH:mm" value={datePickerFromDate} maxDateTime={datePickerToDate || new Date('2100-01-01 00:00:00')} - onChange={(date: Date | null) => { + onChange={(date) => { setDatePickerFromDate(date); resetTimeframe(); searchParamsUpdated(); @@ -299,7 +299,7 @@ const DateTimeSearch = (props: DateTimeSearchProps): React.ReactElement => { }); } }} - onAccept={(date: Date | null) => { + onAccept={(date) => { setDatePickerFromDate(date); resetTimeframe(); searchParamsUpdated(); diff --git a/src/search/searchBar.component.test.tsx b/src/search/searchBar.component.test.tsx index 308f12899..84aec9c9a 100644 --- a/src/search/searchBar.component.test.tsx +++ b/src/search/searchBar.component.test.tsx @@ -62,7 +62,7 @@ describe('searchBar component', () => { const dateFilterFromDate = screen.getByLabelText('from, date-time input'); const dateFilterToDate = screen.getByLabelText('to, date-time input'); - // .clear doesn't work for some reason with datepickers in v6 + // .clear doesn't work with datepickers in v6 await user.click(dateFilterFromDate); await user.keyboard('{Control>}a{/Control}'); await user.keyboard('{Delete}'); @@ -358,7 +358,7 @@ describe('searchBar component', () => { // only the From date is defined - // .clear doesn't work for some reason with datepickers in v6 + // .clear doesn't work with datepickers in v6 await user.click(dateFilterFromDate); await user.keyboard('{Control>}a{/Control}'); await user.keyboard('{Delete}'); @@ -569,7 +569,7 @@ describe('searchBar component', () => { }) ); - // .clear doesn't work for some reason with datepickers in v6 + // .clear doesn't work with datepickers in v6 await user.click(dateFilterFromDate); await user.keyboard('{Control>}a{/Control}'); await user.keyboard('{Delete}');