test: fix test cases

This commit is contained in:
mirarifhasan
2024-05-21 20:27:51 +06:00
parent 5f52acacc0
commit c371b56a23
2 changed files with 6 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ import { ShortcodeService } from 'src/shortcode/shortcode.service';
import { ConfigService } from '@nestjs/config'; import { ConfigService } from '@nestjs/config';
import { OffsetPaginationArgs } from 'src/types/input-types.args'; import { OffsetPaginationArgs } from 'src/types/input-types.args';
import * as E from 'fp-ts/Either'; import * as E from 'fp-ts/Either';
import { EventEmitter2 } from '@nestjs/event-emitter';
const mockPrisma = mockDeep<PrismaService>(); const mockPrisma = mockDeep<PrismaService>();
const mockPubSub = mockDeep<PubSubService>(); const mockPubSub = mockDeep<PubSubService>();
@@ -34,6 +35,7 @@ const mockTeamCollectionService = mockDeep<TeamCollectionService>();
const mockMailerService = mockDeep<MailerService>(); const mockMailerService = mockDeep<MailerService>();
const mockShortcodeService = mockDeep<ShortcodeService>(); const mockShortcodeService = mockDeep<ShortcodeService>();
const mockConfigService = mockDeep<ConfigService>(); const mockConfigService = mockDeep<ConfigService>();
const mockEventEmitter = mockDeep<EventEmitter2>();
const adminService = new AdminService( const adminService = new AdminService(
mockUserService, mockUserService,
@@ -44,9 +46,9 @@ const adminService = new AdminService(
mockTeamInvitationService, mockTeamInvitationService,
mockPubSub as any, mockPubSub as any,
mockPrisma as any, mockPrisma as any,
mockMailerService,
mockShortcodeService, mockShortcodeService,
mockConfigService, mockConfigService,
mockEventEmitter,
); );
const invitedUsers: InvitedUsers[] = [ const invitedUsers: InvitedUsers[] = [

View File

@@ -23,6 +23,7 @@ import * as argon2 from 'argon2';
import * as E from 'fp-ts/Either'; import * as E from 'fp-ts/Either';
import { ConfigService } from '@nestjs/config'; import { ConfigService } from '@nestjs/config';
import { InfraConfigService } from 'src/infra-config/infra-config.service'; import { InfraConfigService } from 'src/infra-config/infra-config.service';
import { EventEmitter2 } from '@nestjs/event-emitter';
const mockPrisma = mockDeep<PrismaService>(); const mockPrisma = mockDeep<PrismaService>();
const mockUser = mockDeep<UserService>(); const mockUser = mockDeep<UserService>();
@@ -30,6 +31,7 @@ const mockJWT = mockDeep<JwtService>();
const mockMailer = mockDeep<MailerService>(); const mockMailer = mockDeep<MailerService>();
const mockConfigService = mockDeep<ConfigService>(); const mockConfigService = mockDeep<ConfigService>();
const mockInfraConfigService = mockDeep<InfraConfigService>(); const mockInfraConfigService = mockDeep<InfraConfigService>();
const mockEventEmitter = mockDeep<EventEmitter2>();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
@@ -37,9 +39,9 @@ const authService = new AuthService(
mockUser, mockUser,
mockPrisma, mockPrisma,
mockJWT, mockJWT,
mockMailer,
mockConfigService, mockConfigService,
mockInfraConfigService, mockInfraConfigService,
mockEventEmitter,
); );
const currentTime = new Date(); const currentTime = new Date();