File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ describe('<RecordField />', () => {
1818 //datetime column will produce a single field
1919 const wrapper = shallow ( < RecordField flow = { FlowsSample [ 0 ] } column = { DefaultColumns [ 0 ] } { ...mocks } /> ) ;
2020 expect ( wrapper . find ( RecordField ) ) . toBeTruthy ( ) ;
21- expect ( wrapper . find ( '.record-field-content' ) ) . toHaveLength ( 1 ) ;
22- expect ( wrapper . find ( '.m' ) ) . toHaveLength ( 1 ) ;
21+ expect ( wrapper . find ( '.record-field-content.m' ) ) . toHaveLength ( 1 ) ;
2322 } ) ;
2423 it ( 'should filter' , async ( ) => {
2524 const wrapper = shallow (
Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ const NetflowTable: React.FC<{
8080 const containsDoubleLine = columns . find ( c => doubleSizeColumnIds . includes ( c . id ) ) !== undefined ;
8181
8282 function convertRemToPixels ( rem : number ) {
83- return rem * parseFloat ( getComputedStyle ( document . documentElement ) . fontSize ) ;
83+ //get fontSize from document or fallback to 16 for jest
84+ return rem * ( parseFloat ( getComputedStyle ( document . documentElement ) . fontSize ) || 16 ) ;
8485 }
8586
8687 switch ( size ) {
@@ -92,7 +93,7 @@ const NetflowTable: React.FC<{
9293 default :
9394 return convertRemToPixels ( containsDoubleLine ? 4 : 2.5 ) ;
9495 }
95- // eslint-disable-next-line react-hooks/exhaustive-deps
96+ // eslint-disable-next-line react-hooks/exhaustive-deps
9697 } , [ columns , size ] ) ;
9798
9899 //update table container height on window resize
You can’t perform that action at this time.
0 commit comments