项目文件夹

文件
wehub-resource-sync 070959e133
landing-page-staging / Deploy landing page to staging (push) Has been skipped
landing-page-ci / Validate landing page (push) Failing after 4s
visual-baseline / Capture visual baselines (push) Has been cancelled
bake-plugin-previews / Bake plugin previews (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:00:47 +08:00

39 行
1.9 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { getStaticComposioCatalogDefinitions } from '../src/connectors/composio.js';
import { COMPOSIO_TOOLKIT_METADATA } from '../src/connectors/composio-descriptions.js';
describe('composio catalog descriptions', () => {
it('replaces the generic placeholder description with curated copy for known toolkits', () => {
const catalog = getStaticComposioCatalogDefinitions();
// Slack and Linear are not in the hand-tuned FEATURED catalog, so they
// demonstrate that the curated metadata map drives their description.
const slackMetadata = COMPOSIO_TOOLKIT_METADATA.SLACK;
const linearMetadata = COMPOSIO_TOOLKIT_METADATA.LINEAR;
if (!slackMetadata || !linearMetadata) throw new Error('curated metadata missing fixtures');
const slack = catalog.find((c) => c.id === 'slack');
expect(slack?.description).toBe(slackMetadata.description);
const linear = catalog.find((c) => c.id === 'linear');
expect(linear?.description).toBe(linearMetadata.description);
});
it('falls back to a neutral description that does not echo the legacy "through Composio" phrasing', () => {
const catalog = getStaticComposioCatalogDefinitions();
for (const connector of catalog) {
// All descriptions should be set and must not use the old
// uninformative default.
expect(connector.description).toBeDefined();
expect(connector.description).not.toMatch(/^Connect to .* through Composio\.$/);
expect(connector.description).not.toMatch(/integration via Composio/i);
}
});
it('prefers the curated category over the generic "Composio" bucket', () => {
const catalog = getStaticComposioCatalogDefinitions();
const slack = catalog.find((c) => c.id === 'slack');
expect(slack?.category).toBe('Communication');
const linear = catalog.find((c) => c.id === 'linear');
expect(linear?.category).toBe('Project management');
});
});