Rework Race Hub as weekend workspace

This commit is contained in:
2026-05-25 12:35:08 -04:00
parent ee88a07aa1
commit 3bd169c55c
22 changed files with 2019 additions and 313 deletions

View File

@@ -13,7 +13,7 @@ test.describe('Command Center', () => {
})
test('nav link reaches command center from race hub', async ({ page }) => {
await page.goto('/race-hub')
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await page.getByRole('link', { name: 'Command' }).click()
await expect(page).toHaveURL('/')
await expect(page.getByTestId('command-center')).toBeVisible()
@@ -24,12 +24,14 @@ test.describe('Command Center', () => {
await expect(page.getByTestId('cc-action-race-hub')).toContainText(String(FULL_SESSION))
await page.getByTestId('cc-action-race-hub').click()
await expect(page).toHaveURL(new RegExp(`/race-hub\\?session_key=${FULL_SESSION}`))
await expect(page.getByText('Final Classification')).toBeVisible()
await expect(page.getByTestId('rh-identity')).toBeVisible()
await expect(page.getByTestId(`rh-session-${FULL_SESSION}`)).toBeVisible()
})
test('existing routes continue to work', async ({ page }) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await expect(page.getByText('Final Classification')).toBeVisible()
await expect(page.getByTestId('race-hub')).toBeVisible()
await expect(page.getByTestId('rh-overview')).toBeVisible()
await page.goto('/admin')
await expect(page.getByTestId('data-library')).toBeVisible()

View File

@@ -37,6 +37,7 @@ test.describe('Admin · Data Health', () => {
test('direct race hub session link still works', async ({ page }) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await expect(page.getByText('Final Classification')).toBeVisible()
await expect(page.getByTestId('race-hub')).toBeVisible()
await expect(page.getByTestId(`rh-session-${FULL_SESSION}`)).toBeVisible()
})
})

View File

@@ -10,9 +10,14 @@ test.describe('Production serving (Go + built React)', () => {
await expect(page.getByTestId('cc-session-9472')).toBeVisible()
})
test('serves race hub with classification from built assets', async ({ page }) => {
test('serves race hub workspace from built assets', async ({ page }) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await expect(page.getByTestId('race-hub')).toBeVisible()
await expect(page.getByTestId('rh-identity')).toBeVisible()
await expect(page.getByTestId(`rh-session-${FULL_SESSION}`)).toBeVisible()
await page.getByRole('tab', { name: 'Race Story' }).click()
await expect(page.getByText('Final Classification')).toBeVisible()
await expect(page.locator('.drv-code', { hasText: 'VER' })).toBeVisible()
})

View File

@@ -3,15 +3,40 @@ import { test, expect } from '@playwright/test'
const FULL_SESSION = 9472
const CORE_ONLY_SESSION = 9000
test.describe('Race Hub', () => {
test('loads classification for a seeded session', async ({ page }) => {
test.describe('Race Hub Weekend Workspace', () => {
test('lands on the Overview tab with workspace identity', async ({ page }) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await expect(page.getByTestId('race-hub')).toBeVisible()
await expect(page.getByTestId('rh-identity')).toBeVisible()
await expect(page.getByTestId(`rh-session-${FULL_SESSION}`)).toBeVisible()
await expect(page.getByTestId('rh-overview')).toBeVisible()
await expect(page.getByRole('tab', { name: 'Overview' })).toHaveAttribute(
'aria-selected',
'true',
)
})
test('shows final classification when switching to Race Story', async ({ page }) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await page.getByRole('tab', { name: 'Race Story' }).click()
await expect(page.getByText('Final Classification')).toBeVisible()
await expect(page.locator('.drv-code', { hasText: 'VER' })).toBeVisible()
await expect(page.locator('.drv-code', { hasText: 'HAM' })).toBeVisible()
})
test('Race Story exposes classification, grid, and positions sub-views', async ({ page }) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await page.getByRole('tab', { name: 'Race Story' }).click()
await page.getByRole('tab', { name: 'Starting Grid' }).click()
await expect(page.locator('.sec-title', { hasText: 'Starting Grid' })).toBeVisible()
await page.getByRole('tab', { name: 'Positions' }).click()
await expect(page.locator('[data-testid="position-chart"]')).toBeVisible()
})
test('strategy tab renders stint chart when stints are available', async ({ page }) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await page.getByRole('tab', { name: 'Strategy' }).click()
@@ -20,14 +45,6 @@ test.describe('Race Hub', () => {
await expect(page.getByText('Stints not available.')).not.toBeVisible()
})
test('positions tab renders position chart when positions are available', async ({ page }) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await page.getByRole('tab', { name: 'Positions' }).click()
await expect(page.locator('[data-testid="position-chart"]')).toBeVisible()
await expect(page.getByText('Lap-by-lap positions not available.')).not.toBeVisible()
})
test('strategy tab shows missing notice when stints are unavailable', async ({ page }) => {
await page.goto(`/race-hub?session_key=${CORE_ONLY_SESSION}`)
await page.getByRole('tab', { name: 'Strategy' }).click()
@@ -36,25 +53,42 @@ test.describe('Race Hub', () => {
await expect(page.locator('[data-testid="strategy-chart"]')).not.toBeVisible()
})
test('positions tab shows missing notice when positions are unavailable', async ({ page }) => {
test('positions sub-view shows missing notice when positions are unavailable', async ({
page,
}) => {
await page.goto(`/race-hub?session_key=${CORE_ONLY_SESSION}`)
await page.getByRole('tab', { name: 'Race Story' }).click()
await page.getByRole('tab', { name: 'Positions' }).click()
await expect(page.getByText('Lap-by-lap positions not available.')).toBeVisible()
await expect(page.locator('[data-testid="position-chart"]')).not.toBeVisible()
})
test('navigates to race hub via local data browser', async ({ page }) => {
test('switching weekend via the inline switcher navigates to selected session', async ({
page,
}) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await page.getByTestId('rh-switch-weekend').click()
await expect(page.getByTestId('rh-switcher')).toBeVisible()
// Active session is already loaded; just confirm a session button is reachable
await expect(page.getByTestId(`rh-switcher-session-${FULL_SESSION}`)).toBeVisible()
})
test('Data Status tab points at admin instead of inline CLI hints', async ({ page }) => {
await page.goto(`/race-hub?session_key=${CORE_ONLY_SESSION}`)
await page.getByRole('tab', { name: 'Data Status' }).click()
await expect(page.getByTestId('rh-data-status')).toBeVisible()
await expect(page.getByRole('link', { name: /manage ingestion/i })).toHaveAttribute(
'href',
'/admin',
)
})
test('bare /race-hub redirects to the focus session', async ({ page }) => {
await page.goto('/race-hub')
await expect(page.getByTestId('local-nav')).toBeVisible()
await expect(page.getByText('Monaco')).toBeVisible()
await page.getByRole('button', { name: 'Sessions' }).click()
await expect(page.getByTestId('weekend-sessions')).toBeVisible()
await page.getByTestId('open-session-9472').click()
await expect(page.getByText('Final Classification')).toBeVisible()
await expect(page.locator('.drv-code', { hasText: 'VER' })).toBeVisible()
await expect(page).toHaveURL(/session_key=\d+/)
await expect(page.getByTestId('race-hub')).toBeVisible()
})
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

@@ -24,8 +24,10 @@ export async function gotoCommandCenterReady(page: Page): Promise<void> {
export async function gotoRaceHubReady(page: Page, sessionKey = FULL_SESSION): Promise<void> {
await page.goto(`/race-hub?session_key=${sessionKey}`)
await expect(page.getByText('Final Classification')).toBeVisible()
await expect(page.locator('.drv-code', { hasText: 'VER' })).toBeVisible()
await expect(page.getByTestId('race-hub')).toBeVisible()
await expect(page.getByTestId('rh-identity')).toBeVisible()
await expect(page.getByTestId(`rh-session-${sessionKey}`)).toBeVisible()
await expect(page.getByTestId('rh-overview')).toBeVisible()
await waitForScreenshotReady(page)
}