1
0
mirror of https://github.com/element-hq/element-web.git synced 2026-10-23 11:09:01 +03:00
Files
element-web/apps/web/tsconfig.browser-test.json
David Langley ca589fd7f6 Add multi-digit support for overlay badges and tests (#33637)
* Add multi-digit support for overlay badges and tests

Fix multi-digit notification badge in Windows taskbar overlay

The BadgeOverlayRenderer reused the over-baseImage layout for the
standalone 16x16 overlay, which pushed multi-digit badges off the left
of the canvas (e.g. "10" rendered as just "0"). Keep the pill inside
the canvas bounds in the no-baseImage path and reduce its height for
multi-digit counts so the rounded-rect path actually produces a pill.

Adds a Playwright test that bundles favicon.ts with esbuild, drives
the real BadgeOverlayRenderer in Chromium, and writes the resulting
PNGs to disk plus a scaled-up screenshot snapshot for regression
detection.

Include summary for overlay and favicon

* add esbuild as devDependency

* Update pnpm-lock.yaml

* e2e -> unit test

* Fix regression on vertical alignment of the badge text

* Update pnpm-lock.yaml

* Fix prettier formatting in favicon.ts and image snapshot tests

* Clamp Windows overlay badge at "99+"

Clamp Windows overlay badge at "99+"

The Windows taskbar overlay is only 16x16 px and the platform's own
notification badges clamp at "99+", so do the same here rather than
trying to fit three-digit counts or "1k+" labels into the tiny canvas.
Browser-tab favicons are unaffected and still render larger counts.

* Move badge rendering tests to vitest browser mode

* Rename browser tests to *.test.browser.ts

* Exclude browser tests from jest coverage collection

* Scope browser matcher types to the browser tests

* Tell knip @vitest/browser is used via tsconfig types

---------

Co-authored-by: David Langley <langley.dave@gmail.com>
2026-09-02 07:58:34 +00:00

9 lines
263 B
JSON

{
"extends": "./tsconfig.json",
"compilerOptions": {
"types": ["node", "modernizr", "@vitest/browser/matchers"]
},
"exclude": [],
"include": ["./src/**/*.test.browser.ts", "./src/@types/png.d.ts", "./src/@types/vitest-browser.d.ts"]
}