diff --git a/packages/core/src/components/DateRangePicker/DateRangePicker.test.tsx b/packages/core/src/components/DateRangePicker/DateRangePicker.test.tsx index ee428986c..83f2ca1cf 100644 --- a/packages/core/src/components/DateRangePicker/DateRangePicker.test.tsx +++ b/packages/core/src/components/DateRangePicker/DateRangePicker.test.tsx @@ -70,6 +70,8 @@ describe('DateRangePicker', () => { fireEvent.click(screen.getByTitle('contract-calendar-icon')); expect(container.querySelector('#contract-calendar')).toBeVisible(); expect(container).toMatchSnapshot(); + fireEvent.click(screen.getByTitle('contract-calendar-close-icon')); + expect(container.querySelector('#contract-calendar')).toBeNull(); }); it('should render properly with single month for mobile screen', () => { @@ -82,17 +84,6 @@ describe('DateRangePicker', () => { expect(container).toMatchSnapshot(); }); - it('should close the popover on click on close icon', () => { - const { container } = renderComponent({ - withSingleMonth: true, - value: { startDate: new Date(2010, 0, 1), endDate: new Date(2010, 0, 2) } - }); - fireEvent.click(screen.getByTitle('contract-calendar-icon')); - expect(container.querySelector('#contract-calendar')).toBeVisible(); - fireEvent.click(screen.getByTitle('contract-calendar-close-icon')); - expect(container.querySelector('#contract-calendar')).toBeNull(); - }); - describe('popover placement', () => { afterEach(cleanup);