fix(web): lecteur CBZ/CBR mode vertical — crash React contenu par error boundary avec actions de récupération (régression #37)

This commit is contained in:
Git Agent
2026-08-24 16:19:52 +02:00
parent c31d76a2a9
commit b5ec6a8e97
2 changed files with 137 additions and 37 deletions

View File

@ -0,0 +1,20 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
describe("ReaderPage crash containment", () => {
it("keeps a reader shell or fallback mounted when the CBZ vertical reader crashes", () => {
const source = readFileSync(new URL("./ReaderPage.tsx", import.meta.url), "utf8");
expect(source).toContain("<ReaderShell");
expect(source).toMatch(/Reader(ErrorBoundary|CrashBoundary)|componentDidCatch|fallbackRender|onError/);
});
it("keeps explicit recovery actions in the reader crash fallback", () => {
const source = readFileSync(new URL("./ReaderPage.tsx", import.meta.url), "utf8");
expect(source).toContain("Le lecteur a rencontré une erreur.");
expect(source).toContain("Réessayer");
expect(source).toContain("Revenir au mode page par page");
expect(source).toContain("Retour à la fiche");
});
});