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:
20
apps/web/src/pages/ReaderPageCrash.test.ts
Normal file
20
apps/web/src/pages/ReaderPageCrash.test.ts
Normal 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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user