mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
* dynamically determine path prefix Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * minor changes per PR review Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * use Context for apiPath and pathPrefix Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * remove unhandled "/version" path Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * only process index once instead of on every req Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * remove unneeded tag fragment Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * switch api path to const Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * revert Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * update tests Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * linter updates Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * simplify Signed-off-by: James Ranson <james_ranson@cable.comcast.com> * updates per peer review Signed-off-by: James Ranson <james_ranson@cable.comcast.com>
24 lines
782 B
TypeScript
Executable file
24 lines
782 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 { Router } from '@reach/router';
|
|
import { Alerts, Config, Flags, Rules, ServiceDiscovery, Status, Targets, TSDBStatus, PanelList } from './pages';
|
|
|
|
describe('App', () => {
|
|
const app = shallow(<App />);
|
|
|
|
it('navigates', () => {
|
|
expect(app.find(Navigation)).toHaveLength(1);
|
|
});
|
|
it('routes', () => {
|
|
[Alerts, Config, Flags, Rules, ServiceDiscovery, Status, Targets, TSDBStatus, PanelList].forEach(component => {
|
|
const c = app.find(component);
|
|
expect(c).toHaveLength(1);
|
|
});
|
|
expect(app.find(Router)).toHaveLength(1);
|
|
expect(app.find(Container)).toHaveLength(1);
|
|
});
|
|
});
|