mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-01 13:16:42 +00:00
Added flag on short URL creation which tells if the short URL was already saved
This commit is contained in:
@@ -13,7 +13,7 @@ describe('<CreateShortUrl />', () => {
|
||||
const CreateShortUrl = createShortUrlsCreator(ShortUrlForm, CreateShortUrlResult);
|
||||
const setUp = () => render(
|
||||
<CreateShortUrl
|
||||
shortUrlCreationResult={shortUrlCreationResult}
|
||||
shortUrlCreation={shortUrlCreationResult}
|
||||
createShortUrl={createShortUrl}
|
||||
selectedServer={null}
|
||||
resetCreateShortUrl={() => {}}
|
||||
|
||||
@@ -22,16 +22,16 @@ describe('shortUrlCreationReducer', () => {
|
||||
|
||||
it('returns loading on CREATE_SHORT_URL_START', () => {
|
||||
expect(reducer(undefined, action(createShortUrl.pending.toString()))).toEqual({
|
||||
result: null,
|
||||
saving: true,
|
||||
saved: false,
|
||||
error: false,
|
||||
});
|
||||
});
|
||||
|
||||
it('returns error on CREATE_SHORT_URL_ERROR', () => {
|
||||
expect(reducer(undefined, action(createShortUrl.rejected.toString()))).toEqual({
|
||||
result: null,
|
||||
saving: false,
|
||||
saved: false,
|
||||
error: true,
|
||||
});
|
||||
});
|
||||
@@ -40,14 +40,15 @@ describe('shortUrlCreationReducer', () => {
|
||||
expect(reducer(undefined, action(createShortUrl.fulfilled.toString(), { payload: shortUrl }))).toEqual({
|
||||
result: shortUrl,
|
||||
saving: false,
|
||||
saved: true,
|
||||
error: false,
|
||||
});
|
||||
});
|
||||
|
||||
it('returns default state on RESET_CREATE_SHORT_URL', () => {
|
||||
expect(reducer(undefined, action(resetCreateShortUrl.toString()))).toEqual({
|
||||
result: null,
|
||||
saving: false,
|
||||
saved: false,
|
||||
error: false,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user