Skip to content

Commit

Permalink
10409: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
JayFlexy committed Sep 24, 2024
1 parent c38fe65 commit b829294
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web-client/src/presenter/computeds/trialSessionsHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,21 @@ describe('trialSessionsHelper', () => {
expect(trialSessionsOnly.length).toEqual(1);
});

// NOTE: This test passes, but I am unable to find when the userId for a judge would be set to unassigned
it('should only show trial sessions who do not have a judge when the judge filter is "unassigned"', () => {
trialSession1.judge = undefined;
trialSession2.judge!.userId = '2';
trialSessionsPageState.trialSessions = [trialSession1, trialSession2];
trialSessionsPageState.filters.judgeId = 'unassigned';
trialSessionsPageState.filters.judges = {
'd17b07dc-6455-447e-bea3-f91d12ac5a6a': {
name: 'Colvin',
userId: 'unassigned',
},
};

const result = runCompute(trialSessionsHelper, {
state: {
judges: [judgeUser],
judges: [],
permissions: getUserPermissions(docketClerk1User),
trialSessionsPage: trialSessionsPageState,
},
Expand All @@ -310,15 +316,13 @@ describe('trialSessionsHelper', () => {
it('should not filter trial sessions by judge when judge filter is All', () => {
trialSessionsPageState.trialSessions = [trialSession1, trialSession2];
trialSessionsPageState.filters.judgeId = 'All';
console.log('Trial Sessions: ', trialSessionsPageState.trialSessions);
const result = runCompute(trialSessionsHelper, {
state: {
judges: [judgeUser, judgeColvin],
permissions: getUserPermissions(docketClerk1User),
trialSessionsPage: trialSessionsPageState,
},
});
console.log('TrialSessionRows: ', result.trialSessionRows);

const trialSessionsOnly =
result.trialSessionRows.filter(isTrialSessionRow);
Expand Down

0 comments on commit b829294

Please sign in to comment.