diff --git a/web/src/pages/index.astro b/web/src/pages/index.astro index 312f8ff..4685d0f 100644 --- a/web/src/pages/index.astro +++ b/web/src/pages/index.astro @@ -8,7 +8,7 @@ import '../styles/gaming.css' - + diff --git a/web/src/pages/library/index.astro b/web/src/pages/library/index.astro index a19e199..838d292 100644 --- a/web/src/pages/library/index.astro +++ b/web/src/pages/library/index.astro @@ -8,7 +8,7 @@ import '../../styles/library-page.css' - + diff --git a/web/src/sections/dashboard.test.ts b/web/src/sections/dashboard.test.ts index 7efbd03..d1adba9 100644 --- a/web/src/sections/dashboard.test.ts +++ b/web/src/sections/dashboard.test.ts @@ -27,7 +27,7 @@ const base = (over: Record = {}): Record => ({ const PAGE = `
- +
@@ -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') } }) diff --git a/web/src/sections/pageLabels.test.ts b/web/src/sections/pageLabels.test.ts new file mode 100644 index 0000000..c67fdc2 --- /dev/null +++ b/web/src/sections/pageLabels.test.ts @@ -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/) + }) +})