// agents/company-enricher/agent.test.ts
import { describe, it, expect } from 'vitest';
import { TestConductor } from '@ensemble-edge/conductor/testing';
describe('company-enricher agent', () => {
it('should enrich company data', async () => {
const conductor = await TestConductor.create();
await conductor.loadProject('./');
const result = await conductor.executeAgent('company-enricher', {
company_name: 'Anthropic',
include_news: false
});
expect(result).toBeSuccessful();
expect(result.output.company_data).toHaveProperty('name');
expect(result.output.company_data).toHaveProperty('description');
expect(result.output.company_data).toHaveProperty('industry');
});
it('should include news when requested', async () => {
const conductor = await TestConductor.create();
await conductor.loadProject('./');
const result = await conductor.executeAgent('company-enricher', {
company_name: 'Anthropic',
include_news: true
});
expect(result).toBeSuccessful();
expect(result.output.news).toBeDefined();
});
it('should cache search results', async () => {
const conductor = await TestConductor.create();
await conductor.loadProject('./');
// First call
const result1 = await conductor.executeAgent('company-enricher', {
company_name: 'Anthropic'
});
// Second call (should use cache)
const result2 = await conductor.executeAgent('company-enricher', {
company_name: 'Anthropic'
});
expect(result1.operations.search.cached).toBe(false);
expect(result2.operations.search.cached).toBe(true);
});
});