Fixed tests

This commit is contained in:
Alejandro Celaya
2018-12-18 10:23:09 +01:00
parent 4f54e3315f
commit 79a0a5e4ea
6 changed files with 23 additions and 23 deletions

View File

@@ -29,9 +29,6 @@ describe('selectedServerReducer', () => {
});
describe('selectServer', () => {
const ShlinkApiClientMock = {
setConfig: sinon.spy(),
};
const serverId = 'abc123';
const selectedServer = {
id: serverId,
@@ -41,7 +38,6 @@ describe('selectedServerReducer', () => {
};
afterEach(() => {
ShlinkApiClientMock.setConfig.resetHistory();
ServersServiceMock.findServerById.resetHistory();
});
@@ -49,7 +45,7 @@ describe('selectedServerReducer', () => {
const dispatch = sinon.spy();
const expectedDispatchCalls = 2;
_selectServer(ShlinkApiClientMock, ServersServiceMock)(serverId)(dispatch);
_selectServer(ServersServiceMock)(serverId)(dispatch);
expect(dispatch.callCount).toEqual(expectedDispatchCalls);
expect(dispatch.firstCall.calledWith({ type: RESET_SHORT_URL_PARAMS })).toEqual(true);
@@ -60,9 +56,8 @@ describe('selectedServerReducer', () => {
});
it('invokes dependencies', () => {
_selectServer(ShlinkApiClientMock, ServersServiceMock)(serverId)(() => {});
_selectServer(ServersServiceMock)(serverId)(() => {});
expect(ShlinkApiClientMock.setConfig.callCount).toEqual(1);
expect(ServersServiceMock.findServerById.callCount).toEqual(1);
});
});