Created shortUrlVisits reducer test

This commit is contained in:
Alejandro Celaya
2018-09-08 08:49:49 +02:00
parent bbce53ade6
commit 0c1656285b
3 changed files with 99 additions and 4 deletions

View File

@@ -66,6 +66,7 @@ describe('shortUrlDetailReducer', () => {
const { type: secondCallType } = secondCallArg;
expect(dispatchMock.callCount).toEqual(expectedDispatchCalls);
expect(ShlinkApiClient.getShortUrl.callCount).toEqual(1);
expect(firstCallType).toEqual(GET_SHORT_URL_DETAIL_START);
expect(secondCallType).toEqual(GET_SHORT_URL_DETAIL_ERROR);
});
@@ -84,6 +85,7 @@ describe('shortUrlDetailReducer', () => {
const { type: secondCallType, shortUrl } = secondCallArg;
expect(dispatchMock.callCount).toEqual(expectedDispatchCalls);
expect(ShlinkApiClient.getShortUrl.callCount).toEqual(1);
expect(firstCallType).toEqual(GET_SHORT_URL_DETAIL_START);
expect(secondCallType).toEqual(GET_SHORT_URL_DETAIL);
expect(shortUrl).toEqual(resolvedShortUrl);