Skip to content

Commit b99b85f

Browse files
committed
fix tests
1 parent 7771844 commit b99b85f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

web/src/components/netflow-record/__tests__/record-field.spec.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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(

web/src/components/netflow-table/netflow-table.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)