fix: add showAsAbacus property to ComplementQuestion type

Import ComplementQuestion type from gameTypes and add
showAsAbacus property to test mocks and component interfaces.

The ComplementQuestion interface requires showAsAbacus as a
required property. Using the imported type ensures consistency
and fixes missing property errors.

Fixes ~34 TS2741 errors in complement-race components/tests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock
2025-10-07 15:16:22 -05:00
parent e06727160c
commit 4adcc09643
4 changed files with 7 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import {
type DisembarkingAnimation,
usePassengerAnimations,
} from '../../hooks/usePassengerAnimations'
import type { ComplementQuestion } from '../../lib/gameTypes'
import { useSteamJourney } from '../../hooks/useSteamJourney'
import { useTrackManagement } from '../../hooks/useTrackManagement'
import { useTrainTransforms } from '../../hooks/useTrainTransforms'
@@ -80,7 +81,7 @@ interface SteamTrainJourneyProps {
trainPosition: number
pressure: number
elapsedTime: number
currentQuestion: { number: number; targetSum: number; correctAnswer: number } | null
currentQuestion: ComplementQuestion | null
currentInput: string
}

View File

@@ -29,6 +29,7 @@ describe('GameHUD', () => {
const mockPassenger: Passenger = {
id: 'passenger-1',
name: 'Test Passenger',
avatar: '👨',
originStationId: 'station-1',
destinationStationId: 'station-2',
@@ -49,6 +50,7 @@ describe('GameHUD', () => {
number: 3,
targetSum: 10,
correctAnswer: 7,
showAsAbacus: false,
},
currentInput: '7',
}

View File

@@ -10,6 +10,7 @@ import {
type DisembarkingAnimation,
usePassengerAnimations,
} from '../../hooks/usePassengerAnimations'
import type { ComplementQuestion } from '../../lib/gameTypes'
import { useSteamJourney } from '../../hooks/useSteamJourney'
import { useTrackManagement } from '../../hooks/useTrackManagement'
import { useTrainTransforms } from '../../hooks/useTrainTransforms'
@@ -80,7 +81,7 @@ interface SteamTrainJourneyProps {
trainPosition: number
pressure: number
elapsedTime: number
currentQuestion: { number: number; targetSum: number; correctAnswer: number } | null
currentQuestion: ComplementQuestion | null
currentInput: string
}

View File

@@ -49,6 +49,7 @@ describe('GameHUD', () => {
number: 3,
targetSum: 10,
correctAnswer: 7,
showAsAbacus: false,
},
currentInput: '7',
}