Skip to content

Commit 8626a1d

Browse files
committed
style(web): format MCP catalog tests (CL-8662)
1 parent 12d7cc1 commit 8626a1d

2 files changed

Lines changed: 22 additions & 13 deletions

File tree

‎apps/web/src/mcp-servers.test.ts‎

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,15 @@ type StoredRow = {
5252
readonly id: string;
5353
readonly name: string;
5454
readonly providerId: string;
55-
readonly metadata: { readonly mcp: { readonly handle: string; readonly name: string; readonly url: string; readonly auth: string; readonly tools: readonly never[] } };
55+
readonly metadata: {
56+
readonly mcp: {
57+
readonly handle: string;
58+
readonly name: string;
59+
readonly url: string;
60+
readonly auth: string;
61+
readonly tools: readonly never[];
62+
};
63+
};
5664
};
5765

5866
function exaRow(credentialId: string, providerId: string): StoredRow {
@@ -116,7 +124,8 @@ function workspaceCatalogFetch(opts: {
116124
const method = init?.method ?? "GET";
117125
calls.push({ method, path });
118126

119-
if (path === `/api/tenants/${WORKBENCH_ID}`) return tenantDetailResponse(WORKBENCH_ID, WORKSPACE_ID);
127+
if (path === `/api/tenants/${WORKBENCH_ID}`)
128+
return tenantDetailResponse(WORKBENCH_ID, WORKSPACE_ID);
120129
if (path === `/api/tenants/${WORKSPACE_ID}`) return tenantDetailResponse(WORKSPACE_ID, null);
121130
if (path === `/api/tenants/${WORKBENCH_ID}/providers` && method === "GET") {
122131
return Response.json({
@@ -188,7 +197,10 @@ function workspaceCatalogFetch(opts: {
188197
try {
189198
const parsed = JSON.parse(patchText) as { metadata?: StoredRow["metadata"] };
190199
if (parsed.metadata !== undefined) {
191-
workspaceCredentials.splice(workspaceCredentials.indexOf(row), 1, { ...row, metadata: parsed.metadata });
200+
workspaceCredentials.splice(workspaceCredentials.indexOf(row), 1, {
201+
...row,
202+
metadata: parsed.metadata,
203+
});
192204
}
193205
} catch {
194206
// Keep the placeholder row; discovery recorded nothing new.
@@ -253,9 +265,9 @@ describe("ensureBuiltInMcpServers", () => {
253265
expect(servers.map((server) => server.handle)).toContain(EXA_MCP_SERVER.handle);
254266
// No re-add: the workspace already carries Exa, so the workbench twin is
255267
// just dropped.
256-
expect(
257-
calls.some((call) => call.method === "POST" && call.path.endsWith("/credentials")),
258-
).toBe(false);
268+
expect(calls.some((call) => call.method === "POST" && call.path.endsWith("/credentials"))).toBe(
269+
false,
270+
);
259271
expect(
260272
calls.some(
261273
(call) =>
@@ -272,9 +284,7 @@ describe("ensureBuiltInMcpServers", () => {
272284
});
273285
await ensureBuiltInMcpServers(WORKBENCH_ID, fetchImpl);
274286
expect(
275-
calls.some(
276-
(call) => call.method === "DELETE" && call.path.includes("/credentials/c-linear"),
277-
),
287+
calls.some((call) => call.method === "DELETE" && call.path.includes("/credentials/c-linear")),
278288
).toBe(false);
279289
});
280290

@@ -301,7 +311,8 @@ describe("ensureBuiltInMcpServers", () => {
301311
expect(second.map((server) => server.handle)).toContain(EXA_MCP_SERVER.handle);
302312
expect(
303313
calls.filter(
304-
(call) => call.method === "POST" && call.path === `/api/tenants/${WORKSPACE_ID}/credentials`,
314+
(call) =>
315+
call.method === "POST" && call.path === `/api/tenants/${WORKSPACE_ID}/credentials`,
305316
),
306317
).toHaveLength(1);
307318
});

‎apps/web/src/tools/mcp-servers-query.test.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ describe("describeRedeployResult", () => {
8080
expect(
8181
describeRedeployResult({
8282
redeployed: 1,
83-
failed: [
84-
{ tenantId: "wb-a", workbenchName: "Alpha", error: "Something went wrong." },
85-
],
83+
failed: [{ tenantId: "wb-a", workbenchName: "Alpha", error: "Something went wrong." }],
8684
}),
8785
).toBe(
8886
"Myra redeployed in 1 workbench, but the redeploy failed in Alpha — " +

0 commit comments

Comments
 (0)