test: de-flake ViewHeader connect/disconnect animation assertion (#1699)
The server name and Disconnect button are removed by two independent Mantine Transition exits. The test waitFor'd the server-name removal, then did a synchronous queryByRole check for the button — on a slow runner the button's exit lags the name's, so it was still in the DOM at the check. Wrap the button "removed" assertion in its own waitFor. Part 2 of #1699 (TUI OAuth step-up) was already fixed in PR #1742 via POLL_TRIES=100. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNdjEPKLG637X8YmhDiEk5
This commit is contained in:
parent
40aaf47705
commit
444701c59b
1 changed files with 9 additions and 3 deletions
|
|
@ -355,12 +355,18 @@ describe("ViewHeader", () => {
|
||||||
?.getAttribute("data-anim"),
|
?.getAttribute("data-anim"),
|
||||||
).toBe("out");
|
).toBe("out");
|
||||||
|
|
||||||
|
// The server name and the Disconnect button are removed by two
|
||||||
|
// independent Transition exits; on a slow runner the button's exit can
|
||||||
|
// lag the name's, so each "removed" assertion gets its own waitFor rather
|
||||||
|
// than assuming the two transitions complete in lockstep (#1699).
|
||||||
await waitFor(() =>
|
await waitFor(() =>
|
||||||
expect(screen.queryByText("my-mcp-server")).not.toBeInTheDocument(),
|
expect(screen.queryByText("my-mcp-server")).not.toBeInTheDocument(),
|
||||||
);
|
);
|
||||||
|
await waitFor(() =>
|
||||||
expect(
|
expect(
|
||||||
screen.queryByRole("button", { name: "Disconnect from server" }),
|
screen.queryByRole("button", { name: "Disconnect from server" }),
|
||||||
).not.toBeInTheDocument();
|
).not.toBeInTheDocument(),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("renders the dark-scheme icon/logo branch under a dark color scheme", () => {
|
it("renders the dark-scheme icon/logo branch under a dark color scheme", () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue