Skip to content

Commit 4fcc50b

Browse files
abid-nhsabid-madetechbethany-kish-nhs
authored
Prmp 920 - Disable the BSOL Journey check to allow all users to access the NDR (#431)
* [PRMP-920] return true for isbsol logic * [PRMP-920] - remove failing test as the logic has been removed * [PRMP-920] - fix broken test * [PRMP-920] - fix/skip broken cypress tests * [PRMP-920] - skip failing smoketest as result of this change * update smoke tests to pass with non-BSOL flow --------- Co-authored-by: Abid <abdur.abid@madetech.com> Co-authored-by: bethany-kish-nhs <beth.kish1@nhs.net>
1 parent 09f8582 commit 4fcc50b

File tree

11 files changed

+101
-110
lines changed

11 files changed

+101
-110
lines changed

app/cypress/e2e/0-ndr-core-tests/auth_routes/auth_gp_admin_path_access.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const arfDownloadUrl = '/patient/arf';
2020

2121
const forbiddenRoutes = [arfDownloadUrl];
2222

23-
const bsolOptions = [true, false];
23+
const bsolOptions = [true];
2424

2525
describe('GP Admin user role has access to the expected GP_ADMIN workflow paths', () => {
2626
bsolOptions.forEach((isBSOL) => {

app/cypress/e2e/0-ndr-core-tests/auth_routes/auth_gp_clinical_path_access.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const lloydGeorgeViewUrl = '/patient/lloyd-george-record';
1919
const arfDownloadUrl = '/patient/arf';
2020
const forbiddenRoutes = [arfDownloadUrl];
2121

22-
const bsolOptions = [true, false];
22+
const bsolOptions = [true];
2323

2424
describe('GP Clinical user role has access to the expected GP_CLINICAL workflow paths', () => {
2525
bsolOptions.forEach((isBSOL) => {

app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/view_lloyd_george_not_bsol_workflow.cy.js

Lines changed: 88 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('GP Workflow: View Lloyd George record', () => {
6464
context(
6565
`View Lloyd George document for ${roleName(role)} role and download warning is present`,
6666
() => {
67-
it(
67+
it.skip(
6868
roleName(role) + ' can view a Lloyd George document of an active patient',
6969
{ tags: 'regression' },
7070
() => {
@@ -108,7 +108,7 @@ describe('GP Workflow: View Lloyd George record', () => {
108108
},
109109
);
110110

111-
it(
111+
it.skip(
112112
`It displays an empty Lloyd George card when no Lloyd George record exists for the patient for a ${roleName(
113113
role,
114114
)}`,
@@ -124,7 +124,7 @@ describe('GP Workflow: View Lloyd George record', () => {
124124
assertEmptyLloydGeorgeCard();
125125
},
126126
);
127-
it(
127+
it.skip(
128128
`It displays an waiting message when uploading Lloyd George record is in progress for the patient for a ${roleName(
129129
role,
130130
)}`,
@@ -144,7 +144,7 @@ describe('GP Workflow: View Lloyd George record', () => {
144144
);
145145
},
146146
);
147-
it(
147+
it.skip(
148148
`It displays an error when the Lloyd George Stitch API call fails for a ${roleName(
149149
role,
150150
)}`,
@@ -162,7 +162,7 @@ describe('GP Workflow: View Lloyd George record', () => {
162162
},
163163
);
164164

165-
it(
165+
it.skip(
166166
'Routes to download page when safety checkbox is checked',
167167
{ tags: 'regression' },
168168
() => {
@@ -182,7 +182,7 @@ describe('GP Workflow: View Lloyd George record', () => {
182182
},
183183
);
184184

185-
it(
185+
it.skip(
186186
'It displays warning when safety checkbox is not checked',
187187
{ tags: 'regression' },
188188
() => {
@@ -201,7 +201,7 @@ describe('GP Workflow: View Lloyd George record', () => {
201201
},
202202
);
203203

204-
it(
204+
it.skip(
205205
'No download option or menu exists when no Lloyd George record exists for the patient',
206206
{ tags: 'regression' },
207207
() => {
@@ -218,84 +218,92 @@ describe('GP Workflow: View Lloyd George record', () => {
218218
},
219219
);
220220

221-
it('Confirm download and delete of Lloyd George', { tags: 'regression' }, () => {
222-
const isBSOL = false;
223-
cy.login(role, isBSOL);
224-
cy.getByTestId('search-patient-btn').click();
225-
226-
// search patient
227-
cy.intercept('GET', '/SearchPatient*', {
228-
statusCode: 200,
229-
body: searchPatientPayload,
230-
}).as('search');
221+
it.skip(
222+
'Confirm download and delete of Lloyd George',
223+
{ tags: 'regression' },
224+
() => {
225+
const isBSOL = false;
226+
cy.login(role, isBSOL);
227+
cy.getByTestId('search-patient-btn').click();
231228

232-
cy.intercept('GET', '/LloydGeorgeStitch*', {
233-
statusCode: 200,
234-
body: viewLloydGeorgePayload,
235-
}).as('lloydGeorgeStitch');
229+
// search patient
230+
cy.intercept('GET', '/SearchPatient*', {
231+
statusCode: 200,
232+
body: searchPatientPayload,
233+
}).as('search');
236234

237-
cy.intercept('POST', '/DocumentManifest*', (req) => {
238-
req.reply({
235+
cy.intercept('GET', '/LloydGeorgeStitch*', {
239236
statusCode: 200,
240-
body: { jobId: 'test-jobId' },
241-
delay: 500,
242-
});
243-
}).as('documentManifestPost');
237+
body: viewLloydGeorgePayload,
238+
}).as('lloydGeorgeStitch');
244239

245-
cy.intercept('GET', '/DocumentManifest*', (req) => {
246-
req.reply({
240+
cy.intercept('POST', '/DocumentManifest*', (req) => {
241+
req.reply({
242+
statusCode: 200,
243+
body: { jobId: 'test-jobId' },
244+
delay: 500,
245+
});
246+
}).as('documentManifestPost');
247+
248+
cy.intercept('GET', '/DocumentManifest*', (req) => {
249+
req.reply({
250+
statusCode: 200,
251+
body: {
252+
jobStatus: 'Completed',
253+
url: baseUrl + '/browserconfig.xml',
254+
}, // uses public served file in place of a ZIP file
255+
delay: 500,
256+
});
257+
}).as('documentManifest');
258+
259+
cy.intercept('DELETE', '/DocumentDelete*', {
247260
statusCode: 200,
248-
body: { jobStatus: 'Completed', url: baseUrl + '/browserconfig.xml' }, // uses public served file in place of a ZIP file
249-
delay: 500,
250-
});
251-
}).as('documentManifest');
252-
253-
cy.intercept('DELETE', '/DocumentDelete*', {
254-
statusCode: 200,
255-
}).as('documentDelete');
256-
257-
cy.getByTestId('nhs-number-input').type(searchPatientPayload.nhsNumber);
258-
cy.getByTestId('search-submit-btn').click();
259-
cy.wait('@search');
260-
261-
cy.get('#verify-submit').click();
262-
cy.wait('@lloydGeorgeStitch', { timeout: 20000 });
263-
264-
cy.getByTestId('download-and-remove-record-btn').click();
265-
cy.getByTestId('confirm-download-and-remove-checkbox').should('exist');
266-
cy.getByTestId('confirm-download-and-remove-checkbox').click();
267-
cy.getByTestId('confirm-download-and-remove-btn').click();
268-
cy.getByTestId('lloydgeorge_downloadall-stage').should('exist');
269-
270-
// Assert contents of page when downloading
271-
cy.contains('Downloading documents').should('be.visible');
272-
cy.getByTestId(
273-
'download-file-header-' + viewLloydGeorgePayload.number_of_files + '-files',
274-
).should('be.visible');
275-
cy.contains('Compressing record into a zip file').should('be.visible');
276-
cy.contains('Cancel').should('be.visible');
277-
278-
cy.wait('@documentManifest');
279-
// Assert contents of page after download
280-
cy.getByTestId('downloaded-record-card-header').should('be.visible');
281-
cy.contains(
282-
`${searchPatientPayload.givenName} ${searchPatientPayload.familyName}`,
283-
).should('be.visible');
284-
cy.contains(
285-
`NHS number: ${formatNhsNumber(searchPatientPayload.nhsNumber)}`,
286-
).should('be.visible');
287-
288-
// Assert file has been downloaded
289-
cy.readFile(`${Cypress.config('downloadsFolder')}/browserconfig.xml`);
290-
cy.wait('@documentDelete');
291-
cy.getByTestId('return-btn').should('exist');
292-
cy.contains('This record has been removed from our storage.').should(
293-
'be.visible',
294-
);
295-
cy.contains('Follow the Record Management Code of Practice').should(
296-
'be.visible',
297-
);
298-
});
261+
}).as('documentDelete');
262+
263+
cy.getByTestId('nhs-number-input').type(searchPatientPayload.nhsNumber);
264+
cy.getByTestId('search-submit-btn').click();
265+
cy.wait('@search');
266+
cy.get('#verify-submit').click();
267+
cy.wait('@lloydGeorgeStitch', { timeout: 20000 });
268+
269+
cy.getByTestId('download-and-remove-record-btn').click();
270+
cy.getByTestId('confirm-download-and-remove-checkbox').should('exist');
271+
cy.getByTestId('confirm-download-and-remove-checkbox').click();
272+
cy.getByTestId('confirm-download-and-remove-btn').click();
273+
cy.getByTestId('lloydgeorge_downloadall-stage').should('exist');
274+
275+
// Assert contents of page when downloading
276+
cy.contains('Downloading documents').should('be.visible');
277+
cy.getByTestId(
278+
'download-file-header-' +
279+
viewLloydGeorgePayload.number_of_files +
280+
'-files',
281+
).should('be.visible');
282+
cy.contains('Compressing record into a zip file').should('be.visible');
283+
cy.contains('Cancel').should('be.visible');
284+
285+
cy.wait('@documentManifest');
286+
// Assert contents of page after download
287+
cy.getByTestId('downloaded-record-card-header').should('be.visible');
288+
cy.contains(
289+
`${searchPatientPayload.givenName} ${searchPatientPayload.familyName}`,
290+
).should('be.visible');
291+
cy.contains(
292+
`NHS number: ${formatNhsNumber(searchPatientPayload.nhsNumber)}`,
293+
).should('be.visible');
294+
295+
// Assert file has been downloaded
296+
cy.readFile(`${Cypress.config('downloadsFolder')}/browserconfig.xml`);
297+
cy.wait('@documentDelete');
298+
cy.getByTestId('return-btn').should('exist');
299+
cy.contains('This record has been removed from our storage.').should(
300+
'be.visible',
301+
);
302+
cy.contains('Follow the Record Management Code of Practice').should(
303+
'be.visible',
304+
);
305+
},
306+
);
299307
},
300308
);
301309
});

app/cypress/e2e/0-ndr-core-tests/homepage.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('Home Page', () => {
7171

7272
const gpRoles = [Roles.GP_ADMIN, Roles.GP_CLINICAL];
7373
gpRoles.forEach((role) => {
74-
it(
74+
it.skip(
7575
`should display non-BSOL landing page when user is ${Roles[role]} role in non-BSOL area`,
7676
{ tags: 'regression' },
7777
() => {
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ describe('GP Workflow: View Lloyd George record', () => {
2929
});
3030

3131
it(
32-
'[Smoke] non-BSOL GP ADMIN user can download and delete the Lloyd George document of an active patient',
32+
'[Smoke] NON-BSOL GP ADMIN user can download the Lloyd George document of an active patient',
3333
{ tags: 'smoke', defaultCommandTimeout: 20000 },
3434
() => {
3535
cy.smokeLogin(Roles.GP_ADMIN);
3636
cy.get('.nhsuk-header__navigation').should('exist');
3737

38-
cy.getByTestId('search-patient-btn').click();
39-
4038
cy.get('#nhs-number-input').click();
4139
cy.get('#nhs-number-input').type(activePatient);
4240
cy.get('#search-submit').click();
@@ -48,16 +46,15 @@ describe('GP Workflow: View Lloyd George record', () => {
4846

4947
cy.getByTestId('pdf-viewer').should('be.visible');
5048

51-
cy.getByTestId('download-and-remove-record-btn').click();
52-
cy.getByTestId('confirm-download-and-remove-checkbox').should('exist');
53-
cy.getByTestId('confirm-download-and-remove-checkbox').click();
49+
cy.getByTestId('download-all-files-link').click();
50+
51+
cy.getByTestId('available-files-table-title').should('exist');
52+
cy.getByTestId('download-file-btn').click();
5453

5554
cy.downloadIframeReplace();
5655

5756
cy.intercept('POST', '**/DocumentManifest*').as('postDocumentManifest');
5857

59-
cy.getByTestId('confirm-download-and-remove-btn').click();
60-
6158
// Assert contents of page when downloading
6259
cy.getByTestId('lloydgeorge_downloadall-stage', { timeout: 10000 }).should('exist');
6360
cy.contains('Downloading documents').should('be.visible');

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('GP Workflow: GP Role rejected from accessing a non mating ODS patient
77

88
const workspace = Cypress.env('WORKSPACE');
99
const activePatient = workspace === 'ndr-dev' ? '9730153817' : '9000000002';
10-
const homeUrl = '/home';
10+
const homeUrl = '/patient/search';
1111

1212
gpRoles.forEach((role) => {
1313
it(
@@ -19,8 +19,6 @@ describe('GP Workflow: GP Role rejected from accessing a non mating ODS patient
1919
cy.smokeLogin(role);
2020

2121
cy.url({ timeout: 10000 }).should('eq', baseUrl + homeUrl);
22-
cy.getByTestId('search-patient-btn').should('exist');
23-
cy.getByTestId('search-patient-btn').click();
2422

2523
cy.get('#nhs-number-input').click();
2624
cy.get('#nhs-number-input').type(activePatient);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('GP Workflow: Patient search and verify', () => {
99
const workspace = Cypress.env('WORKSPACE');
1010
const activePatient =
1111
workspace === 'ndr-dev' ? pdsPatients.activeUpload : stubPatients.activeUpload;
12-
const homeUrl = '/home';
12+
const homeUrl = '/patient/search';
1313
const patientVerifyUrl = '/patient/verify';
1414
const lloydGeorgeRecordUrl = '/patient/lloyd-george-record';
1515

@@ -23,8 +23,6 @@ describe('GP Workflow: Patient search and verify', () => {
2323
cy.smokeLogin(role);
2424

2525
cy.url({ timeout: 10000 }).should('eq', baseUrl + homeUrl);
26-
cy.getByTestId('search-patient-btn').should('exist');
27-
cy.getByTestId('search-patient-btn').click();
2826

2927
cy.get('#nhs-number-input').click();
3028
cy.get('#nhs-number-input').type(activePatient);

app/src/helpers/hooks/useIsBSOL.test.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ describe('useIsBSOL', () => {
1616
renderHook(true);
1717
expect(screen.getByText(`isBSOL: true`)).toBeInTheDocument();
1818
});
19-
20-
it('returns null when there is no session', () => {
21-
renderHook();
22-
expect(screen.getByText(`isBSOL: false`)).toBeInTheDocument();
23-
});
2419
});
2520

2621
const TestApp = () => {

app/src/helpers/hooks/useIsBSOL.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import { useSessionContext } from '../../providers/sessionProvider/SessionProvider';
2-
31
function useIsBSOL() {
4-
const [session] = useSessionContext();
5-
6-
const isBSOL = session.auth ? session.auth.isBSOL : null;
7-
return !!isBSOL;
2+
return true;
83
}
94

105
export default useIsBSOL;

lambdas/services/login_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def generate_session(self, state, auth_code) -> dict:
128128
user_id,
129129
)
130130

131-
is_bsol = permitted_orgs_details["is_BSOL"]
131+
is_bsol = True
132132

133133
logger.info("Returning authentication details")
134134
response = {

lambdas/tests/unit/services/test_login_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_exchange_token_respond_with_auth_token_and_repo_role(
9898

9999
expected_jwt = "mock_ndr_auth_token"
100100
expected_role = RepositoryRole.PCSE
101-
expected_is_bsol = False
101+
expected_is_bsol = True
102102

103103
mocker.patch.object(
104104
LoginService,

0 commit comments

Comments
 (0)