fixed test issues
This commit is contained in:
@@ -408,7 +408,11 @@ describe('FriendsService', () => {
|
||||
expect(mockPrismaService.friendship.findMany).toHaveBeenCalledWith({
|
||||
where: { userId: 'user-1' },
|
||||
include: {
|
||||
friend: true,
|
||||
friend: {
|
||||
include: {
|
||||
activeDoll: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
orderBy: {
|
||||
createdAt: 'desc',
|
||||
|
||||
@@ -5,6 +5,7 @@ import { NotFoundException, ForbiddenException } from '@nestjs/common';
|
||||
import { User } from '@prisma/client';
|
||||
import { UpdateUserDto } from './dto/update-user.dto';
|
||||
import { PrismaClientKnownRequestError } from '@prisma/client/runtime/client';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
|
||||
describe('UsersService', () => {
|
||||
let service: UsersService;
|
||||
@@ -34,6 +35,10 @@ describe('UsersService', () => {
|
||||
},
|
||||
};
|
||||
|
||||
const mockEventEmitter = {
|
||||
emit: jest.fn(),
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [
|
||||
@@ -42,6 +47,10 @@ describe('UsersService', () => {
|
||||
provide: PrismaService,
|
||||
useValue: mockPrismaService,
|
||||
},
|
||||
{
|
||||
provide: EventEmitter2,
|
||||
useValue: mockEventEmitter,
|
||||
},
|
||||
],
|
||||
}).compile();
|
||||
|
||||
|
||||
@@ -276,6 +276,8 @@ describe('StateGateway', () => {
|
||||
const mockClient: MockSocket = {
|
||||
id: 'client1',
|
||||
data: {}, // Missing user data
|
||||
handshake: {},
|
||||
emit: jest.fn(),
|
||||
disconnect: jest.fn(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user