Extracted short-url related services to its own service provider

This commit is contained in:
Alejandro Celaya
2018-12-18 19:59:50 +01:00
parent cf1239cf6e
commit 4b1f5e9f4c
16 changed files with 94 additions and 121 deletions

View File

@@ -1,5 +1,5 @@
import sinon from 'sinon';
import { ServersExporter } from '../../../src/servers/services/ServersExporter';
import ServersExporter from '../../../src/servers/services/ServersExporter';
describe('ServersExporter', () => {
const createLinkMock = () => ({

View File

@@ -1,5 +1,5 @@
import sinon from 'sinon';
import { ServersImporter } from '../../../src/servers/services/ServersImporter';
import ServersImporter from '../../../src/servers/services/ServersImporter';
describe('ServersImporter', () => {
const servers = [{ name: 'foo' }, { name: 'bar' }];

View File

@@ -1,6 +1,6 @@
import sinon from 'sinon';
import { last } from 'ramda';
import { ServersService } from '../../../src/servers/services/ServersService';
import ServersService from '../../../src/servers/services/ServersService';
describe('ServersService', () => {
const servers = {

View File

@@ -4,7 +4,7 @@ import reducer, {
CREATE_SHORT_URL_ERROR,
CREATE_SHORT_URL,
RESET_CREATE_SHORT_URL,
_createShortUrl,
createShortUrl,
resetCreateShortUrl,
} from '../../../src/short-urls/reducers/shortUrlCreation';
@@ -62,7 +62,7 @@ describe('shortUrlCreationReducer', () => {
const expectedDispatchCalls = 2;
const result = 'foo';
const apiClientMock = createApiClientMock(Promise.resolve(result));
const dispatchable = _createShortUrl(() => apiClientMock, {});
const dispatchable = createShortUrl(() => apiClientMock)({});
await dispatchable(dispatch, getState);
@@ -77,7 +77,7 @@ describe('shortUrlCreationReducer', () => {
const expectedDispatchCalls = 2;
const error = 'Error';
const apiClientMock = createApiClientMock(Promise.reject(error));
const dispatchable = _createShortUrl(() => apiClientMock, {});
const dispatchable = createShortUrl(() => apiClientMock)({});
try {
await dispatchable(dispatch, getState);

View File

@@ -1,5 +1,5 @@
import * as sinon from 'sinon';
import { ColorGenerator } from '../../src/utils/ColorGenerator';
import ColorGenerator from '../../src/utils/ColorGenerator';
describe('ColorGenerator', () => {
let colorGenerator;