Skip to content

Commit fba441e

Browse files
fixed broken test
1 parent 7bf5b9c commit fba441e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/cpt-ui/__tests__/EpsCard.test.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ jest.mock("@/constants/ui-strings/CardStrings", () => ({
5050
noODSCode: "No ODS code",
5151
noOrgName: "NO ORG NAME",
5252
noRoleName: "No role name",
53-
noAddress: "Address not found"
53+
noAddress: "Address not found",
54+
odsLabel: "ODS"
5455
}
5556
}))
5657

@@ -171,8 +172,8 @@ describe("EpsCard Component", () => {
171172
renderWithProviders({role: mockRole, link: mockLink})
172173

173174
act(() => {
174-
const cardLink = screen.getByRole("link", {name: /test organization/i})
175-
fireEvent.click(cardLink)
175+
const focusArea = screen.getByText("Test Organization (ODS: XYZ123)").closest(".eps-card__org-focus-area")
176+
fireEvent.click(focusArea!)
176177
})
177178

178179
await waitFor(() => {
@@ -204,8 +205,8 @@ describe("EpsCard Component", () => {
204205
renderWithProviders({role: mockRole, link: mockLink})
205206

206207
act(() => {
207-
const cardLink = screen.getByRole("link", {name: /test organization/i})
208-
fireEvent.click(cardLink)
208+
const focusArea = screen.getByText("Test Organization (ODS: XYZ123)").closest(".eps-card__org-focus-area")
209+
fireEvent.click(focusArea!)
209210
})
210211

211212
await waitFor(() => {

0 commit comments

Comments
 (0)