mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-19 04:56:17 +00:00
Fixed tests
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user