Improve dashboard
This commit is contained in:
1
peakup-frontend/.gitignore
vendored
1
peakup-frontend/.gitignore
vendored
@@ -22,3 +22,4 @@ dist-ssr
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
/playwright-report/index.html
|
||||
|
||||
@@ -253,21 +253,21 @@ test('load chart: last CW tick returns to current week after clicking TODAY', as
|
||||
// ── buildLoadData: CTL / ATL / TSB values ─────────────────────────────────────
|
||||
|
||||
test('fitness state: CTL card shows value from last activity in current week', async ({ page }) => {
|
||||
// MOCK_ACTIVITIES_TODAY has ctl=58
|
||||
// MOCK_ACTIVITIES_TODAY has ctl=58; unit "TSS/day" is in a child <span> so use toContainText
|
||||
const value = page.getByText('Fitness (CTL)').locator('..').locator('p.text-3xl')
|
||||
await expect(value).toHaveText('58')
|
||||
await expect(value).toContainText('58')
|
||||
})
|
||||
|
||||
test('fitness state: ATL card shows value from last activity in current week', async ({ page }) => {
|
||||
// MOCK_ACTIVITIES_TODAY has atl=70
|
||||
const value = page.getByText('Fatigue (ATL)').locator('..').locator('p.text-3xl')
|
||||
await expect(value).toHaveText('70')
|
||||
await expect(value).toContainText('70')
|
||||
})
|
||||
|
||||
test('fitness state: TSB card equals CTL minus ATL', async ({ page }) => {
|
||||
// ctl=58, atl=70 → tsb=-12
|
||||
const value = page.getByText('Form (TSB)').locator('..').locator('p.text-3xl')
|
||||
await expect(value).toHaveText('-12')
|
||||
await expect(value).toContainText('-12')
|
||||
})
|
||||
|
||||
test('fitness state: all three values show dash when no activities exist before selected week', async ({
|
||||
@@ -278,9 +278,9 @@ test('fitness state: all three values show dash when no activities exist before
|
||||
const prevBtn = cwLabel.locator('..').getByRole('button').first()
|
||||
for (let i = 0; i < 15; i++) await prevBtn.click()
|
||||
|
||||
await expect(page.getByText('Fitness (CTL)').locator('..').locator('p.text-3xl')).toHaveText('—')
|
||||
await expect(page.getByText('Fatigue (ATL)').locator('..').locator('p.text-3xl')).toHaveText('—')
|
||||
await expect(page.getByText('Form (TSB)').locator('..').locator('p.text-3xl')).toHaveText('—')
|
||||
await expect(page.getByText('Fitness (CTL)').locator('..').locator('p.text-3xl')).toContainText('—')
|
||||
await expect(page.getByText('Fatigue (ATL)').locator('..').locator('p.text-3xl')).toContainText('—')
|
||||
await expect(page.getByText('Form (TSB)').locator('..').locator('p.text-3xl')).toContainText('—')
|
||||
})
|
||||
|
||||
// ── Empty state ───────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user