tests: dark-mode spec diffs against a per-engine light-mode reference

CI firefox read 0.228 header diff against the Chromium reference while its own
dark and light renders were pixel-identical — pure Firefox-vs-Chromium AA, not
a theme leak. Add the firefox light render as wizard-04-finish-headless-firefox.png
and pick the reference by browserName.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LvvARNMxQrq17vogn3REMU
This commit is contained in:
Gergő Törcsvári 2026-08-28 23:24:20 +02:00
commit c666a37f51
No known key found for this signature in database
GPG key ID: 8E75F2CDE64E5322
3 changed files with 15 additions and 3 deletions

View file

@ -1,5 +1,5 @@
import { test, expect } from './fixtures';
import { compareToReference, hideCursor, PCBNEW_REFERENCE, PCBNEW_HEADER_REGION } from './utils/screenshot-compare';
import { compareToReference, hideCursor, pcbnewReferenceFor, PCBNEW_HEADER_REGION } from './utils/screenshot-compare';
import { waitForEditorReady, shotPath } from '../e2e/utils/element-tracker';
/**
@ -27,7 +27,7 @@ test.use({
});
test.describe('PCBnew dark-mode browser', () => {
test('toolbar icons render the light theme under a dark-mode browser', async ({ page }) => {
test('toolbar icons render the light theme under a dark-mode browser', async ({ page, browserName }) => {
await page.goto('/kicad/pcbnew.html');
// Sanity-check the browser really reports dark mode to the app.
@ -43,7 +43,7 @@ test.describe('PCBnew dark-mode browser', () => {
scale: 'css'
});
const reference = await compareToReference(page, cssScreenshot, PCBNEW_REFERENCE, PCBNEW_HEADER_REGION);
const reference = await compareToReference(page, cssScreenshot, pcbnewReferenceFor(browserName), PCBNEW_HEADER_REGION);
expect(reference.actualWidth).toBe(reference.referenceWidth);
expect(reference.actualHeight).toBe(reference.referenceHeight);