From 78fb073c4e554bf20fb0e5148addb7d72c40c531 Mon Sep 17 00:00:00 2001 From: Julien Pinsonneau Date: Mon, 17 Jun 2024 15:48:08 +0200 Subject: [PATCH] fixes --- web/src/components/filters/filters-toolbar.tsx | 4 ++-- .../netflow-record/__tests__/record-field.spec.tsx | 4 ++-- web/src/components/netflow-record/record-field.tsx | 6 +++--- .../netflow-topology/__tests__/element-panel.spec.tsx | 9 +++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/web/src/components/filters/filters-toolbar.tsx b/web/src/components/filters/filters-toolbar.tsx index 10e86f7f2..1d3eaefdb 100644 --- a/web/src/components/filters/filters-toolbar.tsx +++ b/web/src/components/filters/filters-toolbar.tsx @@ -16,7 +16,7 @@ import { QuickFilter } from '../../model/quick-filters'; import { findFilter } from '../../utils/filter-definitions'; import { Indicator } from '../../utils/filters-helper'; import { localStorageShowFiltersKey, useLocalStorage } from '../../utils/local-storage-hook'; -import { QueryOptionsDropdown, QueryOptionsDropdownProps } from '../dropdowns/query-options-dropdown'; +import { QueryOptionsDropdown, QueryOptionsProps } from '../dropdowns/query-options-dropdown'; import { LinksOverflow } from '../overflow/links-overflow'; import AutocompleteFilter from './autocomplete-filter'; import CompareFilter, { FilterCompare } from './compare-filter'; @@ -35,7 +35,7 @@ export interface FiltersToolbarProps { setFilters: (v: Filters) => void; clearFilters: () => void; resetFilters: () => void; - queryOptionsProps: QueryOptionsDropdownProps; + queryOptionsProps: QueryOptionsProps; quickFilters: QuickFilter[]; filterDefinitions: FilterDefinition[]; isFullScreen: boolean; diff --git a/web/src/components/netflow-record/__tests__/record-field.spec.tsx b/web/src/components/netflow-record/__tests__/record-field.spec.tsx index e21d282dd..6f34f862c 100644 --- a/web/src/components/netflow-record/__tests__/record-field.spec.tsx +++ b/web/src/components/netflow-record/__tests__/record-field.spec.tsx @@ -54,7 +54,7 @@ describe('', () => { /> ); expect(wrapper.find(RecordField)).toBeTruthy(); - expect(wrapper.find('.record-field-content')).toHaveLength(1); - expect(wrapper.find('.record-field-content span').text()).toBe('< 1ms'); + expect(wrapper.find('.record-field-value')).toHaveLength(1); + expect(wrapper.find('.record-field-value').childAt(0).text()).toBe('< 1ms'); }); }); diff --git a/web/src/components/netflow-record/record-field.tsx b/web/src/components/netflow-record/record-field.tsx index 6d49fe03a..86d146081 100644 --- a/web/src/components/netflow-record/record-field.tsx +++ b/web/src/components/netflow-record/record-field.tsx @@ -68,7 +68,7 @@ export const RecordField: React.FC = ({
+ {text} ]} @@ -89,7 +89,7 @@ export const RecordField: React.FC = ({ if (errorText) { return errorTextValue(t('n/a'), errorText); } - return {t('n/a')}; + return {t('n/a')}; }; const emptyDnsErrorText = () => { @@ -106,7 +106,7 @@ export const RecordField: React.FC = ({ if (text) { return ( - + {text} diff --git a/web/src/components/netflow-topology/__tests__/element-panel.spec.tsx b/web/src/components/netflow-topology/__tests__/element-panel.spec.tsx index f5783770a..8afa5bbce 100644 --- a/web/src/components/netflow-topology/__tests__/element-panel.spec.tsx +++ b/web/src/components/netflow-topology/__tests__/element-panel.spec.tsx @@ -9,7 +9,8 @@ import { Filter } from '../../../model/filters'; import { FlowScope, MetricType } from '../../../model/flow-query'; import { NodeData } from '../../../model/topology'; import { createPeer } from '../../../utils/metrics'; -import { ElementPanel, ElementPanelDetailsContent } from '../element-panel'; +import { ElementPanel } from '../element-panel'; +import { ElementPanelContent } from '../element-panel-content'; import { ElementPanelMetrics } from '../element-panel-metrics'; import { dataSample } from '../__tests-data__/metrics'; @@ -62,8 +63,8 @@ describe('', () => { }); it('should render ', async () => { - const wrapper = mount(); - expect(wrapper.find(ElementPanelDetailsContent)).toBeTruthy(); + const wrapper = mount(); + expect(wrapper.find(ElementPanelContent)).toBeTruthy(); //check node infos expect(wrapper.find('#node-info-address').last().text()).toBe('IP10.129.0.15'); @@ -118,7 +119,7 @@ describe('', () => { }); it('should filter ', async () => { - const wrapper = mount(); + const wrapper = mount(); const ipFilters = wrapper.find(OptionsMenuToggle).last(); // Two buttons: first for pod filter, second for IP filter => click on second ipFilters.last().simulate('click');