Fixed DeleteShortUrlModal being removed from the DOM before CSS transition finished

This commit is contained in:
Alejandro Celaya
2022-11-22 19:39:07 +01:00
parent bc2c945fee
commit d21758c410
6 changed files with 36 additions and 23 deletions

View File

@@ -3,7 +3,7 @@ import {
listShortUrls as listShortUrlsCreator,
shortUrlsListReducerCreator,
} from '../../../src/short-urls/reducers/shortUrlsList';
import { deleteShortUrl as deleteShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlDeletion';
import { shortUrlDeleted } from '../../../src/short-urls/reducers/shortUrlDeletion';
import { ShlinkPaginator, ShlinkShortUrlsResponse } from '../../../src/api/types';
import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation';
import { editShortUrl as editShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlEdition';
@@ -18,8 +18,7 @@ describe('shortUrlsListReducer', () => {
const listShortUrls = listShortUrlsCreator(buildShlinkApiClient);
const editShortUrl = editShortUrlCreator(buildShlinkApiClient);
const createShortUrl = createShortUrlCreator(buildShlinkApiClient);
const deleteShortUrl = deleteShortUrlCreator(buildShlinkApiClient);
const { reducer } = shortUrlsListReducerCreator(listShortUrls, editShortUrl, createShortUrl, deleteShortUrl);
const { reducer } = shortUrlsListReducerCreator(listShortUrls, editShortUrl, createShortUrl);
afterEach(jest.clearAllMocks);
@@ -59,7 +58,7 @@ describe('shortUrlsListReducer', () => {
error: false,
};
expect(reducer(state, { type: deleteShortUrl.fulfilled.toString(), payload: { shortCode } })).toEqual({
expect(reducer(state, { type: shortUrlDeleted.toString(), payload: { shortCode } })).toEqual({
shortUrls: {
data: [{ shortCode, domain: 'example.com' }, { shortCode: 'foo' }],
pagination: { totalItems: 9 },