mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-24 09:58:21 +03:00
28 lines
830 B
JavaScript
28 lines
830 B
JavaScript
import { shallow } from 'enzyme';
|
|
import React from 'react';
|
|
import { NavLink } from 'react-router-dom';
|
|
import asideMenuCreator from '../../src/common/AsideMenu';
|
|
|
|
describe('<AsideMenu />', () => {
|
|
let wrapped;
|
|
const DeleteServerButton = () => '';
|
|
|
|
beforeEach(() => {
|
|
const AsideMenu = asideMenuCreator(DeleteServerButton);
|
|
|
|
wrapped = shallow(<AsideMenu selectedServer={{ id: 'abc123' }} />);
|
|
});
|
|
afterEach(() => wrapped.unmount());
|
|
|
|
it('contains links to different sections', () => {
|
|
const links = wrapped.find(NavLink);
|
|
const expectedLength = 3;
|
|
|
|
expect(links).toHaveLength(expectedLength);
|
|
links.forEach((link) => expect(link.prop('to')).toContain('abc123'));
|
|
});
|
|
|
|
it('contains a button to delete server', () => {
|
|
expect(wrapped.find(DeleteServerButton)).toHaveLength(1);
|
|
});
|
|
});
|