Skip to content

Commit

Permalink
CVSL-2292 audit fix for hdc12 com unallocated report (#1582)
Browse files Browse the repository at this point in the history
  • Loading branch information
louisenorris authored Jan 22, 2025
1 parent d8bd4cf commit fb6280a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/routes/licencesRequiringComAssignmentReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export = (licenceSearchService, audit) => (router) => {
res.contentType('text/csv')
res.set('Content-Disposition', `attachment;filename=HDC12 no COM assigned - ${prisonId} - ${timestamp}.csv`)
res.send(licencesRequiringComAssignment)
await audit.addItem('LICENCES_REQUIRING_COM_DOWNLOAD', username, { prisonId })
await audit.record('LICENCES_REQUIRING_COM_DOWNLOAD', username, { prisonId })
})
)

Expand Down
4 changes: 2 additions & 2 deletions test/routes/licencesRequiringComAssignmentReport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('/licencesRequiringComAssignmentReport', () => {
getLicencesRequiringComAssignment: jest.fn(),
}
audit = {
addItem: jest.fn(),
record: jest.fn(),
}
})

Expand Down Expand Up @@ -49,7 +49,7 @@ describe('/licencesRequiringComAssignmentReport', () => {
.post('/licencesRequiringComAssignmentReport')
.expect(200)
.expect(() => {
expect(audit.addItem).toHaveBeenCalledWith('LICENCES_REQUIRING_COM_DOWNLOAD', 'CA_USER_TEST', {
expect(audit.record).toHaveBeenCalledWith('LICENCES_REQUIRING_COM_DOWNLOAD', 'CA_USER_TEST', {
prisonId: 'caseLoadId',
})
})
Expand Down

0 comments on commit fb6280a

Please sign in to comment.