Skip to content

Commit 901c97d

Browse files
committed
chore: cleanup and tests for applicant template nine
1 parent 5a13eb5 commit 901c97d

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

app/backend/lib/excel_import/template_nine.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,7 @@ templateNine.post(
572572
const isRoleAuthorized =
573573
pgRole === 'ccbc_admin' ||
574574
pgRole === 'super_admin' ||
575-
pgRole === 'ccbc_analyst' ||
576-
pgRole === 'ccbc_auth_user';
575+
pgRole === 'ccbc_analyst';
577576

578577
if (!isRoleAuthorized) {
579578
return res.status(404).end();

app/tests/backend/lib/excel_import/template_nine.test.ts

+18
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,22 @@ describe('The Community Progress Report import', () => {
324324

325325
expect(response.status).toBe(200);
326326
});
327+
328+
it('should process the rfi for applicant', async () => {
329+
mocked(getAuthRole).mockImplementation(() => {
330+
return {
331+
pgRole: 'ccbc_auth_user',
332+
landingRoute: '/',
333+
};
334+
});
335+
336+
const response = await request(app)
337+
.post('/api/template-nine/rfi/applicant/1/CCBC-00001-1')
338+
.set('Content-Type', 'application/json')
339+
.set('Connection', 'keep-alive')
340+
.field('data', JSON.stringify({ name: 'form' }))
341+
.attach('template9', `${__dirname}/template9-complete.xlsx`);
342+
343+
expect(response.status).toBe(200);
344+
});
327345
});

0 commit comments

Comments
 (0)