Release EPUB Tools 0.2.0
Verify / verify (push) Canceled after 0s

This commit is contained in:
2026-09-02 08:53:49 +02:00
parent f68dcfe4ea
commit efd80eb18a
41 changed files with 3250 additions and 614 deletions
+36 -2
View File
@@ -1,4 +1,4 @@
import { render, screen } from "@testing-library/react";
import { fireEvent, render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { App } from "../../src/App";
@@ -13,7 +13,41 @@ describe("EPUB Tools", () => {
await screen.findByRole("heading", { name: "EPUB Tools" }),
).toBeVisible();
expect(
await screen.findByText("Sandboxed reader · local files"),
await screen.findByText("Sandboxed reader · local files", undefined, {
timeout: 4_000,
}),
).toBeVisible();
});
it("shows the selected filename and progress before archive work starts", async () => {
vi.stubGlobal(
"fetch",
vi.fn(async () => new Response("Not found", { status: 404 })),
);
vi.stubGlobal(
"requestAnimationFrame",
vi.fn(() => 1),
);
render(<App />);
const input = await screen.findByLabelText(
"Choose publication",
undefined,
{ timeout: 4_000 },
);
fireEvent.change(input, {
target: {
files: [
new File(["not read yet"], "large-publication.epub", {
type: "application/epub+zip",
}),
],
},
});
const status = await screen.findByRole("status");
expect(status).toHaveTextContent("large-publication.epub");
expect(status).toHaveTextContent("Preparing the local file");
expect(
screen.getByRole("progressbar", { name: "EPUB opening progress" }),
).toHaveValue(0);
});
});