fix: viewer PDF (TOC, largeur) et plein ecran assistant (BUG-061 a BUG-063)
CI / lint (push) Successful in 1m36s
CI / security (push) Successful in 1m11s
CI / test (push) Successful in 3m33s
CI / build (push) Successful in 1m2s
CI / e2e (push) Successful in 11m23s

This commit is contained in:
2026-09-17 20:45:38 -04:00
parent 2e2a33cef3
commit f7e068baed
16 changed files with 309 additions and 21 deletions
+23
View File
@@ -786,6 +786,29 @@ async function main() {
panel.remove();
});
// ── 10b. Fullscreen toggle must beat the persisted inline width ──
await test("fullscreen button toggles the panel and CSS lifts the inline width", async () => {
const { readFileSync } = await import("node:fs");
const css = readFileSync(path.resolve(JS_DIR, "..", "style.css"), "utf-8");
assert.match(
css,
/\.bookslm-panel\.fullscreen\s*\{\s*width:\s*100vw\s*!important;/,
"the fullscreen width must override the inline width written by the resize handle",
);
const b = new BooksLM();
const panel = b._render();
document.body.appendChild(panel);
const btn = panel.querySelector(".bookslm-btn-fullscreen");
btn.click();
assert.ok(panel.classList.contains("fullscreen"), "fullscreen class added on first click");
assert.equal(b._isFullscreen, true);
btn.click();
assert.ok(!panel.classList.contains("fullscreen"), "fullscreen class removed on second click");
assert.equal(b._isFullscreen, false);
panel.remove();
});
// ── 11. Formatted markdown rendering ──
await test("_renderMarkdown renders headings, lists, code and tables", () => {
const b = new BooksLM();