mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-28 20:56:42 +00:00
Extracted short-url related services to its own service provider
This commit is contained in:
@@ -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 = () => ({
|
||||
|
||||
@@ -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' }];
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user