@@ -12,16 +12,16 @@ import { CreateSpacePrismaDto } from './dto/create-space.dto';
12
12
import { UpdateSpacePrismaDto } from './dto/update-space.dto' ;
13
13
import { PrismaService } from '../prisma/prisma.service' ;
14
14
import { ProfileSpaceService } from '../profile-space/profile-space.service' ;
15
- import { UsersService } from '../users/users.service' ;
16
15
import { UploadService } from '../upload/upload.service' ;
16
+ import { ProfilesService } from '../profiles/profiles.service' ;
17
17
18
18
describe ( 'SpacesService' , ( ) => {
19
19
let spacesService : SpacesService ;
20
20
let prisma : PrismaService ;
21
21
let configService : ConfigService ;
22
22
let profileSpaceService : ProfileSpaceService ;
23
- let usersService : UsersService ;
24
23
let uploadService : UploadService ;
24
+ let profilesService : ProfilesService ;
25
25
26
26
beforeEach ( async ( ) => {
27
27
const module : TestingModule = await Test . createTestingModule ( {
@@ -45,7 +45,7 @@ describe('SpacesService', () => {
45
45
} ,
46
46
} ,
47
47
{
48
- provide : UsersService ,
48
+ provide : ProfilesService ,
49
49
useValue : { verifyUserProfile : jest . fn ( async ( ) => true ) } ,
50
50
} ,
51
51
{
@@ -59,8 +59,8 @@ describe('SpacesService', () => {
59
59
prisma = module . get < PrismaService > ( PrismaService ) ;
60
60
configService = module . get < ConfigService > ( ConfigService ) ;
61
61
profileSpaceService = module . get < ProfileSpaceService > ( ProfileSpaceService ) ;
62
- usersService = module . get < UsersService > ( UsersService ) ;
63
62
uploadService = module . get < UploadService > ( UploadService ) ;
63
+ profilesService = module . get < ProfilesService > ( ProfilesService ) ;
64
64
} ) ;
65
65
66
66
describe ( 'findSpace' , ( ) => {
@@ -85,7 +85,7 @@ describe('SpacesService', () => {
85
85
} ) ;
86
86
87
87
it ( 'profile user not own' , async ( ) => {
88
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
88
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
89
89
new ForbiddenException ( ) ,
90
90
) ;
91
91
@@ -128,7 +128,7 @@ describe('SpacesService', () => {
128
128
} ) ;
129
129
130
130
it ( 'profile not found' , async ( ) => {
131
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
131
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
132
132
new NotFoundException ( ) ,
133
133
) ;
134
134
@@ -185,7 +185,7 @@ describe('SpacesService', () => {
185
185
name : 'new space name' ,
186
186
} as CreateSpacePrismaDto ;
187
187
188
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
188
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
189
189
new NotFoundException ( ) ,
190
190
) ;
191
191
@@ -206,7 +206,7 @@ describe('SpacesService', () => {
206
206
name : 'new space name' ,
207
207
} as CreateSpacePrismaDto ;
208
208
209
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
209
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
210
210
new ForbiddenException ( ) ,
211
211
) ;
212
212
@@ -328,7 +328,7 @@ describe('SpacesService', () => {
328
328
it ( 'profile user not own' , async ( ) => {
329
329
const updateSpaceDto = { name : 'new space name' } as UpdateSpacePrismaDto ;
330
330
331
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
331
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
332
332
new ForbiddenException ( ) ,
333
333
) ;
334
334
@@ -368,7 +368,7 @@ describe('SpacesService', () => {
368
368
it ( 'profile not found' , async ( ) => {
369
369
const updateSpaceDto = { name : 'new space name' } as UpdateSpacePrismaDto ;
370
370
371
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
371
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
372
372
new NotFoundException ( ) ,
373
373
) ;
374
374
@@ -426,7 +426,7 @@ describe('SpacesService', () => {
426
426
} ) ;
427
427
428
428
it ( 'profile not found' , async ( ) => {
429
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
429
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
430
430
new NotFoundException ( ) ,
431
431
) ;
432
432
@@ -436,7 +436,7 @@ describe('SpacesService', () => {
436
436
} ) ;
437
437
438
438
it ( 'profile user not own' , async ( ) => {
439
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
439
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
440
440
new ForbiddenException ( ) ,
441
441
) ;
442
442
@@ -511,7 +511,7 @@ describe('SpacesService', () => {
511
511
} ) ;
512
512
513
513
it ( 'profile not found' , async ( ) => {
514
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
514
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
515
515
new NotFoundException ( ) ,
516
516
) ;
517
517
@@ -521,7 +521,7 @@ describe('SpacesService', () => {
521
521
} ) ;
522
522
523
523
it ( 'profile user not own' , async ( ) => {
524
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
524
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
525
525
new ForbiddenException ( ) ,
526
526
) ;
527
527
@@ -550,7 +550,7 @@ describe('SpacesService', () => {
550
550
const spaceUuid = 'space uuid' ;
551
551
552
552
it ( 'profile not found' , async ( ) => {
553
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
553
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
554
554
new NotFoundException ( ) ,
555
555
) ;
556
556
@@ -564,7 +564,7 @@ describe('SpacesService', () => {
564
564
} ) ;
565
565
566
566
it ( 'profile user not own' , async ( ) => {
567
- ( usersService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
567
+ ( profilesService . verifyUserProfile as jest . Mock ) . mockRejectedValue (
568
568
new ForbiddenException ( ) ,
569
569
) ;
570
570
0 commit comments