import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import i18n from '@/i18n' import { TimelinePanel } from './timeline-panel' import { predictionFixture } from '@/lib/timeline.fixtures' import { useTimelinePlayer } from '@/lib/use-timeline-player' import type { Prediction } from '@/lib/api' beforeEach(async () => { await i18n.changeLanguage('zh') }) afterEach(() => { cleanup(); vi.restoreAllMocks() }) function Harness({ result = predictionFixture }: { result?: Prediction | null }) { const player = useTimelinePlayer() return <>