File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,8 @@ const _apiProps = {
7575 return this . optionsManager . getOption ( name ) ;
7676 } ,
7777 setOption : function ( name , value ) {
78- return this . optionsManager . setOption ( name , value ) ;
78+ this . optionsManager . setOption ( name , value ) ;
79+ return this ;
7980 } ,
8081 getPreviousData : function ( ) {
8182 return this . helper . getCopyState ( this . previousState ) ;
Original file line number Diff line number Diff line change @@ -478,6 +478,23 @@ describe('Api.prototype.setTab : ', () => {
478478 obj . optionsManager . validatePanelComponent ,
479479 ) ;
480480 } ) ;
481+ test ( 'it should return the context' , ( ) => {
482+ obj . optionsManager . validateObjectiveTabData = jest . fn ( ( ) => obj . optionsManager ) ;
483+ obj . optionsManager . validatePanelComponent = jest . fn ( ( ) => obj . optionsManager ) ;
484+ const result = obj . setTab ( '1' , { title : 'c' } ) ;
485+ expect ( result ) . toEqual ( obj ) ;
486+ } ) ;
487+ } ) ;
488+ describe ( 'Api.prototype.setOption : ' , ( ) => {
489+ test ( 'it should call optionsManager.setOption internally' , ( ) => {
490+ obj . optionsManager . setOption = jest . fn ( ( ) => obj . optionsManager ) ;
491+ obj . setOption ( 'isVertical' , true ) ;
492+ expect ( obj . optionsManager . setOption . mock . calls . length ) . toBe ( 1 ) ;
493+ } ) ;
494+ test ( 'it should return the context' , ( ) => {
495+ const result = obj . setOption ( 'isVertical' , true ) ;
496+ expect ( result ) . toEqual ( obj ) ;
497+ } ) ;
481498} ) ;
482499describe ( 'Api.prototype._subscribeSelectedTabsHistory : ' , ( ) => {
483500 test ( 'it should call "on" method' , ( ) => {
You can’t perform that action at this time.
0 commit comments