mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-17 02:54:05 -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>
31 lines
838 B
TypeScript
31 lines
838 B
TypeScript
import * as React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import Navigation from './Navbar';
|
|
import { NavItem, NavLink } from 'reactstrap';
|
|
|
|
describe('Navbar should contain console Link', () => {
|
|
it('with non-empty consoleslink', () => {
|
|
const app = shallow(<Navigation consolesLink="/path/consoles" agentMode={false} />);
|
|
expect(
|
|
app.contains(
|
|
<NavItem>
|
|
<NavLink href="/path/consoles">Consoles</NavLink>
|
|
</NavItem>
|
|
)
|
|
).toBeTruthy();
|
|
});
|
|
});
|
|
|
|
describe('Navbar should not contain consoles link', () => {
|
|
it('with empty string in consolesLink', () => {
|
|
const app = shallow(<Navigation consolesLink={null} agentMode={false} />);
|
|
expect(
|
|
app.contains(
|
|
<NavItem>
|
|
<NavLink>Consoles</NavLink>
|
|
</NavItem>
|
|
)
|
|
).toBeFalsy();
|
|
});
|
|
});
|