fix(mcp/ui): scope create-server e2e assertion to the new card grid

The MCP servers list moved from a DataTable to an MCPServerCard grid, so
the create-flow e2e test's `table tbody` lookup could never match and
e2e_ui_testing failed once the server landed in the list. Tag the grid
with a stable data-testid and assert against it, keeping the original
scoping that prevents the closing modal's server_name input from
satisfying the check early
This commit is contained in:
mateo-berri 2026-06-03 17:45:35 +00:00
parent 48e8f40150
commit ef341b82ed
No known key found for this signature in database
2 changed files with 7 additions and 4 deletions

View file

@ -50,13 +50,13 @@ test.describe("MCP Servers", () => {
// No teardown needed — the e2e runner spins up a fresh DB per invocation.
// Success toast and the new row in the table. Scope the row lookup to
// the MCP servers table so the form modal's `server_name` input — which
// Success toast and the new card in the server grid. Scope the lookup to
// the MCP servers grid so the form modal's `server_name` input — which
// still holds the timestamped value during its close animation — can't
// satisfy the assertion before the server actually lands in the list.
await expect(page.getByText("MCP Server created successfully").first())
.toBeVisible({ timeout: 15_000 });
await expect(page.locator("table tbody").getByText(uniqueName).first())
await expect(page.getByTestId("mcp-servers-grid").getByText(uniqueName).first())
.toBeVisible({ timeout: 10_000 });
});
});

View file

@ -578,7 +578,10 @@ const MCPServers: React.FC<MCPServerProps> = ({ accessToken, userRole, userID })
/>
</div>
) : (
<div className="grid auto-rows-fr grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3">
<div
data-testid="mcp-servers-grid"
className="grid auto-rows-fr grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3"
>
{displayedServers.map((server) => (
<MCPServerCard
key={server.server_id}