From eaa416b38316e3d4f029b944abee46d9256bbd63 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Feb 2026 00:18:51 +0000 Subject: [PATCH] Fix TypeScript errors in settings-update tests TS was narrowing const draftSpeed = 'fast' to the literal type 'fast', making comparisons with 'slow'/'very-slow' etc. flagged as impossible. Widen all draftSpeed locals and the season status locals to string so the if-chains compile cleanly under strict mode. https://claude.ai/code/session_01Jp2tE3YXhx2jdb6CgCnvZy --- .../leagues/__tests__/settings-update.test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/routes/leagues/__tests__/settings-update.test.ts b/app/routes/leagues/__tests__/settings-update.test.ts index f4acfa7..98cc214 100644 --- a/app/routes/leagues/__tests__/settings-update.test.ts +++ b/app/routes/leagues/__tests__/settings-update.test.ts @@ -246,7 +246,7 @@ describe('Settings Update - Season Save', () => { }); it('should map "fast" draft speed to correct timer values', () => { - const draftSpeed = 'fast'; + const draftSpeed: string = 'fast'; let initialTime: number; let incrementTime: number; @@ -277,7 +277,7 @@ describe('Settings Update - Season Save', () => { }); it('should map "standard" draft speed to correct timer values', () => { - const draftSpeed = 'standard'; + const draftSpeed: string = 'standard'; let initialTime = 120; let incrementTime = 15; @@ -290,7 +290,7 @@ describe('Settings Update - Season Save', () => { }); it('should map "slow" draft speed to correct timer values', () => { - const draftSpeed = 'slow'; + const draftSpeed: string = 'slow'; let initialTime = 120; let incrementTime = 15; @@ -303,7 +303,7 @@ describe('Settings Update - Season Save', () => { }); it('should map "very-slow" draft speed to correct timer values', () => { - const draftSpeed = 'very-slow'; + const draftSpeed: string = 'very-slow'; let initialTime = 120; let incrementTime = 15; @@ -316,7 +316,7 @@ describe('Settings Update - Season Save', () => { }); it('should fall back to standard speed for an unknown draft speed value', () => { - const draftSpeed = 'turbo-ultra'; + const draftSpeed: string = 'turbo-ultra'; let initialTime = 120; let incrementTime = 15; @@ -355,15 +355,15 @@ describe('Settings Update - Season Save', () => { }); it('should only update scoring fields when season status is pre_draft', () => { - const preDraftSeason = { ...mockSeason, status: 'pre_draft' as const }; - const draftSeason = { ...mockSeason, status: 'draft' as const }; + const preDraftStatus: string = 'pre_draft'; + const draftStatus: string = 'draft'; // Scoring changes allowed in pre_draft - const canUpdateScoring = preDraftSeason.status === 'pre_draft'; + const canUpdateScoring = preDraftStatus === 'pre_draft'; expect(canUpdateScoring).toBe(true); // Scoring changes NOT allowed during draft - const canUpdateScoringDuringDraft = draftSeason.status === 'pre_draft'; + const canUpdateScoringDuringDraft = draftStatus === 'pre_draft'; expect(canUpdateScoringDuringDraft).toBe(false); });