From 4ff7b7abf21ed51094c2071aacbe1c4bd904cbff Mon Sep 17 00:00:00 2001 From: Pradithya Aria Pura Date: Sat, 1 Apr 2023 11:57:19 +0800 Subject: [PATCH] fix: fix unit test Signed-off-by: Pradithya Aria Pura --- .../src/components/Project/test/ProjectDashboard.test.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/console/src/components/Project/test/ProjectDashboard.test.tsx b/packages/console/src/components/Project/test/ProjectDashboard.test.tsx index 592b104e7..5f4b75589 100644 --- a/packages/console/src/components/Project/test/ProjectDashboard.test.tsx +++ b/packages/console/src/components/Project/test/ProjectDashboard.test.tsx @@ -215,7 +215,7 @@ describe('ProjectDashboard', () => { mockUseUserProfile.mockReturnValue( loadedFetchable(sampleUserProfile, jest.fn()), ); - const { getByText, queryByText, getAllByRole } = renderView(); + const { getAllByText, queryAllByText, getAllByRole } = renderView(); await waitFor(() => {}); expect(mockUseUserProfile).toHaveBeenCalled(); @@ -224,13 +224,15 @@ describe('ProjectDashboard', () => { expect(checkboxes[0]).toBeTruthy(); expect(checkboxes[0]?.checked).toEqual(false); await waitFor(() => - expect(getByText(executions1[0].closure.workflowId.name)), + expect(getAllByText(executions1[0].closure.workflowId.name)), ); await fireEvent.click(checkboxes[0]); // when user selects checkbox, table should have no executions to display await waitFor(() => - expect(queryByText(executions1[0].closure.workflowId.name)).toBeNull(), + expect( + queryAllByText(executions1[0].closure.workflowId.name), + ).toHaveLength(0), ); });