File tree Expand file tree Collapse file tree 2 files changed +73
-0
lines changed Expand file tree Collapse file tree 2 files changed +73
-0
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,15 @@ describe("getUserInfo", () => {
263
263
. catch ( err => done ( err ) ) ;
264
264
} ) ;
265
265
266
+ it ( "Should throw 400 with invalid array" , ( done ) => {
267
+ client . get ( endpoint , { params : { userID : "x" , values : 123 } } )
268
+ . then ( res => {
269
+ assert . strictEqual ( res . status , 400 ) ;
270
+ done ( ) ; // pass
271
+ } )
272
+ . catch ( err => done ( err ) ) ;
273
+ } ) ;
274
+
266
275
it ( "Should return 200 on userID not found" , ( done ) => {
267
276
client . get ( endpoint , { params : { userID : "notused-userid" } } )
268
277
. then ( res => {
@@ -307,4 +316,29 @@ describe("getUserInfo", () => {
307
316
} )
308
317
. catch ( err => done ( err ) ) ;
309
318
} ) ;
319
+
320
+ it ( "Should be able to get permissions" , ( done ) => {
321
+ client . get ( endpoint , { params : { userID : "getuserinfo_user_01" , value : "permissions" } } )
322
+ . then ( res => {
323
+ assert . strictEqual ( res . status , 200 ) ;
324
+ const expected = {
325
+ permissions : {
326
+ sponsor : true ,
327
+ selfpromo : true ,
328
+ exclusive_access : true ,
329
+ interaction : true ,
330
+ intro : true ,
331
+ outro : true ,
332
+ preview : true ,
333
+ music_offtopic : true ,
334
+ filler : true ,
335
+ poi_highlight : true ,
336
+ chapter : false ,
337
+ } ,
338
+ } ;
339
+ assert . ok ( partialDeepEquals ( res . data , expected ) ) ;
340
+ done ( ) ; // pass
341
+ } )
342
+ . catch ( err => done ( err ) ) ;
343
+ } ) ;
310
344
} ) ;
Original file line number Diff line number Diff line change @@ -560,4 +560,43 @@ describe("lockCategoriesRecords", () => {
560
560
} )
561
561
. catch ( err => done ( err ) ) ;
562
562
} ) ;
563
+
564
+ it ( "should be able to add poi type category by type skip" , ( done ) => {
565
+ const videoID = "add-record-poi" ;
566
+ client . post ( endpoint , {
567
+ videoID,
568
+ userID : lockVIPUser ,
569
+ categories : [ "poi_highlight" ] ,
570
+ actionTypes : [ "skip" ]
571
+ } )
572
+ . then ( res => {
573
+ assert . strictEqual ( res . status , 200 ) ;
574
+ checkLockCategories ( videoID )
575
+ . then ( result => {
576
+ assert . strictEqual ( result . length , 1 ) ;
577
+ assert . strictEqual ( result [ 0 ] , "poi_highlight" ) ;
578
+ } ) ;
579
+ done ( ) ;
580
+ } )
581
+ . catch ( err => done ( err ) ) ;
582
+ } ) ;
583
+
584
+ it ( "Should not add lock of invalid type" , ( done ) => {
585
+ const videoID = "add_invalid_type" ;
586
+ client . post ( endpoint , {
587
+ videoID,
588
+ userID : lockVIPUser ,
589
+ categories : [ "future_unused_invalid_type" ] ,
590
+ actionTypes : [ "skip" ]
591
+ } )
592
+ . then ( res => {
593
+ assert . strictEqual ( res . status , 200 ) ;
594
+ checkLockCategories ( videoID )
595
+ . then ( result => {
596
+ assert . strictEqual ( result . length , 0 ) ;
597
+ } ) ;
598
+ done ( ) ;
599
+ } )
600
+ . catch ( err => done ( err ) ) ;
601
+ } ) ;
563
602
} ) ;
You can’t perform that action at this time.
0 commit comments