File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -559,5 +559,41 @@ describe('Submission Service tests', () => {
559
559
done ( )
560
560
} )
561
561
} ) . timeout ( 20000 )
562
+
563
+ it ( 'Getting submissions with Admin token should include review.metadata.public and review.metadata.private' , ( done ) => {
564
+ chai . request ( app )
565
+ . get ( `${ config . API_VERSION } /submissions` )
566
+ . set ( 'Authorization' , `Bearer ${ config . ADMIN_TOKEN } ` )
567
+ . end ( ( err , res ) => {
568
+ res . should . have . status ( 200 )
569
+ res . body . should . have . nested . property ( '[0].review[0].metdata.public' )
570
+ res . body . should . have . nested . property ( '[0].review[0].metdata.private' )
571
+ done ( )
572
+ } )
573
+ } ) . timeout ( 20000 )
574
+
575
+ it ( 'Getting submissions with Copilot token should include review.metadata.public and review.metadata.private' , ( done ) => {
576
+ chai . request ( app )
577
+ . get ( `${ config . API_VERSION } /submissions` )
578
+ . set ( 'Authorization' , `Bearer ${ config . COPILOT_TOKEN } ` )
579
+ . end ( ( err , res ) => {
580
+ res . should . have . status ( 200 )
581
+ res . body . should . have . nested . property ( '[0].review[0].metdata.public' )
582
+ res . body . should . have . nested . property ( '[0].review[0].metdata.private' )
583
+ done ( )
584
+ } )
585
+ } ) . timeout ( 20000 )
586
+
587
+ it ( 'Getting submissions with User token should include review.metadata.public but not review.metadata.private' , ( done ) => {
588
+ chai . request ( app )
589
+ . get ( `${ config . API_VERSION } /submissions` )
590
+ . set ( 'Authorization' , `Bearer ${ config . USER_TOKEN } ` )
591
+ . end ( ( err , res ) => {
592
+ res . should . have . status ( 200 )
593
+ res . body . should . have . nested . property ( '[0].review[0].metdata.public' )
594
+ res . body . should . not . have . nested . property ( '[0].review[0].metdata.private' )
595
+ done ( )
596
+ } )
597
+ } ) . timeout ( 20000 )
562
598
} )
563
599
} )
You can’t perform that action at this time.
0 commit comments