fix(workspace): clear native package and navigation readiness gates

This commit is contained in:
cesnimda
2026-10-07 00:30:10 +02:00
parent fadf99a3f5
commit acd1d94684
36 changed files with 1551 additions and 40 deletions
@@ -319,3 +319,41 @@ test("uses recorded dates in the summary and keeps absent dates unknown", async
expect(within(summary).getAllByText("—")).toHaveLength(2);
expect(screen.queryByRole("link", { name: "Open original advert" })).not.toBeInTheDocument();
});
test("section changes retain follow-up query context and expose the selected labelled panel", async () => {
renderTable("/jobs/42?section=communication&followMode=waiting-update");
await screen.findByRole("heading", { name: "Backend Developer" });
fireEvent.click(screen.getByRole("tab", { name: "Analysis" }));
expect(await screen.findByRole("tabpanel", { name: "Analysis" })).toHaveTextContent("Match section");
expect(screen.getByTestId("location")).toHaveTextContent("/jobs/42?section=analysis&followMode=waiting-update");
const tab = screen.getByRole("tab", { name: "Analysis" });
expect(document.getElementById(tab.getAttribute("aria-controls")!)).toBe(screen.getByRole("tabpanel", { name: "Analysis" }));
});
test("accordion controls identify exactly one labelled content region", async () => {
renderTable("/jobs/42");
await screen.findByRole("heading", { name: "Backend Developer" });
const trigger = screen.getByRole("button", { name: "Documents" });
fireEvent.click(trigger);
const target = trigger.getAttribute("aria-controls")!;
expect(document.querySelectorAll(`[id='${target}']`)).toHaveLength(1);
expect(document.getElementById(target)).toHaveAttribute("role", "region");
expect(document.getElementById(target)).toHaveAttribute("aria-labelledby", trigger.id);
});
test("legacy document links reveal their existing content and focus the disclosure", async () => {
renderTable("/jobs/42?section=documents");
const trigger = await screen.findByRole("button", { name: "Documents" });
await waitFor(() => expect(trigger).toHaveAttribute("aria-expanded", "true"));
expect(trigger).toHaveFocus();
expect(screen.getByRole("region", { name: "Documents" })).toHaveTextContent("Documents section");
});
test("the missing-profile next task opens the existing canonical profile entry", async () => {
mockedApi.get.mockResolvedValue({ data: { ...overview, nextStep: { key: "complete-career-profile", label: "Complete your career profile", reason: "Canonical data", section: "checklist" } } } as any);
renderTable("/jobs/42");
fireEvent.click(await screen.findByRole("button", { name: "Complete your career profile" }));
await waitFor(() => expect(screen.getByTestId("location")).toHaveTextContent("/career?section=profile"));
expect(mockedApi.post).not.toHaveBeenCalled();
expect(mockedApi.put).not.toHaveBeenCalled();
});