mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-12 10:33:49 +00:00
Setup tests environment
This commit is contained in:
23
tests/servers/ServersDropdown.test.js
Normal file
23
tests/servers/ServersDropdown.test.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import React from 'react';
|
||||
import { ServersDropdown } from '../../src/servers/ServersDropdown';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
describe('ServersDropdown', () => {
|
||||
let wrapped;
|
||||
const servers = [{ name: 'foo' }, { name: 'bar' }, { name: 'baz' }];
|
||||
|
||||
beforeEach(() => {
|
||||
wrapped = shallow(<ServersDropdown servers={servers} />);
|
||||
});
|
||||
afterEach(() => {
|
||||
wrapped.unmount();
|
||||
});
|
||||
|
||||
it('contains the list of servers', () => {
|
||||
expect(wrapped.find('DropdownItem').length).toEqual(servers.length);
|
||||
});
|
||||
|
||||
it('contains a toggle with proper title', () => {
|
||||
expect(wrapped.find('DropdownToggle').length).toEqual(1);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user