Files
ReadaBook/apps/web/src/pages/ReaderPageCrash.test.ts

21 lines
883 B
TypeScript

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");
});
});