From 8a3319cdf585a0446bf3ea5d1bdde86208e4f8d1 Mon Sep 17 00:00:00 2001 From: amlannandy Date: Tue, 10 Dec 2024 18:17:16 +0530 Subject: [PATCH] chore: address comments --- .../__tests__/DashboardListPage.test.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/pages/DashboardsListPage/__tests__/DashboardListPage.test.tsx b/frontend/src/pages/DashboardsListPage/__tests__/DashboardListPage.test.tsx index 21cfd2ae65..d075316422 100644 --- a/frontend/src/pages/DashboardsListPage/__tests__/DashboardListPage.test.tsx +++ b/frontend/src/pages/DashboardsListPage/__tests__/DashboardListPage.test.tsx @@ -214,13 +214,7 @@ describe('dashboard list page', () => { }); it('ensure that the export JSON popover action works correctly', async () => { - const { getByText, getAllByTestId } = render( - - - - - , - ); + const { getByText, getAllByTestId } = render(); await waitFor(() => { const popovers = getAllByTestId('dashboard-action-icon'); @@ -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, + }), + ); }); });