import 'reflect-metadata';
import { Test } from '@nestjs/testing';
import { describe, expect, it } from 'vitest';
import { CoordModule } from './coord.module.js';
import { InteractionCoordinationService } from './interaction-coordination.service.js';
import { AuthGuard } from '../auth/auth.guard.js';

describe('CoordModule DI (compiled-metadata boot)', () => {
  it('resolves InteractionCoordinationService through Nest DI', async () => {
    const moduleRef = await Test.createTestingModule({ imports: [CoordModule] })
      .overrideGuard(AuthGuard)
      .useValue({ canActivate: (): boolean => true })
      .compile();
    expect(moduleRef.get(InteractionCoordinationService)).toBeInstanceOf(
      InteractionCoordinationService,
    );
    await moduleRef.close();
  });
});
