@@ -748,17 +748,6 @@ describe('ranges', () => {
748748
749749 it ( 'should not reset formatters when switching between custom ranges and auto histogram' , ( ) => {
750750 const setStateSpy = jest . fn ( ) ;
751- ( state . layers . first . columns . col1 as RangeIndexPatternColumn ) . params . ranges . push ( {
752- from : null ,
753- to : null ,
754- label : '' ,
755- } ) ;
756-
757- // set a default formatter for the sourceField used
758- state . indexPatterns [ '1' ] . fieldFormatMap = {
759- MyField : { id : 'custom' , params : { } } ,
760- } ;
761-
762751 // now set a format on the range operation
763752 ( state . layers . first . columns . col1 as RangeIndexPatternColumn ) . params . format = {
764753 id : 'custom' ,
@@ -778,29 +767,12 @@ describe('ranges', () => {
778767
779768 // This series of act closures are made to make it work properly the update flush
780769 act ( ( ) => {
781- instance . find ( '.euiLink' ) . first ( ) . prop ( 'onClick' ) ! ( { } as ReactMouseEvent ) ;
770+ instance . find ( EuiLink ) . first ( ) . prop ( 'onClick' ) ! ( { } as ReactMouseEvent ) ;
771+ } ) ;
782772
783- expect ( setStateSpy ) . toHaveBeenCalledWith ( {
784- ...state ,
785- layers : {
786- first : {
787- ...state . layers . first ,
788- columns : {
789- ...state . layers . first . columns ,
790- col1 : {
791- ...state . layers . first . columns . col1 ,
792- params : {
793- ...state . layers . first . columns . col1 . params ,
794- format : {
795- id : 'custom' ,
796- params : { decimals : 3 } ,
797- } ,
798- } ,
799- } ,
800- } ,
801- } ,
802- } ,
803- } ) ;
773+ expect ( setStateSpy . mock . calls [ 1 ] [ 0 ] . layers . first . columns . col1 . params . format ) . toEqual ( {
774+ id : 'custom' ,
775+ params : { decimals : 3 } ,
804776 } ) ;
805777 } ) ;
806778 } ) ;
0 commit comments