Skip to content

Commit

Permalink
feat: update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
amlannandy committed Dec 7, 2024
1 parent 20a0680 commit 1bda7b8
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ describe('dashboard list page', () => {
);
});

it('ensure that the popover action renders list of options and export JSON works correctly', async () => {
it('ensure that the export JSON popover action works correctly', async () => {
const { getByText, getAllByTestId } = render(
<MemoryRouter initialEntries={['/dashbords']}>
<DashboardProvider>
Expand All @@ -228,11 +228,9 @@ describe('dashboard list page', () => {
fireEvent.click([...popovers[0].children][0]);
});

expect(getByText('View')).toBeInTheDocument();
expect(getByText('Copy Link')).toBeInTheDocument();
expect(getByText('Export JSON')).toBeInTheDocument();

fireEvent.click(getByText('Export JSON'));
const exportJsonBtn = getByText('Export JSON');
expect(exportJsonBtn).toBeInTheDocument();
fireEvent.click(exportJsonBtn);
expect(dashboardUtils.sanitizeDashboardData).toHaveBeenCalled();
});
});

0 comments on commit 1bda7b8

Please sign in to comment.