mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-08 17:27:32 +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));
|
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 React from 'react';
|
||||||
import { ServersDropdown } from '../../src/servers/ServersDropdown';
|
import { ServersDropdown } from '../../src/servers/ServersDropdown';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
describe('ServersDropdown', () => {
|
describe('<ServersDropdown />', () => {
|
||||||
let wrapped;
|
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(() => {
|
beforeEach(() => {
|
||||||
wrapped = shallow(<ServersDropdown servers={servers} />);
|
wrapped = shallow(<ServersDropdown servers={servers} listServers={identity} />);
|
||||||
});
|
|
||||||
afterEach(() => {
|
|
||||||
wrapped.unmount();
|
|
||||||
});
|
});
|
||||||
|
afterEach(() => wrapped.unmount());
|
||||||
|
|
||||||
it('contains the list of servers', () => {
|
it('contains the list of servers', () => {
|
||||||
expect(wrapped.find('DropdownItem').length).toEqual(servers.length);
|
expect(wrapped.find('DropdownItem').length).toEqual(servers.length);
|
||||||
|
|
Loading…
Reference in a new issue