Skip to content

Commit 1632b7d

Browse files
[PRME-139] Practice - Patient ODS mismatch error update (#764)
* update error code; fix unit and smoke tests * fix related missing return types
1 parent 62378df commit 1632b7d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

app/cypress/e2e/1-ndr-smoke-tests/gp_user_workflows/patient_search_and_verify_unhappy_workflow.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('GP Workflow: GP Role rejected from accessing a non mating ODS patient
2424
// Assert
2525
cy.get('#nhs-number-input--error-message', { timeout: 20000 }).should(
2626
'include.text',
27-
"You cannot access this patient's record",
27+
"You cannot access this patient's record because they are not registered at your practice. The patient's current practice can access this record if it's stored in this service.",
2828
);
2929
},
3030
);

app/src/helpers/utils/errorCodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const errorCodes: { [key: string]: string } = {
3939
LGL_423: 'Record is uploading. Wait a few minutes and try again',
4040
SP_4002: 'The NHS number entered could not be found in the Personal Demographics Service',
4141
SP_4003:
42-
"You cannot access this patient's record because they are not registered at your practice. The patient's current practice can access this record.",
42+
"You cannot access this patient's record because they are not registered at your practice. The patient's current practice can access this record if it's stored in this service.",
4343
UC_4002: 'There was an issue when attempting to virus scan your uploaded files',
4444
UC_4004: technicalIssueMsg,
4545
};

app/src/pages/patientSearchPage/PatientSearchPage.test.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ vi.mock('../../helpers/hooks/useBaseAPIHeaders');
1818
vi.mock('../../helpers/hooks/useRole');
1919
vi.mock('axios');
2020
vi.mock('react-router-dom', () => ({
21-
useNavigate: () => mockedUseNavigate,
22-
useLocation: () => vi.fn(),
21+
useNavigate: (): Mock => mockedUseNavigate,
22+
useLocation: (): Mock => vi.fn(),
2323
}));
2424
vi.mock('../../helpers/hooks/useConfig', () => ({
25-
default: () => ({
25+
default: (): { featureFlags: { uploadArfWorkflowEnabled: boolean } } => ({
2626
featureFlags: {
2727
uploadArfWorkflowEnabled: false,
2828
},
2929
}),
3030
}));
3131

32-
Date.now = () => new Date('2020-01-01T00:00:00.000Z').getTime();
32+
Date.now = (): number => new Date('2020-01-01T00:00:00.000Z').getTime();
3333
const mockedAxios = axios as Mocked<typeof axios>;
3434
const mockedUseRole = useRole as Mock;
3535

@@ -154,7 +154,7 @@ describe('PatientSearchPage', () => {
154154
await userEvent.click(screen.getByRole('button', { name: 'Search' }));
155155
expect(
156156
await screen.findAllByText(
157-
"You cannot access this patient's record because they are not registered at your practice. The patient's current practice can access this record.",
157+
"You cannot access this patient's record because they are not registered at your practice. The patient's current practice can access this record if it's stored in this service.",
158158
),
159159
).toHaveLength(2);
160160
});
@@ -198,7 +198,7 @@ describe('PatientSearchPage', () => {
198198

199199
expect(
200200
await screen.findAllByText(
201-
"You cannot access this patient's record because they are not registered at your practice. The patient's current practice can access this record.",
201+
"You cannot access this patient's record because they are not registered at your practice. The patient's current practice can access this record if it's stored in this service.",
202202
),
203203
).toHaveLength(2);
204204
});
@@ -357,7 +357,7 @@ describe('PatientSearchPage', () => {
357357
await userEvent.click(screen.getByRole('button', { name: 'Search' }));
358358
expect(
359359
await screen.findAllByText(
360-
"You cannot access this patient's record because they are not registered at your practice. The patient's current practice can access this record.",
360+
"You cannot access this patient's record because they are not registered at your practice. The patient's current practice can access this record if it's stored in this service.",
361361
),
362362
).toHaveLength(2);
363363
});
@@ -493,7 +493,7 @@ describe('PatientSearchPage', () => {
493493
});
494494
});
495495

496-
const renderPatientSearchPage = () => {
496+
const renderPatientSearchPage = (): void => {
497497
const patient: PatientDetails = buildPatientDetails();
498498
render(
499499
<ConfigProvider>

0 commit comments

Comments
 (0)