diff --git a/src/pages/pdf-multi-tool.html b/src/pages/pdf-multi-tool.html index 52ec351c..a24794f8 100644 --- a/src/pages/pdf-multi-tool.html +++ b/src/pages/pdf-multi-tool.html @@ -136,6 +136,8 @@ > @@ -158,6 +160,8 @@ diff --git a/src/pages/pdf-workflow.html b/src/pages/pdf-workflow.html index d56528b8..ee9e2d1c 100644 --- a/src/pages/pdf-workflow.html +++ b/src/pages/pdf-workflow.html @@ -315,12 +315,14 @@ > @@ -328,6 +330,7 @@ @@ -336,6 +339,7 @@ @@ -343,6 +347,7 @@ @@ -361,6 +367,7 @@ @@ -368,6 +375,7 @@ diff --git a/src/tests/top-bar-hover-text.test.ts b/src/tests/top-bar-hover-text.test.ts new file mode 100644 index 00000000..abecf4ff --- /dev/null +++ b/src/tests/top-bar-hover-text.test.ts @@ -0,0 +1,27 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { describe, it, expect } from 'vitest'; + +const PAGES_DIR = path.resolve(__dirname, '../pages'); + +function loadPage(name: string): Document { + const html = fs.readFileSync(path.join(PAGES_DIR, name), 'utf8'); + return new DOMParser().parseFromString(html, 'text/html'); +} + +describe('top bar hover text', () => { + it.each(['pdf-multi-tool.html', 'pdf-workflow.html'])( + 'gives every %s button that hides its label a title', + (page) => { + const labels = loadPage(page).querySelectorAll( + 'button span[class*="hidden"][class*=":inline"]' + ); + + expect(labels.length).toBeGreaterThan(0); + labels.forEach((label) => { + const button = label.closest('button'); + expect(button?.title, button?.id).toBe(label.textContent?.trim()); + }); + } + ); +});