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
This commit is contained in:
Claude 2026-02-23 00:18:51 +00:00
parent 8b964560f3
commit eaa416b383
No known key found for this signature in database

View file

@ -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);
});