2020-02-08 02:00:48 -08:00
|
|
|
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', () => {
|
2020-02-09 04:39:44 -08:00
|
|
|
const app = shallow(<Navigation pathPrefix="/path/prefix" consolesLink={null} />);
|
2020-02-08 02:00:48 -08:00
|
|
|
expect(
|
|
|
|
app.contains(
|
|
|
|
<NavItem>
|
|
|
|
<NavLink>Consoles</NavLink>
|
|
|
|
</NavItem>
|
|
|
|
)
|
|
|
|
).toBeFalsy();
|
|
|
|
});
|
|
|
|
});
|