Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.15] OCPBUGS-25707: fix Observe tab in Topology overview #13462

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import { useDispatch } from 'react-redux';
import { BrowserRouter, Link } from 'react-router-dom-v5-compat';
import { Link } from 'react-router-dom-v5-compat';
import { dashboardsSetEndTime, dashboardsSetTimespan } from '@console/internal/actions/observe';
import { Humanize } from '@console/internal/components/utils';
import { QueryBrowser } from '@console/shared/src/components/query-browser';
Expand Down Expand Up @@ -78,15 +78,13 @@ export const MonitoringDashboardGraph: React.FC<MonitoringDashboardGraphProps> =
<CardHeader
actions={{
actions: (
<BrowserRouter>
<PrometheusGraphLink
namespace={namespace}
query={query}
ariaChartLinkLabel={t('devconsole~View metrics for {{title}}', {
title,
})}
/>
</BrowserRouter>
<PrometheusGraphLink
namespace={namespace}
query={query}
ariaChartLinkLabel={t('devconsole~View metrics for {{title}}', {
title,
})}
/>
),
hasNoOffset: false,
className: 'co-overview-card__actions',
Expand Down
Expand Up @@ -3,6 +3,7 @@ import { screen, render } from '@testing-library/react';
import { shallow } from 'enzyme';
import '@testing-library/jest-dom';
import * as redux from 'react-redux';
import { BrowserRouter } from 'react-router-dom-v5-compat';
import { QueryBrowser } from '@console/shared/src/components/query-browser';
import { t } from '../../../../../../../__mocks__/i18next';
import { monitoringDashboardQueries } from '../../queries';
Expand Down Expand Up @@ -43,7 +44,11 @@ describe('Monitoring Dashboard graph', () => {

it('should add link to line graph', () => {
monitoringDashboardGraphProps.graphType = GraphTypes.line;
render(<MonitoringDashboardGraph {...monitoringDashboardGraphProps} />);
render(
<BrowserRouter>
<MonitoringDashboardGraph {...monitoringDashboardGraphProps} />
</BrowserRouter>,
);

const link = screen.getByRole('link', { name: 'View metrics for Memory usage' });

Expand Down