Updated Short URLs list so that it allows setting default orderBy from settings

This commit is contained in:
Alejandro Celaya
2021-12-24 13:14:13 +01:00
parent d8442e435d
commit 57075c581d
12 changed files with 69 additions and 69 deletions

View File

@@ -1,10 +1,12 @@
import reducer, {
SET_SETTINGS,
DEFAULT_SHORT_URLS_ORDERING,
toggleRealTimeUpdates,
setRealTimeUpdatesInterval,
setShortUrlCreationSettings,
setUiSettings,
setVisitsSettings,
setTagsSettings,
} from '../../../src/settings/reducers/settings';
describe('settingsReducer', () => {
@@ -12,7 +14,8 @@ describe('settingsReducer', () => {
const shortUrlCreation = { validateUrls: false };
const ui = { theme: 'light' };
const visits = { defaultInterval: 'last30Days' };
const settings = { realTimeUpdates, shortUrlCreation, ui, visits };
const shortUrlList = { defaultOrdering: DEFAULT_SHORT_URLS_ORDERING };
const settings = { realTimeUpdates, shortUrlCreation, ui, visits, shortUrlList };
describe('reducer', () => {
it('returns realTimeUpdates when action is SET_SETTINGS', () => {
@@ -59,4 +62,12 @@ describe('settingsReducer', () => {
expect(result).toEqual({ type: SET_SETTINGS, visits: { defaultInterval: 'last180Days' } });
});
});
describe('setTagsSettings', () => {
it('creates action to set tags settings', () => {
const result = setTagsSettings({ defaultMode: 'list' });
expect(result).toEqual({ type: SET_SETTINGS, tags: { defaultMode: 'list' } });
});
});
});