fix(know-your-world): fix TypeScript build errors
- Fix MapData import in GameInfoPanel.tsx (import from types, not maps) - Fix MapData import in test files - Fix currentRegionName type (handle undefined with ?? null) These errors were blocking the Docker build in CI.
This commit is contained in:
parent
e0328fcbcc
commit
f622bfab54
|
|
@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'
|
|||
import { render, screen, waitFor } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { GameInfoPanel } from './GameInfoPanel'
|
||||
import type { MapData } from '../maps'
|
||||
import type { MapData } from '../types'
|
||||
|
||||
// Mock the context
|
||||
vi.mock('@/contexts/ThemeContext', () => ({
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useEffect } from 'react'
|
|||
import { css } from '@styled/css'
|
||||
import { useTheme } from '@/contexts/ThemeContext'
|
||||
import { useKnowYourWorld } from '../Provider'
|
||||
import type { MapData } from '../maps'
|
||||
import type { MapData } from '../types'
|
||||
|
||||
interface GameInfoPanelProps {
|
||||
mapData: MapData
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import { PlayingPhase } from './PlayingPhase'
|
||||
import type { MapData } from '../maps'
|
||||
import type { MapData } from '../types'
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock('../Provider', () => ({
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export function PlayingPhase() {
|
|||
|
||||
// Get the display name for the current prompt
|
||||
const currentRegionName = state.currentPrompt
|
||||
? mapData.regions.find((r) => r.id === state.currentPrompt)?.name
|
||||
? mapData.regions.find((r) => r.id === state.currentPrompt)?.name ?? null
|
||||
: null
|
||||
|
||||
// Debug logging
|
||||
|
|
|
|||
Loading…
Reference in New Issue