mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-25 02:18:20 +03:00
27 lines
980 B
TypeScript
27 lines
980 B
TypeScript
import reducer, {
|
|
RESET_SHORT_URL_PARAMS,
|
|
resetShortUrlParams,
|
|
} from '../../../src/short-urls/reducers/shortUrlsListParams';
|
|
import { LIST_SHORT_URLS } from '../../../src/short-urls/reducers/shortUrlsList';
|
|
|
|
describe('shortUrlsListParamsReducer', () => {
|
|
describe('reducer', () => {
|
|
it('returns params when action is LIST_SHORT_URLS', () =>
|
|
expect(reducer(undefined, { type: LIST_SHORT_URLS, params: { searchTerm: 'foo', page: '2' } } as any)).toEqual({
|
|
page: '2',
|
|
searchTerm: 'foo',
|
|
orderBy: { dateCreated: 'DESC' },
|
|
}));
|
|
|
|
it('returns default value when action is RESET_SHORT_URL_PARAMS', () =>
|
|
expect(reducer(undefined, { type: RESET_SHORT_URL_PARAMS } as any)).toEqual({
|
|
page: '1',
|
|
orderBy: { dateCreated: 'DESC' },
|
|
}));
|
|
});
|
|
|
|
describe('resetShortUrlParams', () => {
|
|
it('returns proper action', () =>
|
|
expect(resetShortUrlParams()).toEqual({ type: RESET_SHORT_URL_PARAMS }));
|
|
});
|
|
});
|