From 2c5297da6ec1202f20d7ddf4ebc29146788c83a7 Mon Sep 17 00:00:00 2001 From: Peter Muriuki Date: Thu, 25 Jan 2024 12:20:47 +0300 Subject: [PATCH] Fix test regression in fhir user management --- .../src/components/UserList/ListView/tests/index.test.tsx | 4 ++-- packages/fhir-keycloak-user-management/src/constants.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/fhir-keycloak-user-management/src/components/UserList/ListView/tests/index.test.tsx b/packages/fhir-keycloak-user-management/src/components/UserList/ListView/tests/index.test.tsx index 5bab7149b..6c8ca5af8 100644 --- a/packages/fhir-keycloak-user-management/src/components/UserList/ListView/tests/index.test.tsx +++ b/packages/fhir-keycloak-user-management/src/components/UserList/ListView/tests/index.test.tsx @@ -13,7 +13,7 @@ import userEvents from '@testing-library/user-event'; import { URL_USER, URL_USER_CREDENTIALS, UserCredentials } from '@opensrp/user-management'; import { practitioner, userFixtures, group } from './fixtures'; import fetch from 'jest-fetch-mock'; -import { practitionerResourceType, practitionerRoleResourceType } from '../../../../constants'; +import { practitionerResourceType, practitionerRoleResourceType, USER_DETAILS_URL } from '../../../../constants'; import flushPromises from 'flush-promises'; import { practitionerRoleBundle } from '../../../CreateEditUser/tests/fixtures'; import { RoleContext } from '@opensrp/rbac'; @@ -332,5 +332,5 @@ test('View details navigates correctly', async () => { `); fireEvent.click(viewDetailsLink); - expect(history.location.pathname).toEqual(`${URL_USER}/081724e8-5fc1-47dd-8d0c-fa0c6ae6ddf0`); + expect(history.location.pathname).toEqual(`${USER_DETAILS_URL}/081724e8-5fc1-47dd-8d0c-fa0c6ae6ddf0`); }); diff --git a/packages/fhir-keycloak-user-management/src/constants.ts b/packages/fhir-keycloak-user-management/src/constants.ts index 8c7e68a51..f9c1abfc0 100644 --- a/packages/fhir-keycloak-user-management/src/constants.ts +++ b/packages/fhir-keycloak-user-management/src/constants.ts @@ -14,4 +14,4 @@ export const keycloakGroupEndpoint = 'groups'; export const keycloakMembersEndpoint = 'members'; // router urls -export const USER_DETAILS_URL = `${URL_USER}/details/:id`; +export const USER_DETAILS_URL = `${URL_USER}/details`;