mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 20:59:02 +08:00
feat: update unit test
This commit is contained in:
parent
2508e6f9f1
commit
d09c4d947e
@ -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(
|
const { getByText, getAllByTestId } = render(
|
||||||
<MemoryRouter initialEntries={['/dashbords']}>
|
<MemoryRouter initialEntries={['/dashbords']}>
|
||||||
<DashboardProvider>
|
<DashboardProvider>
|
||||||
@ -228,11 +228,9 @@ describe('dashboard list page', () => {
|
|||||||
fireEvent.click([...popovers[0].children][0]);
|
fireEvent.click([...popovers[0].children][0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(getByText('View')).toBeInTheDocument();
|
const exportJsonBtn = getByText('Export JSON');
|
||||||
expect(getByText('Copy Link')).toBeInTheDocument();
|
expect(exportJsonBtn).toBeInTheDocument();
|
||||||
expect(getByText('Export JSON')).toBeInTheDocument();
|
fireEvent.click(exportJsonBtn);
|
||||||
|
|
||||||
fireEvent.click(getByText('Export JSON'));
|
|
||||||
expect(dashboardUtils.sanitizeDashboardData).toHaveBeenCalled();
|
expect(dashboardUtils.sanitizeDashboardData).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user