sokko-g/tests/toolbox-alert-visibility.test.mjs
Shinuwa 8253f74c90
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 23m40s
Validate and deploy Sokko G / deploy (push) Successful in 16s
Open any toolbox from a list in Sokko TCG's toolbox drawer
Every Sokko TCG section now offers the top bar's toolbox button. Instead of
linking a toolbox, the drawer lists all toolboxes (linked to a game or not)
as wide rows with a large cover, opens the one chosen, and remembers it on
the device. Memos and alerts follow the toolbox shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 14:31:53 +01:00

17 lines
872 B
JavaScript

// Rôle : vérifie que les alertes visibles suivent la vue toolbox réellement affichée.
import test from "node:test";
import assert from "node:assert/strict";
import { getVisibleToolboxIds } from "../website/src/hooks/useToolboxAlerts.js";
test("a mounted compact drawer is visible only while its toolbox view is selected", () => {
assert.deepEqual([...getVisibleToolboxIds("/games/mhwilds/monsters", "")], []);
assert.deepEqual([...getVisibleToolboxIds("/games/mhwilds/monsters", "linked")], ["linked"]);
});
test("the toolbox chosen in the Sokko TCG drawer is visible like a linked one", () => {
assert.deepEqual([...getVisibleToolboxIds("/cards/guild", "chosen")], ["chosen"]);
});
test("a full toolbox page remains visible independently of the game drawer", () => {
assert.deepEqual([...getVisibleToolboxIds("/toolbox/personal", "")], ["personal"]);
});