Skip to content

test: add script and generated fixtures for pdf-viewer tests - #13268

Merged
web-padawan merged 4 commits into
mainfrom
test/pdf-viewer-fixtures
Oct 26, 2026
Merged

web-padawan merged 4 commits into
mainfrom
test/pdf-viewer-fixtures

Conversation

@web-padawan

@web-padawan web-padawan commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Description

Part of #7669

  • Added 10 generated PDF fixtures for the <vaadin-pdf-viewer> unit tests under packages/pdf-viewer/test/fixtures/, plus an invalid.pdf text file
    • The files cover multi-page and mixed-size layout, links, an outline, tagged structure, non-embedded standard fonts, inline and wrapped links, a blocked javascript: link, a JavaScript OpenAction, a rotated page and encryption
  • Added generate-fixtures.js, which creates every fixture from HTML printed with Playwright's Chromium or writes it by hand
    • The printed fixtures use the OFL-licensed Instrument Sans font of the Aura theme, so they contain no system fonts
    • The script replaces the date of printing and the DOM node IDs of tagged table headers with fixed values
  • Added a README that lists each file, its contents and how it is made

No test uses the fixtures yet. The unit tests of the next PRs load them.

Type of change

  • Tests

How to test

  1. Run node packages/pdf-viewer/test/fixtures/generate-fixtures.js
  2. Run git status
  3. No fixture file changes, because the script recreates each file byte for byte with the same Chromium version

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@vaadin-review-bot vaadin-review-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes — left 3 comments.

Finding
⚠️ The Chromium-printed fixtures embed Arial subsets, so they do contain third-party content and are not reproducible across machines
📝 The unsafe-links fixture treats ftp: and tel: as URLs the viewer must block, which contradicts pdf.js defaults
🧪 The "link over two lines" is one tall annotation, not the per-line annotations real producers emit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@web-padawan
web-padawan removed the request for review from sissbruecker October 26, 2026 11:24
web-padawan and others added 2 commits October 26, 2026 13:26
Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com>
@web-padawan web-padawan changed the title test: add generated pdf fixtures for pdf-viewer test: add script and generated fixtures for pdf-viewer tests Oct 26, 2026
@sonarqubecloud

Copy link
Copy Markdown

@web-padawan
web-padawan merged commit dd7c272 into main Oct 26, 2026
14 checks passed
@web-padawan
web-padawan deleted the test/pdf-viewer-fixtures branch October 26, 2026 11:29
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.4.0-alpha5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants