2019-10-28 10:09:48 -07:00
|
|
|
import * as React from 'react';
|
|
|
|
import { shallow } from 'enzyme';
|
|
|
|
import App from './App';
|
|
|
|
import Navigation from './Navbar';
|
|
|
|
import { Container } from 'reactstrap';
|
|
|
|
import { Router } from '@reach/router';
|
2021-06-15 13:37:16 -07:00
|
|
|
import {
|
|
|
|
AlertsPage,
|
|
|
|
ConfigPage,
|
|
|
|
FlagsPage,
|
|
|
|
RulesPage,
|
|
|
|
ServiceDiscoveryPage,
|
|
|
|
StatusPage,
|
|
|
|
TargetsPage,
|
|
|
|
TSDBStatusPage,
|
|
|
|
PanelListPage,
|
|
|
|
} from './pages';
|
2019-10-28 10:09:48 -07:00
|
|
|
|
|
|
|
describe('App', () => {
|
2020-10-22 08:22:32 -07:00
|
|
|
const app = shallow(<App />);
|
2019-10-28 10:09:48 -07:00
|
|
|
|
|
|
|
it('navigates', () => {
|
|
|
|
expect(app.find(Navigation)).toHaveLength(1);
|
|
|
|
});
|
|
|
|
it('routes', () => {
|
2021-06-15 13:37:16 -07:00
|
|
|
[
|
|
|
|
AlertsPage,
|
|
|
|
ConfigPage,
|
|
|
|
FlagsPage,
|
|
|
|
RulesPage,
|
|
|
|
ServiceDiscoveryPage,
|
|
|
|
StatusPage,
|
|
|
|
TargetsPage,
|
|
|
|
TSDBStatusPage,
|
|
|
|
PanelListPage,
|
|
|
|
].forEach(component => {
|
2019-11-04 00:17:50 -08:00
|
|
|
const c = app.find(component);
|
|
|
|
expect(c).toHaveLength(1);
|
|
|
|
});
|
2019-10-28 10:09:48 -07:00
|
|
|
expect(app.find(Router)).toHaveLength(1);
|
|
|
|
expect(app.find(Container)).toHaveLength(1);
|
|
|
|
});
|
|
|
|
});
|