mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-27 20:26:40 +00:00
Improved short URL creation
This commit is contained in:
@@ -11,7 +11,7 @@ describe('<CreateShortUrl />', () => {
|
||||
const shortUrlCreationResult = {
|
||||
loading: false,
|
||||
};
|
||||
const createShortUrl = jest.fn();
|
||||
const createShortUrl = jest.fn(() => Promise.resolve());
|
||||
|
||||
beforeEach(() => {
|
||||
const CreateShortUrl = createShortUrlsCreator(TagsSelector, () => '', () => '');
|
||||
@@ -22,7 +22,7 @@ describe('<CreateShortUrl />', () => {
|
||||
});
|
||||
afterEach(() => {
|
||||
wrapper.unmount();
|
||||
createShortUrl.mockReset();
|
||||
createShortUrl.mockClear();
|
||||
});
|
||||
|
||||
it('saves short URL with data set in form controls', () => {
|
||||
|
||||
@@ -72,6 +72,8 @@ describe('shortUrlCreationReducer', () => {
|
||||
const apiClientMock = createApiClientMock(Promise.reject(error));
|
||||
const dispatchable = createShortUrl(() => apiClientMock)({});
|
||||
|
||||
expect.assertions(5);
|
||||
|
||||
try {
|
||||
await dispatchable(dispatch, getState);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user