import { Test, TestingModule } from '@nestjs/testing';
import { StateController } from './state.controller';
import {State} from "../schemas/state.schema";
import {StateService} from "./state.service";
import {StateServiceMock} from "../mocks/state-service.mock";
import {SharedService} from "../shared/shared.service";
import {SharedServiceMock} from "../mocks/shared-service.mock";
import {EventBus} from "@nestjs/cqrs";
import {EventbusMock} from "../mocks/eventbus.mock";
import {ClientProxyMock} from "../mocks/client-proxy.mock";

describe('StateController', () => {
  let controller: StateController;

  beforeEach(async () => {
    const module: TestingModule = await Test.createTestingModule({
      controllers: [StateController],
      providers: [
        { provide: StateService, useValue: StateServiceMock },
        { provide: SharedService, useValue: SharedServiceMock },
        { provide: EventBus, useValue: EventbusMock },
        { provide: 'Telegram', useValue: ClientProxyMock },
      ]
    }).compile();

    controller = module.get<StateController>(StateController);
  });

  it('should be defined', () => {
    expect(controller).toBeDefined();
  });
});
