Label the install button Install
Some checks are pending
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,dependency-freshness) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / web-coverage (push) Waiting to run
repo-contract / repo contract (push) Waiting to run

Install targets any game allowed today, so "Install assigned" was wrong.
Test reads the Astro pages, which vitest never renders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWZCxnNWLtpVwFLVk9w
This commit is contained in:
Krzysztof Rudnicki 2026-11-22 21:53:24 +01:00
parent 94a0e8a1c3
commit a32ab66c5a
4 changed files with 20 additions and 4 deletions

View File

@ -8,7 +8,7 @@ import '../styles/gaming.css'
<Shell title="Dashboard">
<PageHead title="Dashboard" sub="What the enforcer is doing right now.">
<command-button name="done" label="I got an achievement" tone="primary"></command-button>
<command-button name="install" label="Install assigned"></command-button>
<command-button name="install" label="Install"></command-button>
<command-button name="pick" label="Pick next"></command-button>
<command-button name="scan" label="Scan"></command-button>
</PageHead>

View File

@ -8,7 +8,7 @@ import '../../styles/library-page.css'
<Shell title="Library">
<PageHead title="Library" sub="Every game you own, and what is installed." />
<Actions>
<command-card name="install" label="Install assigned"></command-card>
<command-card name="install" label="Install"></command-card>
<uninstall-card></uninstall-card>
<command-card name="hide" label="Hide others"></command-card>
<command-card name="unhide" label="Unhide all"></command-card>

View File

@ -27,7 +27,7 @@ const base = (over: Record<string, Handler> = {}): Record<string, Handler> => ({
const PAGE = `<main>
<header class="page-head">
<command-button name="done" label="I got an achievement" tone="primary"></command-button>
<command-button name="install" label="Install assigned"></command-button>
<command-button name="install" label="Install"></command-button>
<command-button name="pick" label="Pick next"></command-button>
<command-button name="scan" label="Scan"></command-button>
</header>
@ -52,7 +52,7 @@ describe('Dashboard', () => {
expect(screen.getByRole('button', { name: 'I got an achievement' })).toHaveAttribute('aria-disabled', 'false')
})
expect(screen.getByRole('button', { name: 'I got an achievement' })).toHaveClass('btn-primary')
for (const name of ['Install assigned', 'Pick next', 'Scan']) {
for (const name of ['Install', 'Pick next', 'Scan']) {
expect(screen.getByRole('button', { name })).toHaveAttribute('aria-disabled', 'false')
}
})

View File

@ -0,0 +1,16 @@
// The install button's spoken label lives in the Astro pages, which vitest
// never renders: read their source. Install targets any game allowed today,
// not only the assigned one, so the label must not say "assigned".
import { readFileSync } from 'node:fs'
import { describe, expect, it } from 'vitest'
const page = (file: string) => readFileSync(new URL(file, import.meta.url), 'utf8')
describe('install button label', () => {
it.each(['../pages/index.astro', '../pages/library/index.astro'])('%s labels it "Install"', (file) => {
const src = page(file)
expect(src).toMatch(/name="install" label="Install"/)
expect(src).not.toMatch(/Install assigned/)
})
})