fix(#83): align prod Race Story smoke with final running order outcome

Replace the removed "Final Classification" literal with an accessible
race-story-outcome region and assert VER is P1 in the built SPA smoke.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-12 20:13:07 -04:00
parent 15d81c8eab
commit 14d9bd3dd4
3 changed files with 24 additions and 3 deletions

View File

@@ -704,7 +704,12 @@ export function RaceStoryCanvas({ data }: Props) {
</div> </div>
{displayResults.length > 0 && ( {displayResults.length > 0 && (
<div className="rs-field-list"> <div
className="rs-field-list"
role="region"
aria-label="Final running order"
data-testid="race-story-outcome"
>
{displayResults.map((r, i) => { {displayResults.map((r, i) => {
const gridPos = grid.find((g) => g.driver_number === r.driver_number)?.position ?? 0 const gridPos = grid.find((g) => g.driver_number === r.driver_number)?.position ?? 0
const currentPos = scrubTime !== null ? i + 1 : r.position const currentPos = scrubTime !== null ? i + 1 : r.position

View File

@@ -278,6 +278,15 @@ describe('RaceStoryCanvas replay map', () => {
expect(screen.getByTestId('chapter-card-0')).not.toHaveClass('active') expect(screen.getByTestId('chapter-card-0')).not.toHaveClass('active')
}) })
it('exposes the final running order outcome region with winner position', () => {
renderCanvas()
const outcome = screen.getByTestId('race-story-outcome')
expect(outcome).toHaveAttribute('aria-label', 'Final running order')
expect(outcome).toHaveTextContent('VER')
expect(outcome.querySelector('.rs-pos-col')).toHaveTextContent('1')
})
it('renders the empty-state card when positions are unavailable', () => { it('renders the empty-state card when positions are unavailable', () => {
renderCanvas({ renderCanvas({
datasets: { positions: { status: 'missing', source: 'local', count: 0 } }, datasets: { positions: { status: 'missing', source: 'local', count: 0 } },

View File

@@ -18,8 +18,15 @@ test.describe('Production serving (Go + built React)', () => {
await expect(page.getByTestId(`rh-session-${FULL_SESSION}`)).toBeVisible() await expect(page.getByTestId(`rh-session-${FULL_SESSION}`)).toBeVisible()
await page.getByRole('tab', { name: 'Race Story' }).click() await page.getByRole('tab', { name: 'Race Story' }).click()
await expect(page.getByText('Final Classification')).toBeVisible()
await expect(page.locator('.drv-code', { hasText: 'VER' })).toBeVisible() const outcome = page.getByRole('region', { name: 'Final running order' })
await expect(outcome).toBeVisible()
await expect(outcome).toHaveAttribute('data-testid', 'race-story-outcome')
const verRow = page.locator('.rs-driver-row', {
has: page.locator('.rs-driver-name', { hasText: 'VER' }),
})
await expect(verRow.locator('.rs-pos-col')).toHaveText('1')
}) })
test('serves admin / data health route', async ({ page }) => { test('serves admin / data health route', async ({ page }) => {