-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(j-s): Deliver Subpoena to Court (#17239)
* Delivers subpoena to court * Updates tests * Update apps/judicial-system/backend/src/app/modules/subpoena/test/internalSubpoenaController/deliverSubpoenaToPolice.spec.ts --------- Co-authored-by: unakb <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
68f32f0
commit f31b613
Showing
15 changed files
with
334 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...app/modules/subpoena/test/internalSubpoenaController/deliverSubpoanaToCourtGuards.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { indictmentCases } from '@island.is/judicial-system/types' | ||
|
||
import { CaseExistsGuard, CaseTypeGuard } from '../../../case' | ||
import { DefendantExistsGuard } from '../../../defendant' | ||
import { SubpoenaExistsGuard } from '../../guards/subpoenaExists.guard' | ||
import { InternalSubpoenaController } from '../../internalSubpoena.controller' | ||
|
||
describe('InternalSubpoenaController - Deliver subpoena to court guards', () => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
let guards: any[] | ||
|
||
beforeEach(() => { | ||
guards = Reflect.getMetadata( | ||
'__guards__', | ||
InternalSubpoenaController.prototype.deliverSubpoenaToCourt, | ||
) | ||
}) | ||
|
||
it('should have the right guard configuration', () => { | ||
expect(guards).toHaveLength(4) | ||
expect(new guards[0]()).toBeInstanceOf(CaseExistsGuard) | ||
expect(guards[1]).toBeInstanceOf(CaseTypeGuard) | ||
expect(guards[1]).toEqual({ | ||
allowedCaseTypes: indictmentCases, | ||
}) | ||
expect(new guards[2]()).toBeInstanceOf(DefendantExistsGuard) | ||
expect(new guards[3]()).toBeInstanceOf(SubpoenaExistsGuard) | ||
}) | ||
}) |
29 changes: 29 additions & 0 deletions
29
...pp/modules/subpoena/test/internalSubpoenaController/deliverSubpoanaToPoliceGuards.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { indictmentCases } from '@island.is/judicial-system/types' | ||
|
||
import { CaseExistsGuard, CaseTypeGuard } from '../../../case' | ||
import { DefendantExistsGuard } from '../../../defendant' | ||
import { SubpoenaExistsGuard } from '../../guards/subpoenaExists.guard' | ||
import { InternalSubpoenaController } from '../../internalSubpoena.controller' | ||
|
||
describe('InternalSubpoenaController - Deliver subpoena to police guards', () => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
let guards: any[] | ||
|
||
beforeEach(() => { | ||
guards = Reflect.getMetadata( | ||
'__guards__', | ||
InternalSubpoenaController.prototype.deliverSubpoenaToPolice, | ||
) | ||
}) | ||
|
||
it('should have the right guard configuration', () => { | ||
expect(guards).toHaveLength(4) | ||
expect(new guards[0]()).toBeInstanceOf(CaseExistsGuard) | ||
expect(guards[1]).toBeInstanceOf(CaseTypeGuard) | ||
expect(guards[1]).toEqual({ | ||
allowedCaseTypes: indictmentCases, | ||
}) | ||
expect(new guards[2]()).toBeInstanceOf(DefendantExistsGuard) | ||
expect(new guards[3]()).toBeInstanceOf(SubpoenaExistsGuard) | ||
}) | ||
}) |
Oops, something went wrong.