@@ -128,12 +128,6 @@ describe('actions', () => {
128
128
customerAbbr : 'NA1' ,
129
129
startDate : new Date ( 2024 , 10 , 17 ) ,
130
130
endDate : new Date ( 2024 , 10 , 20 ) ,
131
- administrators : [
132
- {
133
- handle : 'ncalteen' ,
134
-
135
- }
136
- ] ,
137
131
attendees : [
138
132
{
139
133
handle : 'ncalteen-testuser' ,
@@ -164,12 +158,6 @@ describe('actions', () => {
164
158
customerAbbr : 'NA1' ,
165
159
startDate : new Date ( 2024 , 10 , 17 ) ,
166
160
endDate : new Date ( 2024 , 10 , 20 ) ,
167
- administrators : [
168
- {
169
- handle : 'ncalteen' ,
170
-
171
- }
172
- ] ,
173
161
attendees : [
174
162
{
175
163
handle : 'ncalteen-testuser' ,
@@ -204,12 +192,6 @@ describe('actions', () => {
204
192
customerAbbr : 'NA1' ,
205
193
startDate : new Date ( 2024 , 10 , 17 ) ,
206
194
endDate : new Date ( 2024 , 10 , 20 ) ,
207
- administrators : [
208
- {
209
- handle : 'ncalteen' ,
210
-
211
- }
212
- ] ,
213
195
attendees : [
214
196
{
215
197
handle : 'ncalteen-testuser' ,
@@ -236,12 +218,6 @@ describe('actions', () => {
236
218
customerAbbr : 'NA1' ,
237
219
startDate : new Date ( 2024 , 10 , 17 ) ,
238
220
endDate : new Date ( 2024 , 10 , 20 ) ,
239
- administrators : [
240
- {
241
- handle : 'ncalteen' ,
242
-
243
- }
244
- ] ,
245
221
attendees : [
246
222
{
247
223
handle : 'ncalteen-testuser' ,
@@ -265,12 +241,6 @@ describe('actions', () => {
265
241
customerAbbr : 'NA1' ,
266
242
startDate : new Date ( 2024 , 10 , 17 ) ,
267
243
endDate : new Date ( 2024 , 10 , 20 ) ,
268
- administrators : [
269
- {
270
- handle : 'ncalteen' ,
271
-
272
- }
273
- ] ,
274
244
attendees : [
275
245
{
276
246
handle : 'ncalteen-testuser' ,
@@ -303,12 +273,6 @@ describe('actions', () => {
303
273
customerAbbr : 'NA1' ,
304
274
startDate : new Date ( 2023 , 10 , 17 ) ,
305
275
endDate : new Date ( 2023 , 10 , 20 ) ,
306
- administrators : [
307
- {
308
- handle : 'ncalteen' ,
309
-
310
- }
311
- ] ,
312
276
attendees : [
313
277
{
314
278
handle : 'ncalteen-testuser' ,
@@ -325,127 +289,6 @@ describe('actions', () => {
325
289
} )
326
290
} )
327
291
328
- describe ( 'addAdmin()' , ( ) => {
329
- it ( 'Throws on Invalid Format' , async ( ) => {
330
- try {
331
- await actions . addAdmin (
332
- {
333
- action : AllowedIssueAction . CREATE ,
334
- customerName : 'Nick Testing Industries' ,
335
- customerAbbr : 'NA1' ,
336
- startDate : new Date ( 2024 , 10 , 17 ) ,
337
- endDate : new Date ( 2024 , 10 , 20 ) ,
338
- administrators : [
339
- {
340
- handle : 'ncalteen' ,
341
-
342
- }
343
- ] ,
344
- attendees : [
345
- {
346
- handle : 'ncalteen-testuser' ,
347
-
348
- }
349
- ]
350
- } ,
351
- {
352
- issue : { number : 1 } ,
353
- comment : {
354
- body : '.add-admin invalid format'
355
- }
356
- } as any
357
- )
358
- } catch ( error : any ) {
359
- // eslint-disable-next-line jest/no-conditional-expect
360
- expect ( error . message ) . toBe (
361
- 'Invalid Format! Try `.add-admin handle,email`'
362
- )
363
- }
364
- } )
365
-
366
- it ( 'Adds an Admin' , async ( ) => {
367
- mocktokit . graphql . mockResolvedValue ( {
368
- user : {
369
- isEmployee : true ,
370
-
371
- }
372
- } )
373
-
374
- await actions . addAdmin (
375
- {
376
- action : AllowedIssueAction . CREATE ,
377
- customerName : 'Nick Testing Industries' ,
378
- customerAbbr : 'NA1' ,
379
- startDate : new Date ( 2024 , 10 , 17 ) ,
380
- endDate : new Date ( 2024 , 10 , 20 ) ,
381
- administrators : [
382
- {
383
- handle : 'ncalteen' ,
384
-
385
- }
386
- ] ,
387
- attendees : [
388
- {
389
- handle : 'ncalteen-testuser' ,
390
-
391
- }
392
- ]
393
- } ,
394
- {
395
- issue : { number : 1 } ,
396
- comment : {
397
- body :
'.add-admin ncalteen,[email protected] '
398
- }
399
- } as any
400
- )
401
-
402
- expect ( teams_addUser ) . toHaveBeenCalled ( )
403
- expect ( issues_complete ) . toHaveBeenCalled ( )
404
- } )
405
-
406
- it ( 'Throws on Invalid Admin' , async ( ) => {
407
- mocktokit . graphql . mockResolvedValue ( {
408
- user : {
409
- isEmployee : false ,
410
-
411
- }
412
- } )
413
-
414
- try {
415
- await actions . addAdmin (
416
- {
417
- action : AllowedIssueAction . CREATE ,
418
- customerName : 'Nick Testing Industries' ,
419
- customerAbbr : 'NA1' ,
420
- startDate : new Date ( 2024 , 10 , 17 ) ,
421
- endDate : new Date ( 2024 , 10 , 20 ) ,
422
- administrators : [
423
- {
424
- handle : 'ncalteen' ,
425
-
426
- }
427
- ] ,
428
- attendees : [
429
- {
430
- handle : 'ncalteen-testuser' ,
431
-
432
- }
433
- ]
434
- } ,
435
- {
436
- issue : { number : 1 } ,
437
- comment : {
438
- body :
'.add-admin fakeuser,[email protected] '
439
- }
440
- } as any
441
- )
442
- } catch ( error : any ) {
443
- // eslint-disable-next-line jest/no-conditional-expect
444
- expect ( error . message ) . toBe ( 'Admins Must be GitHub/Microsoft Employees' )
445
- }
446
- } )
447
- } )
448
-
449
292
describe ( 'addUser()' , ( ) => {
450
293
it ( 'Throws on Invalid Format' , async ( ) => {
451
294
try {
@@ -456,12 +299,6 @@ describe('actions', () => {
456
299
customerAbbr : 'NA1' ,
457
300
startDate : new Date ( 2024 , 10 , 17 ) ,
458
301
endDate : new Date ( 2024 , 10 , 20 ) ,
459
- administrators : [
460
- {
461
- handle : 'ncalteen' ,
462
-
463
- }
464
- ] ,
465
302
attendees : [
466
303
{
467
304
handle : 'ncalteen-testuser' ,
@@ -492,12 +329,6 @@ describe('actions', () => {
492
329
customerAbbr : 'NA1' ,
493
330
startDate : new Date ( 2024 , 10 , 17 ) ,
494
331
endDate : new Date ( 2024 , 10 , 20 ) ,
495
- administrators : [
496
- {
497
- handle : 'ncalteen' ,
498
-
499
- }
500
- ] ,
501
332
attendees : [
502
333
{
503
334
handle : 'ncalteen-testuser' ,
@@ -519,43 +350,4 @@ describe('actions', () => {
519
350
expect ( issues_complete ) . toHaveBeenCalled ( )
520
351
} )
521
352
} )
522
-
523
- describe ( 'removeAdmin()' , ( ) => {
524
- it ( 'Throws on Invalid Format' , async ( ) => {
525
- try {
526
- await actions . removeAdmin (
527
- {
528
- action : AllowedIssueAction . CREATE ,
529
- customerName : 'Nick Testing Industries' ,
530
- customerAbbr : 'NA1' ,
531
- startDate : new Date ( 2024 , 10 , 17 ) ,
532
- endDate : new Date ( 2024 , 10 , 20 ) ,
533
- administrators : [
534
- {
535
- handle : 'ncalteen' ,
536
-
537
- }
538
- ] ,
539
- attendees : [
540
- {
541
- handle : 'ncalteen-testuser' ,
542
-
543
- }
544
- ]
545
- } ,
546
- {
547
- issue : { number : 1 } ,
548
- comment : {
549
- body : '.remove-admin invalid format'
550
- }
551
- } as any
552
- )
553
- } catch ( error : any ) {
554
- // eslint-disable-next-line jest/no-conditional-expect
555
- expect ( error . message ) . toBe (
556
- 'Invalid Format! Try `.remove-admin handle,email`'
557
- )
558
- }
559
- } )
560
- } )
561
353
} )
0 commit comments