@@ -128,12 +128,6 @@ describe('actions', () => {
128128 customerAbbr : 'NA1' ,
129129 startDate : new Date ( 2024 , 10 , 17 ) ,
130130 endDate : new Date ( 2024 , 10 , 20 ) ,
131- administrators : [
132- {
133- handle : 'ncalteen' ,
134- 135- }
136- ] ,
137131 attendees : [
138132 {
139133 handle : 'ncalteen-testuser' ,
@@ -164,12 +158,6 @@ describe('actions', () => {
164158 customerAbbr : 'NA1' ,
165159 startDate : new Date ( 2024 , 10 , 17 ) ,
166160 endDate : new Date ( 2024 , 10 , 20 ) ,
167- administrators : [
168- {
169- handle : 'ncalteen' ,
170- 171- }
172- ] ,
173161 attendees : [
174162 {
175163 handle : 'ncalteen-testuser' ,
@@ -204,12 +192,6 @@ describe('actions', () => {
204192 customerAbbr : 'NA1' ,
205193 startDate : new Date ( 2024 , 10 , 17 ) ,
206194 endDate : new Date ( 2024 , 10 , 20 ) ,
207- administrators : [
208- {
209- handle : 'ncalteen' ,
210- 211- }
212- ] ,
213195 attendees : [
214196 {
215197 handle : 'ncalteen-testuser' ,
@@ -236,12 +218,6 @@ describe('actions', () => {
236218 customerAbbr : 'NA1' ,
237219 startDate : new Date ( 2024 , 10 , 17 ) ,
238220 endDate : new Date ( 2024 , 10 , 20 ) ,
239- administrators : [
240- {
241- handle : 'ncalteen' ,
242- 243- }
244- ] ,
245221 attendees : [
246222 {
247223 handle : 'ncalteen-testuser' ,
@@ -265,12 +241,6 @@ describe('actions', () => {
265241 customerAbbr : 'NA1' ,
266242 startDate : new Date ( 2024 , 10 , 17 ) ,
267243 endDate : new Date ( 2024 , 10 , 20 ) ,
268- administrators : [
269- {
270- handle : 'ncalteen' ,
271- 272- }
273- ] ,
274244 attendees : [
275245 {
276246 handle : 'ncalteen-testuser' ,
@@ -303,12 +273,6 @@ describe('actions', () => {
303273 customerAbbr : 'NA1' ,
304274 startDate : new Date ( 2023 , 10 , 17 ) ,
305275 endDate : new Date ( 2023 , 10 , 20 ) ,
306- administrators : [
307- {
308- handle : 'ncalteen' ,
309- 310- }
311- ] ,
312276 attendees : [
313277 {
314278 handle : 'ncalteen-testuser' ,
@@ -325,127 +289,6 @@ describe('actions', () => {
325289 } )
326290 } )
327291
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-
449292 describe ( 'addUser()' , ( ) => {
450293 it ( 'Throws on Invalid Format' , async ( ) => {
451294 try {
@@ -456,12 +299,6 @@ describe('actions', () => {
456299 customerAbbr : 'NA1' ,
457300 startDate : new Date ( 2024 , 10 , 17 ) ,
458301 endDate : new Date ( 2024 , 10 , 20 ) ,
459- administrators : [
460- {
461- handle : 'ncalteen' ,
462- 463- }
464- ] ,
465302 attendees : [
466303 {
467304 handle : 'ncalteen-testuser' ,
@@ -492,12 +329,6 @@ describe('actions', () => {
492329 customerAbbr : 'NA1' ,
493330 startDate : new Date ( 2024 , 10 , 17 ) ,
494331 endDate : new Date ( 2024 , 10 , 20 ) ,
495- administrators : [
496- {
497- handle : 'ncalteen' ,
498- 499- }
500- ] ,
501332 attendees : [
502333 {
503334 handle : 'ncalteen-testuser' ,
@@ -519,43 +350,4 @@ describe('actions', () => {
519350 expect ( issues_complete ) . toHaveBeenCalled ( )
520351 } )
521352 } )
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- } )
561353} )
0 commit comments