From 2dd297c62cd1bef95a1d3021b85bec522e5a8a59 Mon Sep 17 00:00:00 2001 From: Michael Suchacz <203725896+ibetitsmike@users.noreply.github.com> Date: Wed, 26 Aug 2026 23:38:23 +0200 Subject: [PATCH] fix(site/src/testHelpers): point MCP server ACL msw handlers at v2 paths (#28659) ~~test-js is failing on main~~ Main is fixed: #28657 landed the same `api.test.ts` expectation update, so this PR no longer unbreaks anything and is not urgent. What remains here is the other half of the original fix: `site/src/testHelpers/handlers.ts` still registers the MCP server ACL GET/PATCH msw handlers at `/api/experimental/...`, but since #28498 the client calls `/api/v2/...`, so those handlers can never intercept a request. Any future test or story that exercises the ACL endpoints through the shared msw handlers would hit an unhandled-request error instead of the mock. This points them at the v2 paths the client actually uses. Validation: `pnpm exec vitest run --project=unit src/api/api.test.ts` passes 43/43 on this branch (merged with current main). > Xum acted on Mike's behalf. (cherry picked from commit 78d0571452004a5738d44cc27f7b0d7d8e29893e) --- site/src/testHelpers/handlers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/src/testHelpers/handlers.ts b/site/src/testHelpers/handlers.ts index 5a076d1ada0..207840e6893 100644 --- a/site/src/testHelpers/handlers.ts +++ b/site/src/testHelpers/handlers.ts @@ -87,11 +87,11 @@ export const handlers = [ () => HttpResponse.json(M.MockMCPServerConfigACLAvailable), ), http.get( - "/api/experimental/organizations/:organizationId/mcp-servers/:serverId/acl", + "/api/v2/organizations/:organizationId/mcp-servers/:serverId/acl", () => HttpResponse.json(M.MockMCPServerConfigACL), ), http.patch( - "/api/experimental/organizations/:organizationId/mcp-servers/:serverId/acl", + "/api/v2/organizations/:organizationId/mcp-servers/:serverId/acl", () => new HttpResponse(null, { status: 204 }), ),