Skip to content

Commit

Permalink
chore: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
amlannandy committed Dec 16, 2024
1 parent d09c4d9 commit 8a3319c
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,7 @@ describe('dashboard list page', () => {
});

it('ensure that the export JSON popover action works correctly', async () => {
const { getByText, getAllByTestId } = render(
<MemoryRouter initialEntries={['/dashbords']}>
<DashboardProvider>
<DashboardsList />
</DashboardProvider>
</MemoryRouter>,
);
const { getByText, getAllByTestId } = render(<DashboardsList />);

await waitFor(() => {
const popovers = getAllByTestId('dashboard-action-icon');
Expand All @@ -231,6 +225,13 @@ describe('dashboard list page', () => {
const exportJsonBtn = getByText('Export JSON');
expect(exportJsonBtn).toBeInTheDocument();
fireEvent.click(exportJsonBtn);
expect(dashboardUtils.sanitizeDashboardData).toHaveBeenCalled();
const firstDashboardData = dashboardSuccessResponse.data[0];
expect(dashboardUtils.sanitizeDashboardData).toHaveBeenCalledWith(
expect.objectContaining({
id: firstDashboardData.uuid,
title: firstDashboardData.data.title,
createdAt: firstDashboardData.created_at,
}),
);
});
});

0 comments on commit 8a3319c

Please sign in to comment.