// {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

import { afterAll, describe, expect, it } from 'vitest';

import { DEFAULT_API_VERSION } from '../../../src/core/config-schema.js';
import { closeStore, openStore } from '../../../src/data/store-repository.js';
import { getOperation } from '../../../src/tools/get-tool.js';

const store = openStore(DEFAULT_API_VERSION);
afterAll(() => closeStore(store));

describe('getOperation', () => {
{%- if operations | length > 0 %}
  it('returns the literal schema/path/method for a known operationId', async () => {
    const endpoint = await getOperation(store, '{{ operations.0.operation_id }}');
    expect(endpoint.operationId).toBe('{{ operations.0.operation_id }}');
    expect(endpoint.path).toBe('{{ operations.0.path }}');
    expect(endpoint.method).toBe('{{ operations.0.method }}');
  });
{%- endif %}

  it('throws for an unknown operationId', async () => {
    await expect(getOperation(store, 'does-not-exist')).rejects.toThrow();
  });
});
