History

Correct MCP consent fixture and async test readiness

Rhys Sullivan committed 1 month ago

Commit 5c18fde1 parent 41a4d2d1 file · +9 −1Browse files

Unified · Split

e2e/scenarios/connection-setup-ux.test.ts+9−1
@@ -267,6 +267,7 @@ scenario( · 266 unmodified lines
267 await step("Add a connection with both a token and a registered sign-in app", async () => {267 await step("Add a connection with both a token and a registered sign-in app", async () => {
268 await visit(page, `/integrations/${slug}?addAccount=1`);268 await visit(page, `/integrations/${slug}?addAccount=1`);
269 await page.getByRole("tab", { name: "OAuth2", exact: true }).waitFor();269 await page.getByRole("tab", { name: "OAuth2", exact: true }).waitFor();
270 await page.getByRole("tab", { name: "OAuth2", exact: true, selected: true }).waitFor();
270 expect(271 expect(
271 await page272 await page
272 .getByRole("tab", { name: "OAuth2", exact: true })273 .getByRole("tab", { name: "OAuth2", exact: true })
@@ -339,7 +340,7 @@ for (const origin of ["integration", "workspace"] as const) { · 66 unmodified lines
339 yield* client.oauth340 yield* client.oauth
340 .removeClient({ params: { slug: app }, payload: { owner: "org" } })341 .removeClient({ params: { slug: app }, payload: { owner: "org" } })
341 .pipe(Effect.ignore);342 .pipe(Effect.ignore);
342 }),343 }).pipe(Effect.ignore),
343 );344 );
344 yield* client.mcp.addServer({345 yield* client.mcp.addServer({
345 payload: {346 payload: {
@@ -385,6 +386,13 @@ for (const origin of ["integration", "workspace"] as const) { · 39 unmodified lines
385 .pages()386 .pages()
386 .find((candidate) => candidate !== page);387 .find((candidate) => candidate !== page);
387 if (!popup) throw new Error("Provider sign-in window was not open");388 if (!popup) throw new Error("Provider sign-in window was not open");
389 // The published MCP consent form omits its selected user's login.
390 // Keep the real provider exchange; forward the identity clicked below.
391 await popup.route(`${base}/authorize/approve`, (route) => {
392 const body = new URLSearchParams(route.request().postData() ?? "");
393 body.set("login", "admin");
394 return route.continue({ postData: body.toString() });
395 });
388 await popup.getByRole("button", { name: /admin/ }).click();396 await popup.getByRole("button", { name: /admin/ }).click();
389 await page397 await page
390 .getByRole("heading", { name: /Add connection/ })398 .getByRole("heading", { name: /Add connection/ })