@@ -231,6 +231,7 @@ describe('GroupComponent', () => {
231231 fixture . detectChanges ( ) ;
232232 expectGetDefaultRoles ( ) ;
233233 expectGetGroupMembers ( ) ;
234+ expectGetCurrentUser ( ) ;
234235 expectGetGroupAPIs ( ) ;
235236 expectGetGroupApplications ( ) ;
236237 expect ( component . groupForm . getRawValue ( ) ) . toEqual ( {
@@ -255,6 +256,7 @@ describe('GroupComponent', () => {
255256 fixture . detectChanges ( ) ;
256257 expectGetDefaultRoles ( ) ;
257258 expectGetGroupMembers ( ) ;
259+ expectGetCurrentUser ( ) ;
258260 expectGetGroupAPIs ( ) ;
259261 expectGetGroupApplications ( ) ;
260262 const nameInputHarness = await getNameInput ( ) ;
@@ -269,6 +271,7 @@ describe('GroupComponent', () => {
269271 MatInputHarness . with ( { selector : '[formControlName="maxNumberOfMembers"]' } ) ,
270272 ) ;
271273 expect ( await maxNoOfMembersHarness . isDisabled ( ) ) . toEqual ( true ) ;
274+ expect ( component . memberColumnDefs . length ) . toEqual ( 6 ) ;
272275 } ) ;
273276
274277 it ( 'should submit form to update group' , async ( ) => {
@@ -278,6 +281,7 @@ describe('GroupComponent', () => {
278281 fixture . detectChanges ( ) ;
279282 expectGetDefaultRoles ( ) ;
280283 expectGetGroupMembers ( ) ;
284+ expectGetCurrentUser ( ) ;
281285 expectGetGroupAPIs ( ) ;
282286 expectGetGroupApplications ( ) ;
283287 await getNameInput ( ) . then ( ( input ) => input . setValue ( 'Test Group 1' ) ) ;
@@ -300,6 +304,7 @@ describe('GroupComponent', () => {
300304 it ( 'should add group to existing APIs' , async ( ) => {
301305 expectGetDefaultRoles ( ) ;
302306 expectGetGroupMembers ( ) ;
307+ expectGetCurrentUser ( ) ;
303308 expectGetGroupAPIs ( ) ;
304309 expectGetGroupApplications ( ) ;
305310 const buttonHarness = await harnessLoader . getHarness ( MatButtonHarness . with ( { text : 'Add Group To Existing APIs' } ) ) ;
@@ -318,6 +323,7 @@ describe('GroupComponent', () => {
318323 it ( 'should add group to existing applications' , async ( ) => {
319324 expectGetDefaultRoles ( ) ;
320325 expectGetGroupMembers ( ) ;
326+ expectGetCurrentUser ( ) ;
321327 expectGetGroupAPIs ( ) ;
322328 expectGetGroupApplications ( ) ;
323329 const buttonHarness = await harnessLoader . getHarness ( MatButtonHarness . with ( { text : 'Add Group To Existing Applications' } ) ) ;
@@ -345,6 +351,7 @@ describe('GroupComponent', () => {
345351 it ( 'should display list of group members' , async ( ) => {
346352 expectGetDefaultRoles ( ) ;
347353 expectGetGroupMembers ( ) ;
354+ expectGetCurrentUser ( ) ;
348355 expectGetGroupAPIs ( ) ;
349356 expectGetGroupApplications ( ) ;
350357 const tableHarness = await harnessLoader . getHarness ( MatTableHarness . with ( { selector : '#membersDataTable' } ) ) ;
@@ -358,6 +365,7 @@ describe('GroupComponent', () => {
358365 it ( 'should delete member' , async ( ) => {
359366 expectGetDefaultRoles ( ) ;
360367 expectGetGroupMembers ( ) ;
368+ expectGetCurrentUser ( ) ;
361369 expectGetGroupAPIs ( ) ;
362370 expectGetGroupApplications ( ) ;
363371 const tableHarness = await harnessLoader . getHarness ( MatTableHarness . with ( { selector : '#membersDataTable' } ) ) ;
@@ -374,6 +382,7 @@ describe('GroupComponent', () => {
374382 it ( 'should update member' , async ( ) => {
375383 expectGetDefaultRoles ( ) ;
376384 expectGetGroupMembers ( ) ;
385+ expectGetCurrentUser ( ) ;
377386 expectGetGroupAPIs ( ) ;
378387 expectGetGroupApplications ( ) ;
379388 const tableHarness = await harnessLoader . getHarness ( MatTableHarness . with ( { selector : '#membersDataTable' } ) ) ;
@@ -422,6 +431,7 @@ describe('GroupComponent', () => {
422431 it ( 'should display list of invitations' , async ( ) => {
423432 expectGetDefaultRoles ( ) ;
424433 expectGetGroupMembers ( ) ;
434+ expectGetCurrentUser ( ) ;
425435 expectGetGroupAPIs ( ) ;
426436 expectGetGroupApplications ( ) ;
427437 const tabGroupHarness = await harnessLoader . getHarness ( MatTabGroupHarness ) ;
@@ -439,6 +449,7 @@ describe('GroupComponent', () => {
439449 it ( 'should delete invitation' , async ( ) => {
440450 expectGetDefaultRoles ( ) ;
441451 expectGetGroupMembers ( ) ;
452+ expectGetCurrentUser ( ) ;
442453 expectGetGroupAPIs ( ) ;
443454 expectGetGroupApplications ( ) ;
444455 const tabGroupHarness = await harnessLoader . getHarness ( MatTabGroupHarness ) ;
@@ -468,6 +479,7 @@ describe('GroupComponent', () => {
468479 it ( 'should display list of associated applications' , async ( ) => {
469480 expectGetDefaultRoles ( ) ;
470481 expectGetGroupMembers ( ) ;
482+ expectGetCurrentUser ( ) ;
471483 expectGetGroupAPIs ( ) ;
472484 expectGetGroupApplications ( ) ;
473485 const tableHarness = await harnessLoader . getHarness ( MatTableHarness . with ( { selector : '#groupApplicationsDataTable' } ) ) ;
@@ -490,6 +502,7 @@ describe('GroupComponent', () => {
490502 it ( 'should display list of associated APIs' , async ( ) => {
491503 expectGetDefaultRoles ( ) ;
492504 expectGetGroupMembers ( ) ;
505+ expectGetCurrentUser ( ) ;
493506 expectGetGroupAPIs ( ) ;
494507 expectGetGroupApplications ( ) ;
495508 const tableHarness = await harnessLoader . getHarness ( MatTableHarness . with ( { selector : '#groupApisDataTable' } ) ) ;
@@ -521,6 +534,7 @@ describe('GroupComponent', () => {
521534 fixture . detectChanges ( ) ;
522535 expectGetDefaultRoles ( ) ;
523536 expectGetGroupMembers ( ) ;
537+ expectGetCurrentUser ( ) ;
524538 expectGetGroupAPIs ( ) ;
525539 expectGetGroupApplications ( ) ;
526540 const buttonHarness = await getButtonByTooltipText ( 'Search and invite users to the group' ) ;
@@ -569,6 +583,7 @@ describe('GroupComponent', () => {
569583 } ,
570584 } ,
571585 ] ) ;
586+ expectGetCurrentUser ( ) ;
572587 expectGetGroupAPIs ( ) ;
573588 expectGetGroupApplications ( ) ;
574589 const buttonHarness = await getButtonByTooltipText ( 'Search and invite users to the group' ) ;
@@ -583,6 +598,7 @@ describe('GroupComponent', () => {
583598 fixture . detectChanges ( ) ;
584599 expectGetDefaultRoles ( ) ;
585600 expectGetGroupMembers ( ) ;
601+ expectGetCurrentUser ( ) ;
586602 expectGetGroupAPIs ( ) ;
587603 expectGetGroupApplications ( ) ;
588604 const buttonHarness = await getButtonByTooltipText ( 'Search and invite users to the group' ) ;
@@ -611,6 +627,7 @@ describe('GroupComponent', () => {
611627 fixture . detectChanges ( ) ;
612628 expectGetDefaultRoles ( ) ;
613629 expectGetGroupMembers ( ) ;
630+ expectGetCurrentUser ( ) ;
614631 expectGetGroupAPIs ( ) ;
615632 expectGetGroupApplications ( ) ;
616633 const buttonHarness = await getButtonByTooltipText ( 'Search and invite users to the group' ) ;
@@ -642,6 +659,7 @@ describe('GroupComponent', () => {
642659 fixture . detectChanges ( ) ;
643660 expectGetDefaultRoles ( ) ;
644661 expectGetGroupMembers ( ) ;
662+ expectGetCurrentUser ( ) ;
645663 expectGetGroupAPIs ( ) ;
646664 expectGetGroupApplications ( ) ;
647665 const buttonHarness = await getButtonByTooltipText ( 'Search and invite users to the group' ) ;
@@ -673,6 +691,7 @@ describe('GroupComponent', () => {
673691 fixture . detectChanges ( ) ;
674692 expectGetDefaultRoles ( ) ;
675693 expectGetGroupMembers ( ) ;
694+ expectGetCurrentUser ( ) ;
676695 expectGetGroupAPIs ( ) ;
677696 expectGetGroupApplications ( ) ;
678697 const buttonHarness = await getButtonByTooltipText ( 'Search and invite users to the group' ) ;
@@ -710,6 +729,7 @@ describe('GroupComponent', () => {
710729 fixture . detectChanges ( ) ;
711730 expectGetDefaultRoles ( ) ;
712731 expectGetGroupMembers ( ) ;
732+ expectGetCurrentUser ( ) ;
713733 expectGetGroupAPIs ( ) ;
714734 expectGetGroupApplications ( ) ;
715735 const buttonHarness = await getButtonByTooltipText ( 'Search and invite users to the group' ) ;
@@ -764,6 +784,7 @@ describe('GroupComponent', () => {
764784 fixture . detectChanges ( ) ;
765785 expectGetDefaultRoles ( ) ;
766786 expectGetGroupMembers ( ) ;
787+ expectGetCurrentUser ( ) ;
767788 expectGetGroupAPIs ( ) ;
768789 expectGetGroupApplications ( ) ;
769790 const buttonHarness = await getButtonByTooltipText ( 'Search and invite users to the group' ) ;
@@ -803,6 +824,7 @@ describe('GroupComponent', () => {
803824 fixture . detectChanges ( ) ;
804825 expectGetDefaultRoles ( ) ;
805826 expectGetGroupMembers ( ) ;
827+ expectGetCurrentUser ( ) ;
806828 expectGetGroupAPIs ( ) ;
807829 expectGetGroupApplications ( ) ;
808830 const buttonHarness = await getButtonByTooltipText ( 'Search and invite users to the group' ) ;
@@ -950,4 +972,8 @@ describe('GroupComponent', () => {
950972 } ;
951973 expect ( req . request . body ) . toEqual ( invitation ) ;
952974 }
975+
976+ function expectGetCurrentUser ( ) {
977+ httpTestingController . expectOne ( { url : `${ CONSTANTS_TESTING . org . baseURL } /user` , method : 'GET' } ) ;
978+ }
953979} ) ;
0 commit comments