Moved all server-related services to its own service provider

This commit is contained in:
Alejandro Celaya
2018-12-18 19:45:09 +01:00
parent 566322a8c5
commit cf1239cf6e
7 changed files with 88 additions and 84 deletions

View File

@@ -1,8 +1,8 @@
import * as sinon from 'sinon';
import reducer, {
_selectServer,
RESET_SELECTED_SERVER,
selectServer,
resetSelectedServer,
RESET_SELECTED_SERVER,
SELECT_SERVER,
} from '../../../src/servers/reducers/selectedServer';
import { RESET_SHORT_URL_PARAMS } from '../../../src/short-urls/reducers/shortUrlsListParams';
@@ -45,7 +45,7 @@ describe('selectedServerReducer', () => {
const dispatch = sinon.spy();
const expectedDispatchCalls = 2;
_selectServer(ServersServiceMock)(serverId)(dispatch);
selectServer(ServersServiceMock)(serverId)(dispatch);
expect(dispatch.callCount).toEqual(expectedDispatchCalls);
expect(dispatch.firstCall.calledWith({ type: RESET_SHORT_URL_PARAMS })).toEqual(true);
@@ -56,7 +56,7 @@ describe('selectedServerReducer', () => {
});
it('invokes dependencies', () => {
_selectServer(ServersServiceMock)(serverId)(() => {});
selectServer(ServersServiceMock)(serverId)(() => {});
expect(ServersServiceMock.findServerById.callCount).toEqual(1);
});