mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
We want to upgrade to React 17, but Reach Router does not work with React 17: https://github.com/reach/router/issues/429 Also, the Reach + React Router projects announced an intention to join forces and just continue as React Router: https://reacttraining.com/blog/reach-react-router-future/ Signed-off-by: Julius Volz <julius.volz@gmail.com>
44 lines
935 B
TypeScript
Executable file
44 lines
935 B
TypeScript
Executable file
import * as React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import App from './App';
|
|
import Navigation from './Navbar';
|
|
import { Container } from 'reactstrap';
|
|
import { Route } from 'react-router-dom';
|
|
import {
|
|
AlertsPage,
|
|
ConfigPage,
|
|
FlagsPage,
|
|
RulesPage,
|
|
ServiceDiscoveryPage,
|
|
StatusPage,
|
|
TargetsPage,
|
|
TSDBStatusPage,
|
|
PanelListPage,
|
|
} from './pages';
|
|
|
|
describe('App', () => {
|
|
const app = shallow(<App />);
|
|
|
|
it('navigates', () => {
|
|
expect(app.find(Navigation)).toHaveLength(1);
|
|
});
|
|
it('routes', () => {
|
|
[
|
|
AlertsPage,
|
|
ConfigPage,
|
|
FlagsPage,
|
|
RulesPage,
|
|
ServiceDiscoveryPage,
|
|
StatusPage,
|
|
TargetsPage,
|
|
TSDBStatusPage,
|
|
PanelListPage,
|
|
].forEach(component => {
|
|
const c = app.find(component);
|
|
expect(c).toHaveLength(1);
|
|
});
|
|
expect(app.find(Route)).toHaveLength(9);
|
|
expect(app.find(Container)).toHaveLength(1);
|
|
});
|
|
});
|