test(frontend): cover Pixel Office navigation and shared version metadata

This commit is contained in:
Haozhe Wu committed 2026-10-13 16:01:48 +08:00
1 parent 3eb667a93f
commit 4ea48d5478
2 files changed
+5 -3

No files matched your search

@@ -17,7 +17,7 @@ it("keeps every feature directly reachable and distinguishes tasks from tools an
expect(within(screen.getByRole("region", { name: "Specialized analysis" })).getAllByRole("link").map((link) => link.getAttribute("href")))
.toEqual(["/alpha-zoo", "/options", "/correlation"]);
expect(within(screen.getByRole("region", { name: "Automation & setup" })).getAllByRole("link").map((link) => link.getAttribute("href")))
.toEqual(["/scheduled", "/runtime", "/settings"]);
.toEqual(["/pixel-office", "/scheduled", "/runtime", "/settings"]);
expect(screen.getByRole("link", { name: "Research assistant" })).toHaveAttribute("aria-current", "page");
});
@@ -52,8 +52,9 @@ it("opens a labeled feature menu in compact mode and returns focus on Escape", (
fireEvent.click(trigger);
const menu = screen.getByRole("navigation", { name: "Browse features" });
expect(within(menu).getByText("Options analysis")).toBeVisible();
expect(within(menu).getByText("Pixel Office")).toBeVisible();
expect(within(menu).getByText("Trading status")).toBeVisible();
expect(within(menu).getAllByRole("link")).toHaveLength(9);
expect(within(menu).getAllByRole("link")).toHaveLength(10);
fireEvent.keyDown(document, { key: "Escape" });
expect(screen.queryByRole("navigation", { name: "Browse features" })).not.toBeInTheDocument();
expect(trigger).toHaveFocus();
+2 -1
View File
@@ -185,7 +185,8 @@ describe("new locale content", () => {
]);
const copied = Object.entries(collectStrings(locales.tr)).filter(([key, value]) => {
const prose = value.replace(/\{\{.*?\}\}/g, "");
return value === enStrings[key] && /[A-Za-z]/.test(prose) && !sharedTerms.has(value);
// The release version is shared metadata, checked against pyproject by the backend suite.
return key !== "app.version" && value === enStrings[key] && /[A-Za-z]/.test(prose) && !sharedTerms.has(value);
}).map(([key]) => key);
expect(copied).toEqual([]);
});