@@ -393,21 +393,6 @@ describe('Api.prototype.eventHandlerFactory : ', () => {
393393 }
394394 } ) ;
395395} ) ;
396- describe ( 'Api.prototype.getCopyPerviouseData' , ( ) => {
397- test ( 'In the onLoad event, return data is equal to getInitialState() and getCopyData()' , ( ) => {
398- expect . assertions ( 3 ) ;
399- const _state = { selectedTabID : 'tab1' , openTabIDs : [ 'tab1' , 'tab2' ] } ;
400- obj . setOption ( 'onLoad' , function ( ) {
401- const perviousData = this . getCopyPerviousData ( ) ;
402- const data = this . getCopyData ( ) ;
403- expect ( perviousData ) . toEqual ( _state ) ;
404- expect ( perviousData ) . toEqual ( data ) ;
405- expect ( perviousData !== null ) . toBe ( true ) ;
406- } ) ;
407- obj . updateStateRef ( _state , ( ) => { } ) ;
408- obj . trigger ( 'onLoad' , obj . userProxy ) ;
409- } ) ;
410- } ) ;
411396describe ( 'Api.prototype.getCopyPerviousData' , ( ) => {
412397 test ( 'returned data should be equal to optionsManager.initialState in onLoad event' , ( ) => {
413398 expect . assertions ( 2 ) ;
@@ -428,6 +413,19 @@ describe('Api.prototype.getCopyPerviousData', () => {
428413 obj . updateStateRef ( { selectedTabID : 'tab1' , openTabIDs : [ 'tab1' , 'tab2' ] } , ( ) => { } ) ;
429414 obj . trigger ( 'onLoad' , obj . userProxy ) ;
430415 } ) ;
416+ test ( 'In the onLoad event, return data is equal to getInitialState() and getCopyData()' , ( ) => {
417+ expect . assertions ( 3 ) ;
418+ const _state = { selectedTabID : 'tab1' , openTabIDs : [ 'tab1' , 'tab2' ] } ;
419+ obj . setOption ( 'onLoad' , function ( ) {
420+ const perviousData = this . getCopyPerviousData ( ) ;
421+ const data = this . getCopyData ( ) ;
422+ expect ( perviousData ) . toEqual ( _state ) ;
423+ expect ( perviousData ) . toEqual ( data ) ;
424+ expect ( perviousData !== null ) . toBe ( true ) ;
425+ } ) ;
426+ obj . updateStateRef ( _state , ( ) => { } ) ;
427+ obj . trigger ( 'onLoad' , obj . userProxy ) ;
428+ } ) ;
431429} ) ;
432430describe ( 'Api.prototype.setTab : ' , ( ) => {
433431 test ( 'it should call optionsManager.validateObjectiveTabData and validatePanelComponent internally' , ( ) => {
0 commit comments