import { Test, TestingModule } from '@nestjs/testing';
import { PolicyController } from './PolicyController';
import { PolicyModule } from './PolicyModule';
import { PolicyService } from './PolicyService';
import { FeatureAvailabilityGuard } from './FeatureAvailabilityGuard';

describe('PolicyModule', () => {
  let module: TestingModule;

  beforeEach(async () => {
    module = await Test.createTestingModule({
      imports: [PolicyModule],
    }).compile();
  });

  it('should compile the module', () => {
    expect(module).toBeDefined();
  });

  it('should provide PolicyController', () => {
    const controller = module.get<PolicyController>(PolicyController);
    expect(controller).toBeDefined();
    expect(controller).toBeInstanceOf(PolicyController);
  });

  it('should provide PolicyService', () => {
    const service = module.get<PolicyService>(PolicyService);
    expect(service).toBeDefined();
    expect(service).toBeInstanceOf(PolicyService);
  });

  it('should provide FeatureAvailabilityGuard', () => {
    const guard = module.get<FeatureAvailabilityGuard>(FeatureAvailabilityGuard);
    expect(guard).toBeDefined();
    expect(guard).toBeInstanceOf(FeatureAvailabilityGuard);
  });
});
