@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, 03:37 UTC

next
tsx 18 lines 1016 Bytes
Raw
1 import { expect, test } from 'bun:test';
2 import { readFileSync } from 'node:fs';
3 import { renderToStaticMarkup } from 'react-dom/server';
4 import { FaqSection } from '@/components/toolkits/faq-section';
5 import { parseToolkitFaq } from '@/lib/toolkit-faq';
6
7 test('closed toolkit FAQs retain setup instructions in server-rendered HTML', () => {
8 const faq = parseToolkitFaq(readFileSync('content/toolkits/faq/github.md', 'utf8'));
9 const html = renderToStaticMarkup(<FaqSection faq={faq} />);
10
11 expect(html).toContain('https://backend.composio.dev/api/v1/auth-apps/add');
12 expect(html).toContain('Register application');
13 expect(html).toContain('Organization access');
14 expect(html).toContain('<summary');
15 // A fragment inside the answer triggers native details ancestor revealing.
16 expect(html).toMatch(/<details><summary[^>]*>How do I set up custom OAuth credentials for GitHub\?<\/summary><div id="how-do-i-set-up-custom-oauth-credentials-for-github"/);
17 expect(html).not.toMatch(/<summary[^>]* id=/);
18 });