Migrated shortUrlsList reducer to RTK

This commit is contained in:
Alejandro Celaya
2022-11-09 19:13:44 +01:00
parent ae49090bad
commit 7bfccafca8
12 changed files with 184 additions and 160 deletions

View File

@@ -1,12 +1,16 @@
import { Mock } from 'ts-mockery';
import { shortUrlDeletionReducerCreator } from '../../../src/short-urls/reducers/shortUrlDeletion';
import {
shortUrlDeletionReducerCreator,
deleteShortUrl as deleteShortUrlCretor,
} from '../../../src/short-urls/reducers/shortUrlDeletion';
import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import { ProblemDetailsError } from '../../../src/api/types/errors';
describe('shortUrlDeletionReducer', () => {
const deleteShortUrlCall = jest.fn();
const buildShlinkApiClient = () => Mock.of<ShlinkApiClient>({ deleteShortUrl: deleteShortUrlCall });
const { reducer, resetDeleteShortUrl, deleteShortUrl } = shortUrlDeletionReducerCreator(buildShlinkApiClient);
const deleteShortUrl = deleteShortUrlCretor(buildShlinkApiClient);
const { reducer, resetDeleteShortUrl } = shortUrlDeletionReducerCreator(deleteShortUrl);
beforeEach(jest.clearAllMocks);