mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-18 05:23:49 +00:00
Uninstalled jest-each and replaced by jest's native each
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import each from 'jest-each';
|
||||
import reducer, {
|
||||
DELETE_SHORT_URL_ERROR,
|
||||
DELETE_SHORT_URL_START,
|
||||
@@ -60,9 +59,9 @@ describe('shortUrlDeletionReducer', () => {
|
||||
getState.mockClear();
|
||||
});
|
||||
|
||||
each(
|
||||
it.each(
|
||||
[[ undefined ], [ null ], [ 'example.com' ]]
|
||||
).it('dispatches proper actions if API client request succeeds', async (domain) => {
|
||||
)('dispatches proper actions if API client request succeeds', async (domain) => {
|
||||
const apiClientMock = {
|
||||
deleteShortUrl: jest.fn(() => ''),
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import moment from 'moment';
|
||||
import each from 'jest-each';
|
||||
import reducer, {
|
||||
EDIT_SHORT_URL_META_START,
|
||||
EDIT_SHORT_URL_META_ERROR,
|
||||
@@ -57,7 +56,7 @@ describe('shortUrlMetaReducer', () => {
|
||||
|
||||
afterEach(jest.clearAllMocks);
|
||||
|
||||
each([[ undefined ], [ null ], [ 'example.com' ]]).it('dispatches metadata on success', async (domain) => {
|
||||
it.each([[ undefined ], [ null ], [ 'example.com' ]])('dispatches metadata on success', async (domain) => {
|
||||
await editShortUrlMeta(buildShlinkApiClient)(shortCode, domain, meta)(dispatch);
|
||||
|
||||
expect(buildShlinkApiClient).toHaveBeenCalledTimes(1);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import each from 'jest-each';
|
||||
import reducer, {
|
||||
EDIT_SHORT_URL_TAGS_ERROR,
|
||||
EDIT_SHORT_URL_TAGS_START,
|
||||
@@ -61,7 +60,7 @@ describe('shortUrlTagsReducer', () => {
|
||||
dispatch.mockReset();
|
||||
});
|
||||
|
||||
each([[ undefined ], [ null ], [ 'example.com' ]]).it('dispatches normalized tags on success', async (domain) => {
|
||||
it.each([[ undefined ], [ null ], [ 'example.com' ]])('dispatches normalized tags on success', async (domain) => {
|
||||
const normalizedTags = [ 'bar', 'foo' ];
|
||||
|
||||
updateShortUrlTags.mockResolvedValue(normalizedTags);
|
||||
|
||||
Reference in New Issue
Block a user