mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-21 05:56:20 +00:00
Extracted tag related services to its own service provider
This commit is contained in:
@@ -5,7 +5,7 @@ import reducer, {
|
||||
DELETE_TAG,
|
||||
TAG_DELETED,
|
||||
tagDeleted,
|
||||
_deleteTag,
|
||||
deleteTag,
|
||||
} from '../../../src/tags/reducers/tagDelete';
|
||||
|
||||
describe('tagDeleteReducer', () => {
|
||||
@@ -56,7 +56,7 @@ describe('tagDeleteReducer', () => {
|
||||
const expectedDispatchCalls = 2;
|
||||
const tag = 'foo';
|
||||
const apiClientMock = createApiClientMock(Promise.resolve());
|
||||
const dispatchable = _deleteTag(() => apiClientMock, tag);
|
||||
const dispatchable = deleteTag(() => apiClientMock)(tag);
|
||||
|
||||
await dispatchable(dispatch, getState);
|
||||
|
||||
@@ -73,7 +73,7 @@ describe('tagDeleteReducer', () => {
|
||||
const error = 'Error';
|
||||
const tag = 'foo';
|
||||
const apiClientMock = createApiClientMock(Promise.reject(error));
|
||||
const dispatchable = _deleteTag(() => apiClientMock, tag);
|
||||
const dispatchable = deleteTag(() => apiClientMock)(tag);
|
||||
|
||||
try {
|
||||
await dispatchable(dispatch, getState);
|
||||
|
||||
@@ -5,7 +5,7 @@ import reducer, {
|
||||
EDIT_TAG,
|
||||
TAG_EDITED,
|
||||
tagEdited,
|
||||
_editTag,
|
||||
editTag,
|
||||
} from '../../../src/tags/reducers/tagEdit';
|
||||
|
||||
describe('tagEditReducer', () => {
|
||||
@@ -68,7 +68,7 @@ describe('tagEditReducer', () => {
|
||||
const newName = 'bar';
|
||||
const color = '#ff0000';
|
||||
const apiClientMock = createApiClientMock(Promise.resolve());
|
||||
const dispatchable = _editTag(() => apiClientMock, colorGenerator, oldName, newName, color);
|
||||
const dispatchable = editTag(() => apiClientMock, colorGenerator)(oldName, newName, color);
|
||||
|
||||
await dispatchable(dispatch, getState);
|
||||
|
||||
@@ -90,7 +90,7 @@ describe('tagEditReducer', () => {
|
||||
const newName = 'bar';
|
||||
const color = '#ff0000';
|
||||
const apiClientMock = createApiClientMock(Promise.reject(error));
|
||||
const dispatchable = _editTag(() => apiClientMock, colorGenerator, oldName, newName, color);
|
||||
const dispatchable = editTag(() => apiClientMock, colorGenerator)(oldName, newName, color);
|
||||
|
||||
try {
|
||||
await dispatchable(dispatch, getState);
|
||||
|
||||
Reference in New Issue
Block a user