import { describe, expect, it } from 'vitest';
import { createWebSearchTools } from './index.js';

describe('createWebSearchTools', () => {
  it('registers web + news search tools for Brave provider', () => {
    const tools = createWebSearchTools({
      provider: 'brave',
      apiKey: 'test-key',
    });

    expect(tools.map((tool) => tool.name)).toEqual(['web.search', 'web.search.news']);
  });

  it('registers only web.search for SearXNG provider', () => {
    const tools = createWebSearchTools({
      provider: 'searxng',
      endpoint: 'http://searxng:8080',
    });

    expect(tools.map((tool) => tool.name)).toEqual(['web.search']);
  });
});
