import { Test, TestingModule } from '@nestjs/testing';
import { StateService } from './state.service';
import {getModelToken} from "@nestjs/mongoose";
import {State} from "../schemas/state.schema";
import {Model} from "mongoose";
import {EventBus} from "@nestjs/cqrs";
import {EventbusMock} from "../mocks/eventbus.mock";

describe('StateService', () => {
  let service: StateService;

  beforeEach(async () => {
    const module: TestingModule = await Test.createTestingModule({
      providers: [
        StateService,
        { provide: getModelToken(State.name), useValue: Model },
        { provide: EventBus, useValue: EventbusMock },
      ],
    }).compile();

    service = module.get<StateService>(StateService);
  });

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