import { HealthController } from './health.controller';

describe('HealthController', () => {
  it('returns runtime version metadata from the health service', () => {
    const service = {
      getVersion: jest.fn().mockReturnValue({
        service: 'server',
        version: 'commit-456',
        buildTime: '2026-07-06T14:00:00.000Z',
        imageTag: 'ghcr.io/acme/ftb/server:commit-456',
      }),
    };

    const result = new HealthController(service as any).getVersion();

    expect(result.version).toBe('commit-456');
    expect(service.getVersion).toHaveBeenCalledTimes(1);
  });
});
