File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -528,3 +528,23 @@ describe('Api.prototype._getPreSelectedTabId : ', () => {
528
528
expect ( obj . _getPreSelectedTabId ( ) ) . toBe ( 'tab2' ) ;
529
529
} ) ;
530
530
} ) ;
531
+ describe ( 'Api.prototype._getPreSiblingTabId : ' , ( ) => {
532
+ test ( 'it should call helper.filterArrayUntilFirstValue with appropriate parameters' , ( ) => {
533
+ obj . helper . filterArrayUntilFirstValue = jest . fn ( ( ) => { } ) ;
534
+ obj . stateRef = { selectedTabID : '2' , openTabIDs : [ '1' , '2' , '3' ] } ;
535
+ obj . _getPreSiblingTabId ( ) ;
536
+ expect ( obj . helper . filterArrayUntilFirstValue . mock . calls . length ) . toBe ( 1 ) ;
537
+ expect ( obj . helper . filterArrayUntilFirstValue . mock . calls [ 0 ] [ 0 ] ) . toEqual ( [ '1' ] ) ;
538
+ expect ( obj . helper . filterArrayUntilFirstValue . mock . calls [ 0 ] [ 2 ] ) . toBe ( true ) ;
539
+ } ) ;
540
+ } ) ;
541
+ describe ( 'Api.prototype._getNextSiblingTabId : ' , ( ) => {
542
+ test ( 'it should call helper.filterArrayUntilFirstValue with appropriate parameters' , ( ) => {
543
+ obj . helper . filterArrayUntilFirstValue = jest . fn ( ( ) => { } ) ;
544
+ obj . stateRef = { selectedTabID : '2' , openTabIDs : [ '1' , '2' , '3' ] } ;
545
+ obj . _getNextSiblingTabId ( ) ;
546
+ expect ( obj . helper . filterArrayUntilFirstValue . mock . calls . length ) . toBe ( 1 ) ;
547
+ expect ( obj . helper . filterArrayUntilFirstValue . mock . calls [ 0 ] [ 0 ] ) . toEqual ( [ '3' ] ) ;
548
+ expect ( ! obj . helper . filterArrayUntilFirstValue . mock . calls [ 0 ] [ 2 ] ) . toBe ( true ) ;
549
+ } ) ;
550
+ } ) ;
You can’t perform that action at this time.
0 commit comments