Migrated editShortUrl payload action

This commit is contained in:
Alejandro Celaya
2022-11-06 11:53:23 +01:00
parent a316366ae9
commit bf84e4a2ed
6 changed files with 13 additions and 11 deletions

View File

@@ -31,7 +31,7 @@ describe('shortUrlEditionReducer', () => {
});
it('returns provided tags and shortCode on SHORT_URL_EDITED', () => {
expect(reducer(undefined, { type: SHORT_URL_EDITED, shortUrl })).toEqual({
expect(reducer(undefined, { type: SHORT_URL_EDITED, payload: shortUrl })).toEqual({
shortUrl,
saving: false,
error: false,
@@ -55,7 +55,7 @@ describe('shortUrlEditionReducer', () => {
expect(updateShortUrl).toHaveBeenCalledWith(shortCode, domain, { longUrl });
expect(dispatch).toHaveBeenCalledTimes(2);
expect(dispatch).toHaveBeenNthCalledWith(1, { type: EDIT_SHORT_URL_START });
expect(dispatch).toHaveBeenNthCalledWith(2, { type: SHORT_URL_EDITED, shortUrl });
expect(dispatch).toHaveBeenNthCalledWith(2, { type: SHORT_URL_EDITED, payload: shortUrl });
});
it('dispatches error on failure', async () => {

View File

@@ -181,7 +181,7 @@ describe('shortUrlsListReducer', () => {
error: false,
};
const result = reducer(state, { type: SHORT_URL_EDITED, shortUrl: editedShortUrl } as any);
const result = reducer(state, { type: SHORT_URL_EDITED, payload: editedShortUrl } as any);
expect(result.shortUrls?.data).toEqual(expectedList);
});