@@ -319,7 +319,7 @@ describe('REST policies api', () => {
319
319
jest . clearAllMocks ( ) ;
320
320
} ) ;
321
321
322
- it ( 'should build' , async ( ) => {
322
+ it ( 'should build' , ( ) => {
323
323
expect ( app ) . toBeTruthy ( ) ;
324
324
} ) ;
325
325
@@ -558,7 +558,6 @@ describe('REST policies api', () => {
558
558
mockedAuthorizeConditional . mockImplementationOnce ( async ( ) => [
559
559
{ result : AuthorizeResult . DENY } ,
560
560
] ) ;
561
-
562
561
const result = await request ( app )
563
562
. get ( '/policies/user/default/permission_admin' )
564
563
. send ( ) ;
@@ -1192,7 +1191,6 @@ describe('REST policies api', () => {
1192
1191
. mockImplementation ( async ( ..._param : string [ ] ) : Promise < boolean > => {
1193
1192
return true ;
1194
1193
} ) ;
1195
-
1196
1194
const result = await request ( app )
1197
1195
. put ( '/policies/user/default/permission_admin' )
1198
1196
. send ( {
@@ -2479,30 +2477,29 @@ describe('REST policies api', () => {
2479
2477
} ) ;
2480
2478
2481
2479
describe ( 'GetFirstQuery' , ( ) => {
2482
- it ( 'should return an empty string for undefined query value' , async ( ) => {
2480
+ it ( 'should return an empty string for undefined query value' , ( ) => {
2483
2481
const result = server . getFirstQuery ( undefined ) ;
2484
2482
expect ( result ) . toBe ( '' ) ;
2485
2483
} ) ;
2486
2484
2487
2485
it ( 'should return the first string value from a string array' , async ( ) => {
2488
2486
const queryValue = [ 'value1' , 'value2' ] ;
2489
-
2490
2487
const result = server . getFirstQuery ( queryValue ) ;
2491
2488
expect ( result ) . toBe ( 'value1' ) ;
2492
2489
} ) ;
2493
2490
2494
- it ( 'should throw an InputError for an array of ParsedQs' , async ( ) => {
2491
+ it ( 'should throw an InputError for an array of ParsedQs' , ( ) => {
2495
2492
const queryValue = [ { key : 'value' } , { key : 'value2' } ] ;
2496
2493
expect ( ( ) => server . getFirstQuery ( queryValue ) ) . toThrow ( InputError ) ;
2497
2494
} ) ;
2498
2495
2499
- it ( 'should return the string value when query value is a string' , async ( ) => {
2496
+ it ( 'should return the string value when query value is a string' , ( ) => {
2500
2497
const queryValue = 'singleValue' ;
2501
2498
const result = server . getFirstQuery ( queryValue ) ;
2502
2499
expect ( result ) . toBe ( 'singleValue' ) ;
2503
2500
} ) ;
2504
2501
2505
- it ( 'should throw an InputError for ParsedQs' , async ( ) => {
2502
+ it ( 'should throw an InputError for ParsedQs' , ( ) => {
2506
2503
const queryValue = { key : 'value' } ;
2507
2504
expect ( ( ) => server . getFirstQuery ( queryValue ) ) . toThrow ( InputError ) ;
2508
2505
} ) ;
@@ -2580,7 +2577,6 @@ describe('REST policies api', () => {
2580
2577
return [ ] ;
2581
2578
} ,
2582
2579
) ;
2583
-
2584
2580
const result = await request ( app )
2585
2581
. get ( '/roles/conditions?pluginId=catalog' )
2586
2582
. send ( ) ;
@@ -2603,7 +2599,6 @@ describe('REST policies api', () => {
2603
2599
return [ ] ;
2604
2600
} ,
2605
2601
) ;
2606
-
2607
2602
const result = await request ( app )
2608
2603
. get ( '/roles/conditions?pluginId=scaffolder' )
2609
2604
. send ( ) ;
@@ -2626,7 +2621,6 @@ describe('REST policies api', () => {
2626
2621
return [ ] ;
2627
2622
} ,
2628
2623
) ;
2629
-
2630
2624
const result = await request ( app )
2631
2625
. get ( '/roles/conditions?resourceType=catalog-entity' )
2632
2626
. send ( ) ;
@@ -2803,7 +2797,6 @@ describe('REST policies api', () => {
2803
2797
params : { claims : [ 'group:default/team-a' ] } ,
2804
2798
} ,
2805
2799
} ;
2806
-
2807
2800
const result = await request ( app )
2808
2801
. post ( '/roles/conditions' )
2809
2802
. send ( roleCondition ) ;
@@ -2865,7 +2858,6 @@ describe('REST policies api', () => {
2865
2858
params : { claims : [ 'group:default/team-a' ] } ,
2866
2859
} ,
2867
2860
} ;
2868
-
2869
2861
const result = await request ( app )
2870
2862
. put ( '/roles/conditions/1' )
2871
2863
. send ( conditionDecision ) ;
@@ -2917,7 +2909,6 @@ describe('REST policies api', () => {
2917
2909
. mockImplementation ( async ( ) => {
2918
2910
return pluginMetadata ;
2919
2911
} ) ;
2920
-
2921
2912
const result = await request ( app ) . get ( '/plugins/policies' ) . send ( ) ;
2922
2913
expect ( result . statusCode ) . toEqual ( 200 ) ;
2923
2914
expect ( result . body ) . toEqual ( pluginMetadata ) ;
@@ -2927,7 +2918,6 @@ describe('REST policies api', () => {
2927
2918
mockedAuthorizeConditional . mockImplementationOnce ( async ( ) => [
2928
2919
{ result : AuthorizeResult . DENY } ,
2929
2920
] ) ;
2930
-
2931
2921
const result = await request ( app ) . get ( '/plugins/policies' ) . send ( ) ;
2932
2922
2933
2923
expect ( mockedAuthorizeConditional ) . toHaveBeenCalledWith (
@@ -2971,7 +2961,6 @@ describe('REST policies api', () => {
2971
2961
. mockImplementation ( async ( ) => {
2972
2962
return rules ;
2973
2963
} ) ;
2974
-
2975
2964
const result = await request ( app ) . get ( '/plugins/condition-rules' ) . send ( ) ;
2976
2965
expect ( result . statusCode ) . toEqual ( 200 ) ;
2977
2966
expect ( result . body ) . toEqual ( rules ) ;
@@ -2981,7 +2970,6 @@ describe('REST policies api', () => {
2981
2970
mockedAuthorizeConditional . mockImplementationOnce ( async ( ) => [
2982
2971
{ result : AuthorizeResult . DENY } ,
2983
2972
] ) ;
2984
-
2985
2973
const result = await request ( app ) . get ( '/plugins/condition-rules' ) . send ( ) ;
2986
2974
2987
2975
expect ( mockedAuthorizeConditional ) . toHaveBeenCalledWith (
0 commit comments