mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-31 21:38:19 +03:00
Created AsideMenu component test
This commit is contained in:
parent
34155aae58
commit
faa828c58a
1 changed files with 25 additions and 0 deletions
25
test/common/AsideMenu.test.js
Normal file
25
test/common/AsideMenu.test.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { shallow } from 'enzyme'
|
||||
import React from 'react'
|
||||
import AsideMenu from '../../src/common/AsideMenu'
|
||||
|
||||
describe('<AsideMenu />', () => {
|
||||
let wrapped;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapped = shallow(<AsideMenu selectedServer={{ id: 'abc123' }} />);
|
||||
});
|
||||
afterEach(() => {
|
||||
wrapped.unmount();
|
||||
});
|
||||
|
||||
it('contains links to selected server', () => {
|
||||
const links = wrapped.find('NavLink');
|
||||
|
||||
expect(links).toHaveLength(2);
|
||||
links.forEach(link => expect(link.prop('to')).toContain('abc123'));
|
||||
});
|
||||
|
||||
it('contains a button to delete server', () => {
|
||||
expect(wrapped.find('DeleteServerButton')).toHaveLength(1);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue