@devries-cameron20 / composio Mirror · read-only
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, 04:45 UTC

next
ts 69 lines 1.93 KB
Raw
1 /**
2 * Tool Router proxyExecute session option E2E test.
3 *
4 * Unit tests mock the transport, so they cannot tell whether the API accepts
5 * the proxy_execute block, stores it, or lists the COMPOSIO_PROXY_EXECUTE meta
6 * tool. This test sends the real requests.
7 *
8 * Project-agnostic: creates its own sessions and deletes them afterwards.
9 *
10 * Requires COMPOSIO_API_KEY in environment.
11 */
12
13 import { e2e, type E2ETestResult } from '@e2e-tests/utils';
14 import { describe, it, expect, beforeAll } from 'bun:test';
15
16 declare module 'bun' {
17 interface Env {
18 COMPOSIO_API_KEY: string;
19 }
20 }
21
22 e2e(import.meta.url, {
23 versions: { node: ['current'] },
24 usesFixtures: true,
25 env: {
26 COMPOSIO_API_KEY: Bun.env.COMPOSIO_API_KEY,
27 },
28 defineTests: ({ runFixture }) => {
29 let result: E2ETestResult;
30
31 beforeAll(async () => {
32 result = await runFixture({ filename: 'index.mjs' });
33 }, 180_000);
34
35 describe('proxyExecute session option', () => {
36 it('exits successfully', () => {
37 expect(result.exitCode).toBe(0);
38 });
39
40 it('create(true) stores the block and lists the meta tool', () => {
41 expect(result.stdout).toContain('CREATE_ON_OK');
42 });
43
44 it('update(false) stores the block and hides the meta tool', () => {
45 expect(result.stdout).toContain('UPDATE_OFF_OK');
46 });
47
48 it('update with the block form, then null removes it', () => {
49 expect(result.stdout).toContain('UPDATE_NULL_OK');
50 });
51
52 it('create() leaves the option unset', () => {
53 expect(result.stdout).toContain('DEFAULT_OK');
54 });
55
56 it('rejects false together with sandbox.enableProxyExecution', () => {
57 expect(result.stdout).toContain('CONFLICT_REJECTED_OK');
58 });
59
60 it('deletes the sessions', () => {
61 expect(result.stdout).toContain('DELETE_OK');
62 });
63
64 it('all operations complete', () => {
65 expect(result.stdout).toContain('ALL_OK');
66 });
67 });
68 },
69 });