diff --git a/web-client/src/presenter/computeds/trialSessionsHelper.test.ts b/web-client/src/presenter/computeds/trialSessionsHelper.test.ts index 9b21f07de13..17784c74e63 100644 --- a/web-client/src/presenter/computeds/trialSessionsHelper.test.ts +++ b/web-client/src/presenter/computeds/trialSessionsHelper.test.ts @@ -125,7 +125,7 @@ describe('trialSessionsHelper', () => { }); }); - describe('showUnassignedJudgeFilter', () => { + describe('trialSessionJudgeOptions', () => { it('should show the `unassigned` judge filter when on the new tab', () => { trialSessionsPageState.filters.currentTab = 'new'; @@ -137,10 +137,13 @@ describe('trialSessionsHelper', () => { }, }); - expect(result.showUnassignedJudgeFilter).toBeTruthy(); + expect(result.trialSessionJudgeOptions[2]).toEqual({ + label: 'Unassigned', + value: { name: 'Unassigned', userId: 'unassigned' }, + }); }); - it('should show the `unassigned` judge filter when on the calendared tab', () => { + it('should not show the `unassigned` judge filter when on the calendared tab', () => { trialSessionsPageState.filters.currentTab = 'calendared'; const result = runCompute(trialSessionsHelper, { @@ -151,7 +154,7 @@ describe('trialSessionsHelper', () => { }, }); - expect(result.showUnassignedJudgeFilter).toEqual(false); + expect(result.trialSessionJudgeOptions.length).toEqual(2); }); }); @@ -197,15 +200,21 @@ describe('trialSessionsHelper', () => { }, }); - expect(result.trialSessionJudgeOptions).toEqual([ - { - label: 'Sotomayor', - value: { - name: 'Sotomayor', - userId: '43b00e5f-b78c-476c-820e-5d6ed1d58828', - }, + expect(result.trialSessionJudgeOptions).toContain({ + label: judgeUser.name, + value: { + name: judgeUser.name, + userId: judgeUser.userId, }, - ]); + }); + + expect(result.trialSessionJudgeOptions).not.toContain({ + label: legacyJudgeUser.name, + value: { + name: legacyJudgeUser.name, + userId: legacyJudgeUser.userId, + }, + }); }); it('returns only current judges when the session status is open', () => { diff --git a/web-client/src/presenter/computeds/trialSessionsHelper.ts b/web-client/src/presenter/computeds/trialSessionsHelper.ts index b67f23e5758..cb898634d97 100644 --- a/web-client/src/presenter/computeds/trialSessionsHelper.ts +++ b/web-client/src/presenter/computeds/trialSessionsHelper.ts @@ -50,13 +50,13 @@ export const trialSessionsHelper = ( const judge = get(state.judgeUser); const judges = get(state.judges); - const pageSize = 5; // set this to sane value for testing purposes + const pageSize = 100; const showCurrentJudgesOnly = filters.currentTab === 'new' || filters.sessionStatus === SESSION_STATUS_TYPES.open; - let trialSessionJudges: { name: string; userId: string }[]; // 10409 TODO BUG. The judge options is not updating correctly. Showing legacy when it should not. + let trialSessionJudges: { name: string; userId: string }[]; if (showCurrentJudgesOnly) { trialSessionJudges = judges; } else {