mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-11 02:37:22 +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', () => {
|
describe('settingsReducer', () => {
|
||||||
const realTimeUpdates = { enabled: true };
|
const realTimeUpdates = { enabled: true };
|
||||||
|
@ -6,7 +11,7 @@ describe('settingsReducer', () => {
|
||||||
const settings = { realTimeUpdates, shortUrlCreation };
|
const settings = { realTimeUpdates, shortUrlCreation };
|
||||||
|
|
||||||
describe('reducer', () => {
|
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);
|
expect(reducer(undefined, { type: SET_SETTINGS, realTimeUpdates })).toEqual(settings);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -26,4 +31,12 @@ describe('settingsReducer', () => {
|
||||||
expect(result).toEqual({ type: SET_SETTINGS, realTimeUpdates: { interval } });
|
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