@@ -541,12 +541,7 @@ describe('onChange callback : ', () => {
541541 currentData . selectedTabID = '6' ;
542542 previousData . selectedTabID = '6' ;
543543 } ) ;
544- const onChange2 = jest . fn ( ( { currentData, previousData, closedTabIDs, openedTabIDs} ) => {
545- closedTabIDs . push ( '7' ) ;
546- openedTabIDs . push ( '7' ) ;
547- currentData . selectedTabID = '7' ;
548- previousData . selectedTabID = '7' ;
549- } ) ;
544+ const onChange2 = jest . fn ( ( { currentData, previousData, closedTabIDs, openedTabIDs} ) => { } ) ;
550545 const onOpen = jest . fn ( ( ) => { } ) ;
551546 const onClose = jest . fn ( ( ) => { } ) ;
552547 const onSelect = jest . fn ( ( ) => { } ) ;
@@ -595,6 +590,9 @@ describe('onChange callback : ', () => {
595590 expect ( this . hasOwnProperty ( 'getData' ) ) . toBe ( true ) ;
596591 } ) ;
597592 renderApp ( ) ;
593+ act ( ( ) => {
594+ instance . select ( '2' ) ;
595+ } ) ;
598596 op . onChange = function ( ) { } ;
599597 } ) ;
600598} ) ;
@@ -620,9 +618,7 @@ describe('onSelect callback : ', () => {
620618 const onSelect1 = jest . fn ( ( param ) => {
621619 param . previousSelectedTabId = 19 ;
622620 } ) ;
623- const onSelect2 = jest . fn ( ( param ) => {
624- param . previousSelectedTabId = 20 ;
625- } ) ;
621+ const onSelect2 = jest . fn ( ( param ) => { } ) ;
626622 act ( ( ) => {
627623 instance . setOption ( 'onSelect' , ( param ) => {
628624 param . currentSelectedTabId = 10 ;
@@ -644,6 +640,9 @@ describe('onSelect callback : ', () => {
644640 expect ( this . hasOwnProperty ( 'getData' ) ) . toBe ( true ) ;
645641 } ) ;
646642 renderApp ( ) ;
643+ act ( ( ) => {
644+ instance . select ( '2' ) ;
645+ } ) ;
647646 op . onSelect = function ( ) { } ;
648647 } ) ;
649648} ) ;
@@ -686,9 +685,7 @@ describe('onFirstSelect callback : ', () => {
686685 const onFirstSelect1 = jest . fn ( ( param ) => {
687686 param . previousSelectedTabId = 19 ;
688687 } ) ;
689- const onFirstSelect2 = jest . fn ( ( param ) => {
690- param . previousSelectedTabId = 20 ;
691- } ) ;
688+ const onFirstSelect2 = jest . fn ( ( param ) => { } ) ;
692689 act ( ( ) => {
693690 instance . setOption ( 'onFirstSelect' , ( param ) => {
694691 param . currentSelectedTabId = 10 ;
@@ -709,6 +706,9 @@ describe('onFirstSelect callback : ', () => {
709706 expect ( this . hasOwnProperty ( 'getData' ) ) . toBe ( true ) ;
710707 } ) ;
711708 renderApp ( ) ;
709+ act ( ( ) => {
710+ instance . select ( '2' ) ;
711+ } ) ;
712712 op . onFirstSelect = function ( ) { } ;
713713 } ) ;
714714} ) ;
@@ -730,9 +730,7 @@ describe('onOpen callback : ', () => {
730730 const onOpen1 = jest . fn ( ( openedTabIDs ) => {
731731 openedTabIDs . push ( '5' ) ;
732732 } ) ;
733- const onOpen2 = jest . fn ( ( openedTabIDs ) => {
734- openedTabIDs . push ( '6' ) ;
735- } ) ;
733+ const onOpen2 = jest . fn ( ( openedTabIDs ) => { } ) ;
736734 act ( ( ) => {
737735 instance . setOption ( 'onOpen' , ( openedTabIDs ) => {
738736 openedTabIDs . push ( '4' ) ;
@@ -750,6 +748,9 @@ describe('onOpen callback : ', () => {
750748 expect ( this . hasOwnProperty ( 'getData' ) ) . toBe ( true ) ;
751749 } ) ;
752750 renderApp ( ) ;
751+ act ( ( ) => {
752+ instance . open ( { id :'3' } ) ;
753+ } ) ;
753754 op . onOpen = function ( ) { } ;
754755 } ) ;
755756} ) ;
@@ -771,9 +772,7 @@ describe('onClose callback : ', () => {
771772 const onClose1 = jest . fn ( ( closedTabIDs ) => {
772773 closedTabIDs . push ( '4' ) ;
773774 } ) ;
774- const onClose2 = jest . fn ( ( closedTabIDs ) => {
775- closedTabIDs . push ( '5' ) ;
776- } ) ;
775+ const onClose2 = jest . fn ( ( closedTabIDs ) => { } ) ;
777776 act ( ( ) => {
778777 instance . setOption ( 'onClose' , ( closedTabIDs ) => {
779778 closedTabIDs . push ( '3' ) ;
@@ -791,6 +790,9 @@ describe('onClose callback : ', () => {
791790 expect ( this . hasOwnProperty ( 'getData' ) ) . toBe ( true ) ;
792791 } ) ;
793792 renderApp ( ) ;
793+ act ( ( ) => {
794+ instance . close ( '2' ) ;
795+ } ) ;
794796 op . onClose = function ( ) { } ;
795797 } ) ;
796798} ) ;
0 commit comments