diff --git a/src/features/CATI_Dashboard_Link.feature b/src/features/CATI_Dashboard_Link.feature index 414f5d2..8971737 100644 --- a/src/features/CATI_Dashboard_Link.feature +++ b/src/features/CATI_Dashboard_Link.feature @@ -2,5 +2,5 @@ Feature: Cati dashboard link Scenario: Following the Cati dashboard link takes a user to the case info page Given I access the Telephone Operations Blaise Interface URL - When I click the link to the CATI dashboard - Then I arrive at the Case Info tab URL + When the link to the CATI dashboard is present + Then it will take me to the CATI dashboard diff --git a/src/features/step_definitions/CATI_Dashboard_Link.test.tsx b/src/features/step_definitions/CATI_Dashboard_Link.test.tsx index 67f82b6..e936b35 100644 --- a/src/features/step_definitions/CATI_Dashboard_Link.test.tsx +++ b/src/features/step_definitions/CATI_Dashboard_Link.test.tsx @@ -56,14 +56,13 @@ defineFeature(feature, test => { }); }); - when("I click the link to the CATI dashboard", async () => { - fireEvent.click(screen.getByText(/Link to CATI dashboard/i)); - await act(async () => { - await flushPromises(); + when("the link to the CATI dashboard is present", async () => { + await waitFor(() => { + expect(screen.getByText(/Link to CATI dashboard/i)) }); }); - then("I arrive at the Case Info tab URL", async () => { + then("it will take me to the CATI dashboard", async () => { await waitFor(() => { expect(screen.getByText(/Link to CATI dashboard/i).getAttribute("href")).toContain("/Blaise/CaseInfo"); });