Merge pull request #1764 from modelcontextprotocol/v2/fix-1699-flaky-viewheader-animation

test: de-flake ViewHeader connect/disconnect animation assertion (#1699)
This commit is contained in:
Cliff Hall 2026-07-24 16:17:45 -04:00 • committed by GitHub
commit d76c4d5379
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -355,12 +355,18 @@ describe("ViewHeader", () => {
?.getAttribute("data-anim"),
).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(() =>
expect(screen.queryByText("my-mcp-server")).not.toBeInTheDocument(),
);
expect(
screen.queryByRole("button", { name: "Disconnect from server" }),
).not.toBeInTheDocument();
await waitFor(() =>
expect(
screen.queryByRole("button", { name: "Disconnect from server" }),
).not.toBeInTheDocument(),
);
});
it("renders the dark-scheme icon/logo branch under a dark color scheme", () => {