mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-01 00:47:26 -08:00
4e3b6fc043
* Upgrade create-react-app to v5 Some other dependencies needs to be upgraded as well, plus some typescript errors fixed. Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com> * Use ESM imports for codemirror-promql Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com> * Update FontAwesome to v6 Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
46 lines
1,006 B
TypeScript
Executable file
46 lines
1,006 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 {
|
|
AgentPage,
|
|
AlertsPage,
|
|
ConfigPage,
|
|
FlagsPage,
|
|
RulesPage,
|
|
ServiceDiscoveryPage,
|
|
StatusPage,
|
|
TargetsPage,
|
|
TSDBStatusPage,
|
|
PanelListPage,
|
|
} from './pages';
|
|
|
|
describe('App', () => {
|
|
const app = shallow(<App consolesLink={null} agentMode={false} />);
|
|
|
|
it('navigates', () => {
|
|
expect(app.find(Navigation)).toHaveLength(1);
|
|
});
|
|
it('routes', () => {
|
|
[
|
|
AgentPage,
|
|
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(10);
|
|
expect(app.find(Container)).toHaveLength(1);
|
|
});
|
|
});
|