Exercise document directory at its canonical entry in UI regression tests

This commit is contained in:
2026-10-30 18:07:21 +08:00
parent cfc6686904
commit 33405b7d8b
@@ -100,11 +100,11 @@ test(
const page = await context.newPage();
page.setDefaultTimeout(10000);
page.on("pageerror", (error) => errors.push(error.message));
await page.goto(base!, { waitUntil: "networkidle" });
await page.goto(base + "/documents", { waitUntil: "networkidle" });
await page
.getByRole("heading", { name: authored.title, exact: true })
.waitFor();
assert.equal(await page.title(), "探索文档 · 织页");
assert.equal(await page.title(), "社区文档 · 织页");
const search = page.getByRole("textbox", { name: "搜索文档" });
await search.fill("不存在的文档");
await search.press("Enter");
@@ -248,7 +248,7 @@ test(
"通过 XML 更新的文档",
);
await page.setViewportSize({ width: 390, height: 844 });
await page.goto(base!, { waitUntil: "networkidle" });
await page.goto(base + "/documents", { waitUntil: "networkidle" });
assert.equal(
await page.evaluate(
() => document.documentElement.scrollWidth <= window.innerWidth,