import { Test, TestingModule } from '@nestjs/testing';
import { CardsService } from './cards.service';
import {ConfigService} from "@nestjs/config";
import {ConfigServiceMock} from "../mocks/config-service.mock";
import {getModelToken} from "@nestjs/mongoose";
import {Card} from "../schemas/cards.schema";
import {Model} from "mongoose";
import {EventBus} from "@nestjs/cqrs";
import {EventbusMock} from "../mocks/eventbus.mock";

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

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

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

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