Implemented loading of short URLs

This commit is contained in:
Alejandro Celaya
2018-06-15 21:49:25 +02:00
parent e4356720d7
commit c0203f1336
16 changed files with 191 additions and 33 deletions

View 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);
});
});