Skip to content

Commit

Permalink
fix(j-s): remove test case since the controller bypasses the decorato…
Browse files Browse the repository at this point in the history
…r logic
  • Loading branch information
thorhildurt committed Dec 11, 2024
1 parent ae5dfd5 commit 449581e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export class LimitedAccessDefendantController {
this.logger.debug(
`Updating limitedAccess defendant ${defendantId} of case ${caseId}`,
)

return this.defendantService.updateRequestCaseDefendant(
theCase,
defendant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,4 @@ describe('LimitedAccessDefendantController - UpdateDefendant', () => {
expect(mockMessageService.sendMessagesToQueue).not.toHaveBeenCalled()
})
})

describe('defendant limited updated fails on fields that are not supported', () => {
const defendantUpdate = { address: "test 1" }
const updatedDefendant = { ...defendant, ...defendantUpdate }
let then: Then

beforeEach(async () => {
const mockUpdate = mockDefendantModel.update as jest.Mock
mockUpdate.mockResolvedValueOnce([1, [updatedDefendant]])

then = await givenWhenThen(defendantUpdate, CaseType.INDICTMENT)
})

it('should throw error', () => {
expect(then.error).toBeInstanceOf(Error)
expect(then.error.message).toBe('Some error')

})
})
})

0 comments on commit 449581e

Please sign in to comment.