test(fe): cover the palette's content, AltGr, the banner's name, share colours, playlist headers

- AppCommandPalette had no test: modules gated by the account, hidden channels left out, the
  playlist row selecting before it navigates, and the surprise riding setPage's `then`.
- keymap: an Alt/AltGr-modified key (Ctrl+Alt on Windows, a constant on the HU layout) fires no
  bare-key or Mod row.
- Banner: the dismiss button falls back to "Close" rather than going unnamed.
- ShareDialog: a protected link's lit lock and Revoke's danger colour stay on the icon.
- Both playlist headers are rendered now: the YouTube one needed the toolbar slot it portals into.
  Meta line sums known runtimes and treats an ABSENT duration as nothing (null never exercised the
  guard: `3000 + null` is 3000); a one-row list offers no view controls.
This commit is contained in:
2026-09-19 17:23:55 +02:00
parent cedcbb1434
commit dc902d2c0e
6 changed files with 374 additions and 1 deletions
+7
View File
@@ -33,6 +33,13 @@ describe("matches", () => {
expect(matches(press({ key: "ArrowLeft", shiftKey: true }), "ArrowLeft")).toBe(false);
});
// AltGr is a constant-use key on this user's HU layout (@, [, ], {, }, \ all sit behind it), and on
// Windows it arrives as Ctrl+Alt. Typing one of those must never fire a bare-key row or a Mod row.
it("rejects an Alt- or AltGr-modified key, even when its Ctrl half would match Mod", () => {
expect(matches(press({ key: "a", altKey: true }), "a")).toBe(false);
expect(matches(press({ key: "k", ctrlKey: true, altKey: true }), "Mod+k")).toBe(false);
});
it("treats Mod as Ctrl or Cmd", () => {
expect(matches(press({ key: "k", ctrlKey: true }), "Mod+k")).toBe(true);
expect(matches(press({ key: "k", metaKey: true }), "Mod+k")).toBe(true);