Skip to content

Commit

Permalink
fix: remove duplicate code from test file
Browse files Browse the repository at this point in the history
affects: @medly-components/core
  • Loading branch information
gmukul01 committed Oct 30, 2024
1 parent 7e8501d commit f95d892
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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);

Expand Down

0 comments on commit f95d892

Please sign in to comment.