chore(frontend): tighten eslint/axe gates, remove reader waivers (B5 done, spec ② complete)
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { expect, test, type APIRequestContext } from "@playwright/test";
|
||||
import { adminApi, creds, ensureBook, FIXTURE_TXT } from "./helpers/api";
|
||||
import { adminApiRetry, creds, ensureBook, FIXTURE_TXT } from "./helpers/api";
|
||||
import { scanA11y } from "./helpers/axe";
|
||||
|
||||
let admin: APIRequestContext;
|
||||
let bookId: number;
|
||||
|
||||
test.beforeAll(async () => {
|
||||
admin = await adminApi();
|
||||
admin = await adminApiRetry();
|
||||
// 文件名避免与 CBZ 样本书同名:fixture 用 e2e-sample-txt.txt(title=e2e-sample-txt)
|
||||
bookId = await ensureBook(admin, "e2e", "e2e-sample-txt.txt", FIXTURE_TXT);
|
||||
});
|
||||
@@ -46,6 +46,17 @@ test("登录 → txt 阅读 → 全书搜索 → 跳转", async ({ page }) => {
|
||||
|
||||
await scanA11y(page, "reader-chrome");
|
||||
|
||||
// 设置面板冒烟:字号/行距即时生效 + 主题卡联动阅读面(data-rd 受控)
|
||||
const pre = page.locator(".rd-surface pre");
|
||||
await expect(pre).toHaveCSS("font-size", "20px");
|
||||
await page.getByRole("button", { name: "更多阅读设置" }).click();
|
||||
await page.getByRole("button", { name: "加大字号" }).click();
|
||||
await expect(pre).toHaveCSS("font-size", "22px");
|
||||
await page.getByRole("button", { name: "1.8", exact: true }).click();
|
||||
await expect(pre).toHaveAttribute("style", /line-height: 1\.8/);
|
||||
await page.getByRole("button", { name: "夜色主题" }).click();
|
||||
await expect(page.locator(".rd-surface").first()).toHaveAttribute("data-rd", "night");
|
||||
|
||||
// 退出
|
||||
await page.getByRole("link", { name: "书架" }).click();
|
||||
await expect(page).toHaveURL(/\/$/);
|
||||
|
||||
Reference in New Issue
Block a user