mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-09 17:57:26 +03:00
Removed test cases for the old default on reducers switch statements
This commit is contained in:
parent
232c059e4f
commit
d1c10e4895
10 changed files with 0 additions and 52 deletions
|
@ -9,9 +9,6 @@ import { RESET_SHORT_URL_PARAMS } from '../../../src/short-urls/reducers/shortUr
|
||||||
|
|
||||||
describe('selectedServerReducer', () => {
|
describe('selectedServerReducer', () => {
|
||||||
describe('reducer', () => {
|
describe('reducer', () => {
|
||||||
it('returns default when action is not handled', () =>
|
|
||||||
expect(reducer(null, { type: 'unknown' })).toEqual(null));
|
|
||||||
|
|
||||||
it('returns default when action is RESET_SELECTED_SERVER', () =>
|
it('returns default when action is RESET_SELECTED_SERVER', () =>
|
||||||
expect(reducer(null, { type: RESET_SELECTED_SERVER })).toEqual(null));
|
expect(reducer(null, { type: RESET_SELECTED_SERVER })).toEqual(null));
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,6 @@ describe('serverReducer', () => {
|
||||||
describe('reducer', () => {
|
describe('reducer', () => {
|
||||||
it('returns servers when action is FETCH_SERVERS', () =>
|
it('returns servers when action is FETCH_SERVERS', () =>
|
||||||
expect(reducer({}, { type: FETCH_SERVERS, payload })).toEqual(payload));
|
expect(reducer({}, { type: FETCH_SERVERS, payload })).toEqual(payload));
|
||||||
|
|
||||||
it('returns default when action is unknown', () =>
|
|
||||||
expect(reducer({}, { type: 'unknown' })).toEqual({}));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('action creators', () => {
|
describe('action creators', () => {
|
||||||
|
|
|
@ -39,9 +39,6 @@ describe('shortUrlCreationReducer', () => {
|
||||||
error: false,
|
error: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns provided state on unknown action', () =>
|
|
||||||
expect(reducer({}, { type: 'unknown' })).toEqual({}));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('resetCreateShortUrl', () => {
|
describe('resetCreateShortUrl', () => {
|
||||||
|
|
|
@ -45,12 +45,6 @@ describe('shortUrlDeletionReducer', () => {
|
||||||
errorData,
|
errorData,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns provided state as is on unknown action', () => {
|
|
||||||
const state = { foo: 'bar' };
|
|
||||||
|
|
||||||
expect(reducer(state, { type: 'unknown' })).toEqual(state);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('resetDeleteShortUrl', () => {
|
describe('resetDeleteShortUrl', () => {
|
|
@ -70,12 +70,6 @@ describe('shortUrlsListReducer', () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns provided state as is on unknown action', () => {
|
|
||||||
const state = { foo: 'bar' };
|
|
||||||
|
|
||||||
expect(reducer(state, { type: 'unknown' })).toEqual(state);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('listShortUrls', () => {
|
describe('listShortUrls', () => {
|
||||||
|
|
|
@ -8,9 +8,6 @@ describe('shortUrlsListParamsReducer', () => {
|
||||||
describe('reducer', () => {
|
describe('reducer', () => {
|
||||||
const defaultState = { page: '1' };
|
const defaultState = { page: '1' };
|
||||||
|
|
||||||
it('returns default value when action is unknown', () =>
|
|
||||||
expect(reducer(defaultState, { type: 'unknown' })).toEqual(defaultState));
|
|
||||||
|
|
||||||
it('returns params when action is LIST_SHORT_URLS', () =>
|
it('returns params when action is LIST_SHORT_URLS', () =>
|
||||||
expect(reducer(defaultState, { type: LIST_SHORT_URLS, params: { searchTerm: 'foo' } })).toEqual({
|
expect(reducer(defaultState, { type: LIST_SHORT_URLS, params: { searchTerm: 'foo' } })).toEqual({
|
||||||
...defaultState,
|
...defaultState,
|
||||||
|
|
|
@ -30,9 +30,6 @@ describe('tagDeleteReducer', () => {
|
||||||
error: false,
|
error: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns provided state on unknown action', () =>
|
|
||||||
expect(reducer({}, { type: 'unknown' })).toEqual({}));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('tagDeleted', () => {
|
describe('tagDeleted', () => {
|
||||||
|
|
|
@ -32,9 +32,6 @@ describe('tagEditReducer', () => {
|
||||||
newName: 'bar',
|
newName: 'bar',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns provided state on unknown action', () =>
|
|
||||||
expect(reducer({}, { type: 'unknown' })).toEqual({}));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('tagEdited', () => {
|
describe('tagEdited', () => {
|
||||||
|
|
|
@ -32,17 +32,6 @@ describe('shortUrlDetailReducer', () => {
|
||||||
expect(error).toEqual(false);
|
expect(error).toEqual(false);
|
||||||
expect(shortUrl).toEqual(actionShortUrl);
|
expect(shortUrl).toEqual(actionShortUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns default state on unknown action', () => {
|
|
||||||
const defaultState = {
|
|
||||||
shortUrl: {},
|
|
||||||
loading: false,
|
|
||||||
error: false,
|
|
||||||
};
|
|
||||||
const state = reducer(defaultState, { type: 'unknown' });
|
|
||||||
|
|
||||||
expect(state).toEqual(defaultState);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getShortUrlDetail', () => {
|
describe('getShortUrlDetail', () => {
|
||||||
|
|
|
@ -49,17 +49,6 @@ describe('shortUrlVisitsReducer', () => {
|
||||||
expect(error).toEqual(false);
|
expect(error).toEqual(false);
|
||||||
expect(visits).toEqual(actionVisits);
|
expect(visits).toEqual(actionVisits);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns default state on unknown action', () => {
|
|
||||||
const defaultState = {
|
|
||||||
visits: [],
|
|
||||||
loading: false,
|
|
||||||
error: false,
|
|
||||||
};
|
|
||||||
const state = reducer(defaultState, { type: 'unknown' });
|
|
||||||
|
|
||||||
expect(state).toEqual(defaultState);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getShortUrlVisits', () => {
|
describe('getShortUrlVisits', () => {
|
||||||
|
|
Loading…
Reference in a new issue