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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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',
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ describe('GameHUD', () => {
|
||||
number: 3,
|
||||
targetSum: 10,
|
||||
correctAnswer: 7,
|
||||
showAsAbacus: false,
|
||||
},
|
||||
currentInput: '7',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user