Skip to content

Commit

Permalink
fix(j-s): test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
unakb committed Jun 18, 2024
1 parent 7f6af3d commit a68f883
Showing 1 changed file with 5 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CanActivate } from '@nestjs/common'

import { indictmentCases } from '@island.is/judicial-system/types'

import { CaseExistsGuard } from '../../guards/caseExists.guard'
Expand All @@ -17,34 +15,11 @@ describe('InternalCaseController - Deliver assigned roles in indictment case to
)
})

it('should have two guards', () => {
expect(guards).toHaveLength(2)
})

describe('CaseExistsGuard', () => {
let guard: CanActivate

beforeEach(() => {
guard = new guards[0]()
})

it('should have CaseExistsGuard as guard 1', () => {
expect(guard).toBeInstanceOf(CaseExistsGuard)
})
})

describe('CaseTypeGuard', () => {
let guard: CanActivate

beforeEach(() => {
guard = guards[1]
})

it('should have CaseTypeGuard as guard 2', () => {
expect(guard).toBeInstanceOf(CaseTypeGuard)
expect(guard).toEqual({
allowedCaseTypes: indictmentCases,
})
it('should have the right guard configuration', () => {
expect(new guards[0]()).toBeInstanceOf(CaseExistsGuard)
expect(guards[1]).toBeInstanceOf(CaseTypeGuard)
expect(guards[1]).toEqual({
allowedCaseTypes: indictmentCases,
})
})
})

0 comments on commit a68f883

Please sign in to comment.