Skip to content

Commit 3b5aa34

Browse files
fix(j-s): Indictment Filter Option (#15410)
* Remoes indictment filter option from roles that only see indictment cases * Updates unit test --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent dfa9ccb commit 3b5aa34

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/judicial-system/web/src/routes/Shared/Cases/useFilter.spec.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ describe('useFilter - filterOptionsForUser', () => {
3838
{ value: 'INVESTIGATION', label: 'INVESTIGATION' },
3939
]),
4040
)
41-
expect(result.length).toBe(3)
42-
expect(result).toEqual(
41+
expect(result.length).toBe(2)
42+
expect(result).not.toEqual(
4343
expect.arrayContaining([{ value: 'INDICTMENT', label: 'INDICTMENT' }]),
4444
)
4545
})

apps/judicial-system/web/src/routes/Shared/Cases/useFilter.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const filterOptionsForUser = (
8383
user?.role === UserRole.PROSECUTOR_REPRESENTATIVE ||
8484
user?.role === UserRole.DISTRICT_COURT_ASSISTANT
8585
) {
86-
return option.value !== 'INVESTIGATION'
86+
return option.value !== 'INVESTIGATION' && option.value !== 'INDICTMENT'
8787
}
8888

8989
return true

0 commit comments

Comments
 (0)