@@ -50,10 +50,9 @@ describe('QueuesService', () => {
50
50
} ) ;
51
51
52
52
const queueDto : CreateQueueDto = {
53
- creatorId : user . id ,
54
53
labId : 'lab1' ,
55
54
} ;
56
- const queue = await queuesService . createQueue ( queueDto ) ;
55
+ const queue = await queuesService . createQueue ( queueDto , user . id ) ;
57
56
58
57
expect ( queue ) . toHaveProperty ( 'id' ) ;
59
58
expect ( queue . creatorId ) . toBe ( user . id ) ;
@@ -74,10 +73,7 @@ describe('QueuesService', () => {
74
73
} ,
75
74
} ) ;
76
75
77
- const queue = await queuesService . createQueue ( {
78
- creatorId : user . id ,
79
- labId : 'lab2' ,
80
- } ) ;
76
+ const queue = await queuesService . createQueue ( { labId : 'lab2' } , user . id ) ;
81
77
82
78
const foundQueue = await queuesService . findQueueById ( queue . id ) ;
83
79
@@ -110,10 +106,7 @@ describe('QueuesService', () => {
110
106
} ,
111
107
} as unknown as Request ;
112
108
113
- const queue = await queuesService . createQueue ( {
114
- creatorId : admin . id ,
115
- labId : 'lab3' ,
116
- } ) ;
109
+ const queue = await queuesService . createQueue ( { labId : 'lab3' } , admin . id ) ;
117
110
118
111
const deletedQueue = await queuesService . deleteQueueById ( queue . id , req ) ;
119
112
expect ( deletedQueue ) . toStrictEqual ( queue ) ;
@@ -137,10 +130,7 @@ describe('QueuesService', () => {
137
130
} ,
138
131
} as unknown as Request ;
139
132
140
- const queue = await queuesService . createQueue ( {
141
- creatorId : creator . id ,
142
- labId : 'lab4' ,
143
- } ) ;
133
+ const queue = await queuesService . createQueue ( { labId : 'lab4' } , creator . id ) ;
144
134
145
135
const deletedQueue = await queuesService . deleteQueueById ( queue . id , req ) ;
146
136
expect ( deletedQueue ) . toStrictEqual ( queue ) ;
@@ -175,10 +165,7 @@ describe('QueuesService', () => {
175
165
} ,
176
166
} as unknown as Request ;
177
167
178
- const queue = await queuesService . createQueue ( {
179
- creatorId : creator . id ,
180
- labId : 'lab5' ,
181
- } ) ;
168
+ const queue = await queuesService . createQueue ( { labId : 'lab5' } , creator . id ) ;
182
169
183
170
await expect ( queuesService . deleteQueueById ( queue . id , req ) ) . rejects . toThrow ( ForbiddenException ) ;
184
171
} ) ;
@@ -204,10 +191,9 @@ describe('QueuesService', () => {
204
191
} as unknown as Request ;
205
192
206
193
const queue = await queuesService . createQueue ( {
207
- creatorId : user . id ,
208
194
labId : 'lab6' ,
209
195
status : 'PENDING' ,
210
- } ) ;
196
+ } , user . id ) ;
211
197
212
198
const joinedQueue = await queuesService . joinQueue ( queue . id , req ) ;
213
199
expect ( joinedQueue ) . toStrictEqual (
@@ -239,10 +225,9 @@ describe('QueuesService', () => {
239
225
} as unknown as Request ;
240
226
241
227
const queue = await queuesService . createQueue ( {
242
- creatorId : user . id ,
243
228
labId : 'lab7' ,
244
229
status : 'SKIPPED' ,
245
- } ) ;
230
+ } , user . id ) ;
246
231
247
232
await expect ( queuesService . joinQueue ( queue . id , req ) ) . rejects . toThrow ( ForbiddenException ) ;
248
233
} ) ;
@@ -266,10 +251,9 @@ describe('QueuesService', () => {
266
251
} as unknown as Request ;
267
252
268
253
const queue = await queuesService . createQueue ( {
269
- creatorId : user . id ,
270
254
labId : 'lab8' ,
271
255
status : 'PENDING' ,
272
- } ) ;
256
+ } , user . id ) ;
273
257
274
258
await queuesService . joinQueue ( queue . id , req ) ;
275
259
await expect ( queuesService . joinQueue ( queue . id , req ) ) . rejects . toThrow ( ConflictException ) ;
@@ -295,10 +279,7 @@ describe('QueuesService', () => {
295
279
} ,
296
280
} as unknown as Request ;
297
281
298
- const queue = await queuesService . createQueue ( {
299
- creatorId : user . id ,
300
- labId : 'lab9' ,
301
- } ) ;
282
+ const queue = await queuesService . createQueue ( { labId : 'lab9' } , user . id ) ;
302
283
303
284
await queuesService . joinQueue ( queue . id , req ) ;
304
285
@@ -331,10 +312,7 @@ describe('QueuesService', () => {
331
312
} ,
332
313
} as unknown as Request ;
333
314
334
- const queue = await queuesService . createQueue ( {
335
- creatorId : user . id ,
336
- labId : 'lab10' ,
337
- } ) ;
315
+ const queue = await queuesService . createQueue ( { labId : 'lab10' } , user . id ) ;
338
316
339
317
await expect ( queuesService . leaveQueue ( queue . id , req ) ) . rejects . toThrow ( NotFoundException ) ;
340
318
} ) ;
@@ -370,10 +348,7 @@ describe('QueuesService', () => {
370
348
} ,
371
349
} as unknown as Request ;
372
350
373
- const queue = await queuesService . createQueue ( {
374
- creatorId : user . id ,
375
- labId : 'lab11' ,
376
- } ) ;
351
+ const queue = await queuesService . createQueue ( { labId : 'lab11' } , user . id ) ;
377
352
378
353
await queuesService . joinQueue ( queue . id , {
379
354
user : {
@@ -421,10 +396,7 @@ describe('QueuesService', () => {
421
396
} ,
422
397
} as unknown as Request ;
423
398
424
- const queue = await queuesService . createQueue ( {
425
- creatorId : user . id ,
426
- labId : 'lab12' ,
427
- } ) ;
399
+ const queue = await queuesService . createQueue ( { labId : 'lab12' } , user . id ) ;
428
400
429
401
await queuesService . joinQueue ( queue . id , {
430
402
user : {
@@ -464,10 +436,7 @@ describe('QueuesService', () => {
464
436
} ,
465
437
} as unknown as Request ;
466
438
467
- const queue = await queuesService . createQueue ( {
468
- creatorId : user . id ,
469
- labId : 'lab13' ,
470
- } ) ;
439
+ const queue = await queuesService . createQueue ( { labId : 'lab13' } , user . id ) ;
471
440
472
441
await expect ( queuesService . leaveQueue ( queue . id , req ) ) . rejects . toThrow ( NotFoundException ) ;
473
442
} ) ;
@@ -493,10 +462,9 @@ describe('QueuesService', () => {
493
462
} as unknown as Request ;
494
463
495
464
const queue = await queuesService . createQueue ( {
496
- creatorId : admin . id ,
497
465
labId : 'lab14' ,
498
466
status : 'COMPLETED' ,
499
- } ) ;
467
+ } , admin . id ) ;
500
468
501
469
await queuesService . resumeQueueStatus ( queue . id , req ) ;
502
470
const updatedQueue = await queuesService . findQueueById ( queue . id ) ;
@@ -522,10 +490,9 @@ describe('QueuesService', () => {
522
490
} as unknown as Request ;
523
491
524
492
const queue = await queuesService . createQueue ( {
525
- creatorId : user . id ,
526
493
labId : 'lab15' ,
527
494
status : 'SKIPPED' ,
528
- } ) ;
495
+ } , user . id ) ;
529
496
530
497
await expect ( queuesService . resumeQueueStatus ( queue . id , req ) ) . rejects . toThrow ( ForbiddenException ) ;
531
498
} ) ;
@@ -549,10 +516,9 @@ describe('QueuesService', () => {
549
516
} as unknown as Request ;
550
517
551
518
const queue = await queuesService . createQueue ( {
552
- creatorId : admin . id ,
553
519
labId : 'lab16' ,
554
520
status : 'PENDING' ,
555
- } ) ;
521
+ } , admin . id ) ;
556
522
557
523
await expect ( queuesService . resumeQueueStatus ( queue . id , req ) ) . rejects . toThrow ( ConflictException ) ;
558
524
} ) ;
0 commit comments