mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-22 17:10:26 +03:00
Fixed tests
This commit is contained in:
parent
86a1cdf4d1
commit
3eaa66435a
2 changed files with 7 additions and 7 deletions
|
@ -14,4 +14,5 @@ export class Storage {
|
|||
set = (key, value) => this.localStorage.setItem(buildPath(key), JSON.stringify(value));
|
||||
}
|
||||
|
||||
export default new Storage(localStorage);
|
||||
const storage = typeof localStorage !== 'undefined' ? localStorage : {};
|
||||
export default new Storage(storage);
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
import { identity } from 'ramda';
|
||||
import React from 'react';
|
||||
import { ServersDropdown } from '../../src/servers/ServersDropdown';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
describe('ServersDropdown', () => {
|
||||
describe('<ServersDropdown />', () => {
|
||||
let wrapped;
|
||||
const servers = [{ name: 'foo' }, { name: 'bar' }, { name: 'baz' }];
|
||||
const servers = [{ name: 'foo', id: 1 }, { name: 'bar', id: 2 }, { name: 'baz', id: 3 }];
|
||||
|
||||
beforeEach(() => {
|
||||
wrapped = shallow(<ServersDropdown servers={servers} />);
|
||||
});
|
||||
afterEach(() => {
|
||||
wrapped.unmount();
|
||||
wrapped = shallow(<ServersDropdown servers={servers} listServers={identity} />);
|
||||
});
|
||||
afterEach(() => wrapped.unmount());
|
||||
|
||||
it('contains the list of servers', () => {
|
||||
expect(wrapped.find('DropdownItem').length).toEqual(servers.length);
|
||||
|
|
Loading…
Reference in a new issue