From 8439216dd876f17e55263959ff203a424a06d548 Mon Sep 17 00:00:00 2001 From: Richard R Date: Tue, 19 May 2026 23:19:53 -0600 Subject: [PATCH] test(pdf-upload): update assertions for PDF viewer heading and page navigation Replace text-based assertion for PDF title with role-based heading check and add assertion for visible page navigation button. Improves test robustness against UI changes and ensures accessibility compliance. --- tests/upload.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/upload.spec.ts b/tests/upload.spec.ts index 6a565e2..b95e7cd 100644 --- a/tests/upload.spec.ts +++ b/tests/upload.spec.ts @@ -77,7 +77,8 @@ test.describe('Document Upload Tests', () => { await expectViewerForFile(page, 'sample.pdf'); // Additional content checks specific to the sample PDF await expect(page.locator('.react-pdf__Page')).toBeVisible(); - await expect(page.getByText('Sample PDF')).toBeVisible(); + await expect(page.getByRole('heading', { level: 1, name: 'sample.pdf' })).toBeVisible(); + await expect(page.getByRole('button', { name: /1\s*\/\s*2/ })).toBeVisible(); }); test('displays an EPUB document', async ({ page }) => {