mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 09:30:31 +03:00
Added test for setShortUrlCreationSettings action
This commit is contained in:
parent
4885088d59
commit
c3ebb0d10f
1 changed files with 15 additions and 2 deletions
|
@ -1,4 +1,9 @@
|
|||
import reducer, { SET_SETTINGS, toggleRealTimeUpdates, setRealTimeUpdatesInterval } from '../../../src/settings/reducers/settings';
|
||||
import reducer, {
|
||||
SET_SETTINGS,
|
||||
toggleRealTimeUpdates,
|
||||
setRealTimeUpdatesInterval,
|
||||
setShortUrlCreationSettings,
|
||||
} from '../../../src/settings/reducers/settings';
|
||||
|
||||
describe('settingsReducer', () => {
|
||||
const realTimeUpdates = { enabled: true };
|
||||
|
@ -6,7 +11,7 @@ describe('settingsReducer', () => {
|
|||
const settings = { realTimeUpdates, shortUrlCreation };
|
||||
|
||||
describe('reducer', () => {
|
||||
it('returns realTimeUpdates when action is SET_REAL_TIME_UPDATES', () => {
|
||||
it('returns realTimeUpdates when action is SET_SETTINGS', () => {
|
||||
expect(reducer(undefined, { type: SET_SETTINGS, realTimeUpdates })).toEqual(settings);
|
||||
});
|
||||
});
|
||||
|
@ -26,4 +31,12 @@ describe('settingsReducer', () => {
|
|||
expect(result).toEqual({ type: SET_SETTINGS, realTimeUpdates: { interval } });
|
||||
});
|
||||
});
|
||||
|
||||
describe('setShortUrlCreationSettings', () => {
|
||||
it('creates action to set shortUrlCreation settings', () => {
|
||||
const result = setShortUrlCreationSettings({ validateUrls: true });
|
||||
|
||||
expect(result).toEqual({ type: SET_SETTINGS, shortUrlCreation: { validateUrls: true } });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue