mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-18 03:24:05 -08:00
0a8acb654e
Signed-off-by: Julius Volz <julius.volz@gmail.com>
31 lines
854 B
TypeScript
31 lines
854 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 pathPrefix="/path/prefix" consolesLink="/path/consoles" />);
|
|
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 pathPrefix="/path/prefix" consolesLink={null} />);
|
|
expect(
|
|
app.contains(
|
|
<NavItem>
|
|
<NavLink>Consoles</NavLink>
|
|
</NavItem>
|
|
)
|
|
).toBeFalsy();
|
|
});
|
|
});
|