@devries-cameron20 / composio Mirror · read-only / commits / 97b4de3dd
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 09:45 UTC

test(cli): cover interruption and not-found paths of the Effect client (#4879)

This PR: - builds on top of https://github.com/ComposioHQ/composio/pull/4853 and the two PRs stacked on it - adds `composio-client-interrupt.test.ts`: interrupting a connected-account listing, a Tool Router session creation and a tool execution aborts the in-flight `fetch` signal, which https://github.com/ComposioHQ/composio/pull/4853 claimed but only tested for the paginated catalog streams - makes the `TestLive` not-found shadows (`connectedAccounts.retrieve`/`delete`, `toolkits.retrieve`, `triggerInstances.upsert`, `patch`) fail with the client's `@composio/client/NotFoundError` instead of a plain `Error`, so a `catchTag` on those resources behaves under the test layer as in production - documents what the client shadows do not model (`signal`, `maxRetries`, headers beyond `decode`, `next_cursor` on account listings) and points at `stubComposioClient` for pagination, retries and abort - flattens the connected-account selection fixtures into explicit per-test pages and uses a single `it` import Verified locally: `pnpm typecheck`, the CLI suite (147 files, 1485 passed, 1 skipped), `oxlint` on `ts/packages/cli`, `validate:boundaries`.

Alberto Schiabel committed Oct 15, 2026 at 15:29 UTC 97b4de3ddd7f142d19a52118d85e1708991a2ee5
4 files changed +299 -84
ts/packages/cli/test/__utils__/services/stub-composio-client.ts
+6
@@ -59,6 +59,12 @@ export const stubComposioClient = (
59 * resources of every client it hands out for those of a client built by
60 * {@link stubComposioClient}. Calls to those resources go through the real
61 * client to `respond`; every other resource keeps the test layer's answers.
62 + *
63 + * The test layer's answers do not model request options (`signal`,
64 + * `maxRetries`, or any header beyond `decode`) and `connectedAccounts.list`
65 + * never returns a `next_cursor`, so pagination, retries, and abort are
66 + * exercised through {@link stubComposioClient}, the real `make` over a
67 + * recording transport.
68 */
69 export const stubClientResources = (
70 resources: ReadonlyArray<keyof ComposioClientShape>,
ts/packages/cli/test/__utils__/services/test-layer.ts
+26 -23
@@ -1111,18 +1111,18 @@ export const TestLayer = (input?: TestLiveInput) =>
1111 return response;
1112 },
1113 },
1114 - patch: async (path: string, options?: { body?: Record<string, unknown> }) => {
1114 + patch: (path: string, options?: { body?: Record<string, unknown> }) => {
1115 connectedAccountsData.onPatch?.({ path, body: options?.body });
1116
1117 const match = path.match(/^\/api\/v3\/connected_accounts\/([^/]+)$/);
1118 if (!match) {
1119 - throw new Error(`Unhandled PATCH path "${path}"`);
1119 + return Effect.die(new Error(`Unhandled PATCH path "${path}"`));
1120 }
1121
1122 const connectedAccountId = match[1];
1123 const account = connectedAccountsData.items.find(item => item.id === connectedAccountId);
1124 if (!account) {
1125 - throw new Error(`Connected account "${connectedAccountId}" not found`);
1125 + return Effect.fail(notFoundError(`Connected account "${connectedAccountId}" not found`));
1126 }
1127
1128 if (typeof options?.body?.alias === 'string') {
@@ -1131,7 +1131,7 @@ export const TestLayer = (input?: TestLiveInput) =>
1131 });
1132 }
1133
1134 - return account;
1134 + return Effect.succeed(account);
1135 },
1136 connectedAccounts: {
1137 list: async (params?: {
@@ -1166,20 +1166,19 @@ export const TestLayer = (input?: TestLiveInput) =>
1166 next_cursor: null,
1167 };
1168 },
1169 - retrieve: async (nanoid: string) => {
1169 + retrieve: (nanoid: string) => {
1170 const found = connectedAccountsData.items.find(item => item.id === nanoid);
1171 - if (!found) {
1172 - throw new Error(`Connected account "${nanoid}" not found`);
1173 - }
1174 - return found;
1171 + return found
1172 + ? Effect.succeed(found)
1173 + : Effect.fail(notFoundError(`Connected account "${nanoid}" not found`));
1174 },
1176 - delete: async (nanoid: string) => {
1175 + delete: (nanoid: string) => {
1176 const found = connectedAccountsData.items.find(item => item.id === nanoid);
1177 if (!found) {
1179 - throw new Error(`Connected account "${nanoid}" not found`);
1178 + return Effect.fail(notFoundError(`Connected account "${nanoid}" not found`));
1179 }
1180 connectedAccountsData.onDelete?.(nanoid);
1182 - return {};
1181 + return Effect.succeed({});
1182 },
1183 },
1184 triggersTypes: {
@@ -1193,7 +1192,7 @@ export const TestLayer = (input?: TestLiveInput) =>
1192 },
1193 },
1194 triggerInstances: {
1196 - upsert: async (
1195 + upsert: (
1196 triggerSlug: string,
1197 params?: {
1198 connected_account_id?: string;
@@ -1206,11 +1205,11 @@ export const TestLayer = (input?: TestLiveInput) =>
1205 trigger => trigger.slug.toUpperCase() === triggerSlug.toUpperCase()
1206 )
1207 ) {
1209 - throw new Error(`Trigger type "${triggerSlug}" not found`);
1208 + return Effect.fail(notFoundError(`Trigger type "${triggerSlug}" not found`));
1209 }
1211 - return {
1210 + return Effect.succeed({
1211 trigger_id: `trg_${triggerSlug.toLowerCase()}_${params?.connected_account_id ?? 'new'}`,
1213 - };
1212 + });
1213 },
1214 manage: {
1215 update: async (triggerId: string, params: { status: 'enable' | 'disable' }) => ({
@@ -1221,35 +1220,35 @@ export const TestLayer = (input?: TestLiveInput) =>
1220 },
1221 },
1222 toolkits: {
1224 - retrieve: async (slug: string) => {
1223 + retrieve: (slug: string) => {
1224 const detailed = toolkitsData.detailedToolkits.find(
1225 t => t.slug.toLowerCase() === slug.toLowerCase()
1226 );
1227 if (detailed) {
1229 - return {
1228 + return Effect.succeed({
1229 name: detailed.name,
1230 slug: detailed.slug,
1231 is_local_toolkit: detailed.is_local_toolkit,
1232 composio_managed_auth_schemes: [...detailed.composio_managed_auth_schemes],
1233 no_auth: detailed.no_auth,
1234 meta: detailed.meta,
1236 - };
1235 + });
1236 }
1237
1238 const found = toolkitsData.toolkits.find(
1239 t => t.slug.toLowerCase() === slug.toLowerCase()
1240 );
1241 if (!found) {
1243 - throw new Error(`Toolkit "${slug}" not found`);
1242 + return Effect.fail(notFoundError(`Toolkit "${slug}" not found`));
1243 }
1245 - return {
1244 + return Effect.succeed({
1245 name: found.name,
1246 slug: found.slug,
1247 is_local_toolkit: found.is_local_toolkit,
1248 composio_managed_auth_schemes: [...found.composio_managed_auth_schemes],
1249 no_auth: found.no_auth,
1250 meta: found.meta,
1252 - };
1251 + });
1252 },
1253 },
1254 files: {
@@ -1337,7 +1336,11 @@ export const TestLayer = (input?: TestLiveInput) =>
1336 operation.replace(/Stream$/, '') in composioSchemaLoaders;
1337
1338 // Each shadow answers with an Effect or a promise; a rejection becomes
1340 - // the call's failure as it is.
1339 + // the call's failure as it is. A shadow ignores the request options
1340 + // (`signal`, `maxRetries`, headers beyond `decode`), and the
1341 + // `connectedAccounts.list` shadow never pages (`next_cursor` is null):
1342 + // pagination, retries, and abort are covered by `stubComposioClient`,
1343 + // the real `make` over a recording transport.
1344 const withShadows = <Resources extends object>(
1345 base: Resources,
1346 shadows: object,
ts/packages/cli/test/src/services/composio-client-interrupt.test.ts new
+179
@@ -0,0 +1,179 @@
1 +import { afterEach, describe, expect, it } from '@effect/vitest';
2 +import { vi } from 'vitest';
3 +import * as BunFileSystem from '@effect/platform-bun/BunFileSystem';
4 +import * as BunPath from '@effect/platform-bun/BunPath';
5 +import { ConfigProvider, Effect, Fiber, Layer } from 'effect';
6 +import * as tempy from 'tempy';
7 +import { createToolRouterSessionContext } from 'src/effects/create-tool-router-session';
8 +import { ComposioCliUserConfigLive } from 'src/services/cli-user-config';
9 +import { ComposioClientSingleton, ComposioToolkitsRepository } from 'src/services/composio-clients';
10 +import { defaultNodeOs, NodeOs } from 'src/services/node-os';
11 +import { NodeProcess } from 'src/services/node-process';
12 +import { cliDebugFlagsLayer } from 'src/services/runtime-flags';
13 +import { ToolkitSlugCatalog } from 'src/services/toolkit-slug-catalog';
14 +import { ToolsExecutor, ToolsExecutorLive } from 'src/services/tools-executor';
15 +import { ComposioUserContextLive } from 'src/services/user-context';
16 +import { clearInProcessMemos } from 'src/utils/memoize-in-process';
17 +import { TerminalUITest } from 'test/__utils__/services/terminal-ui-test';
18 +
19 +// Exercise real user-context/config resolution without opening the OS credential store.
20 +vi.mock('@composio/cli-keyring/effect', async importOriginal => {
21 + const actual = await importOriginal<typeof import('@composio/cli-keyring/effect')>();
22 + const { Effect, Layer } = await import('effect');
23 + const { KeyringError } = await import('@composio/cli-keyring');
24 + return {
25 + ...actual,
26 + KeyringLiveWithBackend: () =>
27 + Layer.succeed(actual.KeyringService, {
28 + getPassword: () => Effect.fail(new KeyringError({ kind: 'NoEntry' })),
29 + getSecret: () => Effect.fail(new KeyringError({ kind: 'NoEntry' })),
30 + setPassword: () => Effect.die(new Error('Unexpected credential write')),
31 + setSecret: () => Effect.die(new Error('Unexpected credential write')),
32 + deleteCredential: () => Effect.die(new Error('Unexpected credential deletion')),
33 + isAvailable: Effect.succeed(true),
34 + }),
35 + };
36 +});
37 +
38 +const BASE_URL = 'https://backend.composio.dev';
39 +
40 +const platformLayer = () =>
41 + Layer.mergeAll(
42 + BunFileSystem.layer,
43 + BunPath.layer,
44 + Layer.succeed(NodeOs, defaultNodeOs({ homedir: tempy.temporaryDirectory() })),
45 + Layer.succeed(
46 + ConfigProvider.ConfigProvider,
47 + ConfigProvider.fromEnv({
48 + env: { COMPOSIO_USER_API_KEY: 'uak_config', COMPOSIO_BASE_URL: BASE_URL },
49 + })
50 + )
51 + );
52 +
53 +const withRepository = () => Layer.provide(ComposioToolkitsRepository.Default, platformLayer());
54 +
55 +// The real executor over the real client singleton, plus every service that
56 +// `execute` and session creation require, with the credential store mocked above.
57 +const withExecutor = () => {
58 + const platform = platformLayer();
59 + const singleton = Layer.provide(ComposioClientSingleton.Default, platform);
60 + const repository = Layer.provide(ComposioToolkitsRepository.Default, platform);
61 + const catalog = Layer.provide(ToolkitSlugCatalog.Default, Layer.mergeAll(repository, platform));
62 + return Layer.mergeAll(
63 + Layer.provide(ToolsExecutorLive, Layer.mergeAll(singleton, catalog)),
64 + singleton,
65 + repository,
66 + platform,
67 + NodeProcess.Default,
68 + Layer.provide(ComposioUserContextLive, platform),
69 + Layer.provide(ComposioCliUserConfigLive, Layer.mergeAll(platform, NodeProcess.Default)),
70 + TerminalUITest,
71 + cliDebugFlagsLayer()
72 + );
73 +};
74 +
75 +const jsonResponse = (body: unknown) =>
76 + new Response(JSON.stringify(body), {
77 + status: 200,
78 + headers: { 'Content-Type': 'application/json' },
79 + });
80 +
81 +/**
82 + * A `fetch` answer that never settles on its own: it hands out the request's
83 + * `AbortSignal` and rejects only once that signal fires. Pair it with
84 + * `mockImplementationOnce` so one chosen request hangs.
85 + */
86 +const pendingRequest = () => {
87 + const started = Promise.withResolvers<AbortSignal>();
88 + const respond = (_input: string | URL | Request, init?: RequestInit) => {
89 + const signal = init!.signal!;
90 + started.resolve(signal);
91 + return new Promise<Response>((_resolve, reject) => {
92 + signal.addEventListener('abort', () => reject(signal.reason), { once: true });
93 + });
94 + };
95 + return { respond, signal: Effect.promise(() => started.promise) };
96 +};
97 +
98 +const requestUrl = (call: readonly unknown[] | undefined) => new URL(String(call?.[0]));
99 +
100 +describe('interrupting a single-shot client request', () => {
101 + afterEach(() => {
102 + vi.restoreAllMocks();
103 + clearInProcessMemos();
104 + });
105 +
106 + it.effect('connectedAccounts.list aborts the in-flight request', () =>
107 + Effect.gen(function* () {
108 + const pending = pendingRequest();
109 + const fetchSpy = vi.spyOn(globalThis, 'fetch').mockImplementationOnce(pending.respond);
110 + const repository = yield* ComposioToolkitsRepository;
111 +
112 + const fiber = yield* Effect.forkChild(
113 + repository.listConnectedAccounts({ user_ids: ['default'], statuses: ['ACTIVE'] })
114 + );
115 + const requestSignal = yield* pending.signal;
116 + expect(requestSignal.aborted).toBe(false);
117 +
118 + yield* Fiber.interrupt(fiber);
119 +
120 + expect(requestSignal.aborted).toBe(true);
121 + expect(fetchSpy).toHaveBeenCalledTimes(1);
122 + expect(requestUrl(fetchSpy.mock.calls[0]).pathname).toBe('/api/v3.1/connected_accounts');
123 + }).pipe(Effect.provide(withRepository()))
124 + );
125 +
126 + it.effect('tool router session creation aborts the in-flight create request', () =>
127 + Effect.gen(function* () {
128 + const pending = pendingRequest();
129 + const fetchSpy = vi
130 + .spyOn(globalThis, 'fetch')
131 + // The connection context the session is built from.
132 + .mockResolvedValueOnce(jsonResponse({ items: [] }))
133 + .mockImplementationOnce(pending.respond);
134 + const client = yield* Effect.flatMap(ComposioClientSingleton, singleton => singleton.get());
135 +
136 + const fiber = yield* Effect.forkChild(createToolRouterSessionContext(client, 'default'));
137 + const requestSignal = yield* pending.signal;
138 + expect(requestSignal.aborted).toBe(false);
139 +
140 + yield* Fiber.interrupt(fiber);
141 +
142 + expect(requestSignal.aborted).toBe(true);
143 + expect(fetchSpy).toHaveBeenCalledTimes(2);
144 + expect(requestUrl(fetchSpy.mock.calls[1]).pathname).toBe('/api/v3.1/tool_router/session');
145 + }).pipe(Effect.provide(withExecutor()))
146 + );
147 +
148 + it.effect('a tool execution aborts the in-flight execute request', () =>
149 + Effect.gen(function* () {
150 + const pending = pendingRequest();
151 + const fetchSpy = vi
152 + .spyOn(globalThis, 'fetch')
153 + // The connection context, then the session the execution runs in.
154 + .mockResolvedValueOnce(jsonResponse({ items: [] }))
155 + .mockResolvedValueOnce(jsonResponse({ session_id: 'trs_interrupted' }))
156 + .mockImplementationOnce(pending.respond);
157 + const executor = yield* ToolsExecutor;
158 +
159 + // A meta tool: its execution needs no toolkit lookup and no input
160 + // schema, so the hanging request is the execution itself.
161 + const fiber = yield* Effect.forkChild(
162 + executor.execute('COMPOSIO_SEARCH_TOOLS', {
163 + userId: 'default',
164 + arguments: { queries: [{ use_case: 'send an email' }] },
165 + })
166 + );
167 + const requestSignal = yield* pending.signal;
168 + expect(requestSignal.aborted).toBe(false);
169 +
170 + yield* Fiber.interrupt(fiber);
171 +
172 + expect(requestSignal.aborted).toBe(true);
173 + expect(fetchSpy).toHaveBeenCalledTimes(3);
174 + expect(requestUrl(fetchSpy.mock.calls[2]).pathname).toBe(
175 + '/api/v3.1/tool_router/session/trs_interrupted/execute_meta'
176 + );
177 + }).pipe(Effect.provide(withExecutor()))
178 + );
179 +});
ts/packages/cli/test/src/services/connected-account-selection.test.ts
+88 -61
@@ -1,5 +1,5 @@
1 -import { describe, expect, it } from 'vitest';
2 -import { it as effectIt } from '@effect/vitest';
1 +import assert from 'node:assert/strict';
2 +import { describe, expect, it } from '@effect/vitest';
3 import { Effect, Option } from 'effect';
4 import {
5 ConnectedAccountResolutionError,
@@ -102,74 +102,99 @@ describe('connected-account-selection', () => {
102 });
103 });
104
105 -type ListParams = {
106 - readonly toolkit_slugs?: ReadonlyArray<string>;
107 - readonly limit?: number;
108 -};
109 -
110 -// The client over a transport that serves one page of accounts, plus a log of
111 -// every `GET /connected_accounts` query so a test can see which path ran.
112 -const makeListClient = (
105 +// One `GET /connected_accounts` page as the server sends it.
106 +const page = (
107 items: ReadonlyArray<ConnectedAccountItem>,
114 - page?: { readonly total_items?: number; readonly next_cursor?: string | null }
115 -) => {
116 - const calls: ListParams[] = [];
117 - const { client } = stubComposioClient(request => {
118 - const query = new URL(request.path, 'https://stub.invalid').searchParams;
119 - const slugs = query.get('toolkit_slugs')?.split(',');
120 - const limit = Number(query.get('limit') ?? 30);
121 - calls.push({ ...(slugs ? { toolkit_slugs: slugs } : {}), limit });
122 - const filtered = slugs
123 - ? items.filter(item =>
124 - slugs.some(slug => slug.trim().toLowerCase() === item.toolkit.slug.trim().toLowerCase())
125 - )
126 - : items;
127 - return Response.json({
128 - items: filtered.slice(0, limit),
129 - total_items: page?.total_items ?? filtered.length,
130 - total_pages: 1,
131 - current_page: 1,
132 - next_cursor: page?.next_cursor ?? null,
133 - });
108 + counts: { readonly total_items: number; readonly next_cursor: string | null } = {
109 + total_items: items.length,
110 + next_cursor: null,
111 + }
112 +) =>
113 + Response.json({
114 + items,
115 + total_items: counts.total_items,
116 + total_pages: 1,
117 + current_page: 1,
118 + next_cursor: counts.next_cursor,
119 });
135 - return { client, calls };
120 +
121 +// A transport that answers each request with the next page, in order.
122 +const pagesInOrder = (...pages: ReadonlyArray<Response>) => {
123 + const queue = [...pages];
124 + return () => {
125 + const next = queue.shift();
126 + assert.ok(next, 'more requests than pages');
127 + return next;
128 + };
129 };
130
131 +const toolkitSlugsQuery = (path: string) =>
132 + new URL(path, 'https://stub.invalid').searchParams.get('toolkit_slugs');
133 +
134 describe('listConnectedAccountsForToolkit', () => {
139 - effectIt.effect('matches toolkit slugs the way the grouping helpers do, on both paths', () =>
135 + it.effect('matches toolkit slugs the way the grouping helpers do, from the shared list', () =>
136 Effect.gen(function* () {
141 - const items = [
142 - makeAccount({ id: 'con_github', toolkit: { slug: 'GitHub ' } }),
143 - makeAccount({ id: 'con_gmail', toolkit: { slug: 'gmail' } }),
144 - ];
145 -
146 - const derived = makeListClient(items);
147 - const fromSharedList = yield* listConnectedAccountsForToolkit({
148 - client: derived.client,
137 + const { client, requests } = stubComposioClient(
138 + pagesInOrder(
139 + page([
140 + makeAccount({ id: 'con_github', toolkit: { slug: 'GitHub ' } }),
141 + makeAccount({ id: 'con_gmail', toolkit: { slug: 'gmail' } }),
142 + ])
143 + )
144 + );
145 +
146 + const accounts = yield* listConnectedAccountsForToolkit({
147 + client,
148 userId: 'default',
149 toolkitSlug: ' github',
150 });
152 - expect(fromSharedList.map(item => item.id)).toEqual(['con_github']);
153 - expect(derived.calls).toHaveLength(1);
151
155 - const fallback = makeListClient(items, { next_cursor: 'more' });
156 - const fromServer = yield* listConnectedAccountsForToolkit({
157 - client: fallback.client,
152 + expect(accounts.map(item => item.id)).toEqual(['con_github']);
153 + expect(requests).toHaveLength(1);
154 + expect(toolkitSlugsQuery(requests[0]!.path)).toBeNull();
155 + })
156 + );
157 +
158 + it.effect('matches toolkit slugs the way the grouping helpers do, on the filtered request', () =>
159 + Effect.gen(function* () {
160 + // A shared list that pages is incomplete, so the filtered request runs
161 + // and its answer is taken as is.
162 + const { client, requests } = stubComposioClient(
163 + pagesInOrder(
164 + page(
165 + [
166 + makeAccount({ id: 'con_github', toolkit: { slug: 'GitHub ' } }),
167 + makeAccount({ id: 'con_gmail', toolkit: { slug: 'gmail' } }),
168 + ],
169 + { total_items: 2, next_cursor: 'more' }
170 + ),
171 + page([makeAccount({ id: 'con_github', toolkit: { slug: 'GitHub ' } })])
172 + )
173 + );
174 +
175 + const accounts = yield* listConnectedAccountsForToolkit({
176 + client,
177 userId: 'default',
178 toolkitSlug: ' github',
179 });
161 - expect(fromServer.map(item => item.id)).toEqual(['con_github']);
162 - expect(fallback.calls[1]?.toolkit_slugs).toEqual(['github']);
180 +
181 + expect(accounts.map(item => item.id)).toEqual(['con_github']);
182 + expect(requests).toHaveLength(2);
183 + expect(toolkitSlugsQuery(requests[1]!.path)).toBe('github');
184 })
185 );
186
166 - effectIt.effect('derives from a short page even when total_items counts more', () =>
187 + it.effect('derives from a short page even when total_items counts more', () =>
188 Effect.gen(function* () {
189 // A server that reports the all-status count must not push every call
190 // onto the filtered request.
170 - const { client, calls } = makeListClient(
171 - [makeAccount({ id: 'con_gmail', toolkit: { slug: 'gmail' } })],
172 - { total_items: 7 }
191 + const { client, requests } = stubComposioClient(
192 + pagesInOrder(
193 + page([makeAccount({ id: 'con_gmail', toolkit: { slug: 'gmail' } })], {
194 + total_items: 7,
195 + next_cursor: null,
196 + })
197 + )
198 );
199
200 const accounts = yield* listConnectedAccountsForToolkit({
@@ -179,19 +204,21 @@ describe('listConnectedAccountsForToolkit', () => {
204 });
205
206 expect(accounts.map(item => item.id)).toEqual(['con_gmail']);
182 - expect(calls).toHaveLength(1);
207 + expect(requests).toHaveLength(1);
208 })
209 );
210
186 - effectIt.effect('falls back to the filtered request when the shared page is full', () =>
211 + it.effect('falls back to the filtered request when the shared page is full', () =>
212 Effect.gen(function* () {
188 - const items = Array.from({ length: 1000 }, (_, index) =>
213 + const fullPage = Array.from({ length: 1000 }, (_, index) =>
214 makeAccount({ id: `con_slack_${index}`, toolkit: { slug: 'slack' } })
215 );
191 - const { client, calls } = makeListClient([
192 - ...items,
193 - makeAccount({ id: 'con_gmail', toolkit: { slug: 'gmail' } }),
194 - ]);
216 + const { client, requests } = stubComposioClient(
217 + pagesInOrder(
218 + page(fullPage, { total_items: 1001, next_cursor: null }),
219 + page([makeAccount({ id: 'con_gmail', toolkit: { slug: 'gmail' } })])
220 + )
221 + );
222
223 const accounts = yield* listConnectedAccountsForToolkit({
224 client,
@@ -200,14 +227,14 @@ describe('listConnectedAccountsForToolkit', () => {
227 });
228
229 expect(accounts.map(item => item.id)).toEqual(['con_gmail']);
203 - expect(calls).toHaveLength(2);
204 - expect(calls[1]?.toolkit_slugs).toEqual(['gmail']);
230 + expect(requests).toHaveLength(2);
231 + expect(toolkitSlugsQuery(requests[1]!.path)).toBe('gmail');
232 })
233 );
234 });
235
236 describe('resolveConnectedAccountForToolkit', () => {
210 - effectIt.effect('reports a rejected account listing in the wording it has always used', () =>
237 + it.effect('reports a rejected account listing in the wording it has always used', () =>
238 Effect.gen(function* () {
239 const body = {
240 error: { message: 'Invalid user id', code: 301, slug: 'Invalid_UserId', status: 400 },