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, 06:00 UTC
| 1 | # Tool Router Pagination E2E Test |
| 2 | |
| 3 | End-to-end regression test for `session.toolkits()` cursor pagination. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | - Docker (for running tests in containers) |
| 8 | - `COMPOSIO_API_KEY` environment variable (any Composio project works) |
| 9 | |
| 10 | ## Running |
| 11 | |
| 12 | ```bash |
| 13 | # From repo root |
| 14 | COMPOSIO_API_KEY=your_key pnpm test:e2e:node --filter=@e2e-tests/node-tool-router-pagination |
| 15 | |
| 16 | # Or from this directory |
| 17 | COMPOSIO_API_KEY=your_key bun test e2e.test.ts |
| 18 | ``` |
| 19 | |
| 20 | ## What it tests |
| 21 | |
| 22 | Regression coverage for [PLEN-1886](https://linear.app/composio/issue/PLEN-1886): `session.toolkits()` was silently dropping the `cursor` input and always returning page 1. |
| 23 | |
| 24 | 1. **Page 1** – Call `session.toolkits({ limit: 2 })` against the global toolkit catalog |
| 25 | 2. **Cursor returned** – Assert the response includes a `cursor` (catalog has > 2 toolkits on any project) |
| 26 | 3. **Page 2** – Call `session.toolkits({ limit: 2, cursor })` with the returned cursor |
| 27 | 4. **Advancement** – Assert page 2 slugs do not overlap page 1 slugs |
| 28 | |
| 29 | If the cursor is silently stripped, page 2 would equal page 1 and the overlap assertion fails. |