mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-08-01 08:31:52 +00:00
Fix incorrect types between testing library and vitest
This commit is contained in:
@@ -14,8 +14,6 @@ describe('shortUrlCreationReducer', () => {
|
||||
const createShortUrl = createShortUrlCreator(buildShlinkApiClient);
|
||||
const { reducer, resetCreateShortUrl } = shortUrlCreationReducerCreator(createShortUrl);
|
||||
|
||||
afterEach(vi.resetAllMocks);
|
||||
|
||||
describe('reducer', () => {
|
||||
it('returns loading on CREATE_SHORT_URL_START', () => {
|
||||
expect(reducer(undefined, createShortUrl.pending('', fromPartial({})))).toEqual({
|
||||
|
||||
@@ -12,8 +12,6 @@ describe('shortUrlDeletionReducer', () => {
|
||||
const deleteShortUrl = deleteShortUrlCreator(buildShlinkApiClient);
|
||||
const { reducer, resetDeleteShortUrl } = shortUrlDeletionReducerCreator(deleteShortUrl);
|
||||
|
||||
beforeEach(vi.clearAllMocks);
|
||||
|
||||
describe('reducer', () => {
|
||||
it('returns loading on DELETE_SHORT_URL_START', () =>
|
||||
expect(reducer(undefined, deleteShortUrl.pending('', { shortCode: '' }))).toEqual({
|
||||
|
||||
@@ -10,8 +10,6 @@ describe('shortUrlDetailReducer', () => {
|
||||
const buildShlinkApiClient = () => fromPartial<ShlinkApiClient>({ getShortUrl: getShortUrlCall });
|
||||
const { reducer, getShortUrlDetail } = shortUrlDetailReducerCreator(buildShlinkApiClient);
|
||||
|
||||
beforeEach(vi.clearAllMocks);
|
||||
|
||||
describe('reducer', () => {
|
||||
it('returns loading on GET_SHORT_URL_DETAIL_START', () => {
|
||||
const { loading } = reducer({ loading: false, error: false }, getShortUrlDetail.pending('', { shortCode: '' }));
|
||||
|
||||
@@ -16,8 +16,6 @@ describe('shortUrlEditionReducer', () => {
|
||||
const editShortUrl = editShortUrlCreator(buildShlinkApiClient);
|
||||
const { reducer } = shortUrlEditionReducerCreator(editShortUrl);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
describe('reducer', () => {
|
||||
it('returns loading on EDIT_SHORT_URL_START', () => {
|
||||
expect(reducer(undefined, editShortUrl.pending('', fromPartial({})))).toEqual({
|
||||
@@ -51,8 +49,6 @@ describe('shortUrlEditionReducer', () => {
|
||||
selectedServer,
|
||||
});
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it.each([[undefined], [null], ['example.com']])('dispatches short URL on success', async (domain) => {
|
||||
await editShortUrl({ shortCode, domain, data: { longUrl } })(dispatch, createGetState(), {});
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ describe('shortUrlsListReducer', () => {
|
||||
const createShortUrl = createShortUrlCreator(buildShlinkApiClient);
|
||||
const { reducer } = shortUrlsListReducerCreator(listShortUrls, editShortUrl, createShortUrl);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
describe('reducer', () => {
|
||||
it('returns loading on LIST_SHORT_URLS_START', () =>
|
||||
expect(reducer(undefined, listShortUrls.pending(''))).toEqual({
|
||||
|
||||
Reference in New Issue
Block a user