/**
 * Credential Templates Tests
 */

import { describe, it, expect, vi, beforeEach } from 'vitest';
import { registerTemplateRoutes } from './templates';
import type { FastifyInstance } from 'fastify';

vi.mock('@the-order/database');
vi.mock('@the-order/shared');

describe('Credential Templates', () => {
  let server: FastifyInstance;

  beforeEach(() => {
    server = {
      post: vi.fn(),
      get: vi.fn(),
      patch: vi.fn(),
    } as any;
    vi.clearAllMocks();
  });

  describe('registerTemplateRoutes', () => {
    it('should register template routes', async () => {
      await registerTemplateRoutes(server);

      expect(server.post).toHaveBeenCalled();
      expect(server.get).toHaveBeenCalled();
      expect(server.patch).toHaveBeenCalled();
    });
  });
});

