sokko-g/tests/toolbox-alert-visibility.test.mjs
Shinuwa 22b397ebfa Document Sokko G's architecture and folders, and move JavaScript file headers to JSDoc @file blocks
Add ARCHITECTURE.md (layers, flows, folder map, glossary), CONTRIBUTING.md
(setup and step-by-step recipes) and a README in each main folder, with an
index of docs/. Convert the 511 JavaScript headers from "// Rôle :" lines to
JSDoc @file blocks, define a three-level header template in website/AGENTS.md
and check the header in tests/file-headers.test.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:42:13 +01:00

20 lines
879 B
JavaScript

/**
* @file 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"]);
});