mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 09:30:31 +03:00
Fixed typo
This commit is contained in:
parent
c0e116b17b
commit
3569202a62
4 changed files with 15 additions and 15 deletions
|
@ -19,7 +19,7 @@ const defaultState = {
|
||||||
error: false,
|
error: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function reduce(state = defaultState, action) {
|
export default function reducer(state = defaultState, action) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case DELETE_TAG_START:
|
case DELETE_TAG_START:
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as sinon from 'sinon';
|
import * as sinon from 'sinon';
|
||||||
import reduce, {
|
import reducer, {
|
||||||
_selectServer,
|
_selectServer,
|
||||||
RESET_SELECTED_SERVER,
|
RESET_SELECTED_SERVER,
|
||||||
resetSelectedServer,
|
resetSelectedServer,
|
||||||
|
@ -8,17 +8,17 @@ import reduce, {
|
||||||
import { RESET_SHORT_URL_PARAMS } from '../../../src/short-urls/reducers/shortUrlsListParams';
|
import { RESET_SHORT_URL_PARAMS } from '../../../src/short-urls/reducers/shortUrlsListParams';
|
||||||
|
|
||||||
describe('selectedServerReducer', () => {
|
describe('selectedServerReducer', () => {
|
||||||
describe('reduce', () => {
|
describe('reducer', () => {
|
||||||
it('returns default when action is not handled', () =>
|
it('returns default when action is not handled', () =>
|
||||||
expect(reduce(null, { type: 'unknown' })).toEqual(null));
|
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(reduce(null, { type: RESET_SELECTED_SERVER })).toEqual(null));
|
expect(reducer(null, { type: RESET_SELECTED_SERVER })).toEqual(null));
|
||||||
|
|
||||||
it('returns selected server when action is SELECT_SERVER', () => {
|
it('returns selected server when action is SELECT_SERVER', () => {
|
||||||
const selectedServer = { id: 'abc123' };
|
const selectedServer = { id: 'abc123' };
|
||||||
|
|
||||||
expect(reduce(null, { type: SELECT_SERVER, selectedServer })).toEqual(selectedServer);
|
expect(reducer(null, { type: SELECT_SERVER, selectedServer })).toEqual(selectedServer);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as sinon from 'sinon';
|
import * as sinon from 'sinon';
|
||||||
import { values } from 'ramda';
|
import { values } from 'ramda';
|
||||||
import reduce, {
|
import reducer, {
|
||||||
_createServer,
|
_createServer,
|
||||||
_deleteServer,
|
_deleteServer,
|
||||||
_listServers,
|
_listServers,
|
||||||
|
@ -20,12 +20,12 @@ describe('serverReducer', () => {
|
||||||
createServers: sinon.fake(),
|
createServers: sinon.fake(),
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('reduce', () => {
|
describe('reducer', () => {
|
||||||
it('returns servers when action is FETCH_SERVERS', () =>
|
it('returns servers when action is FETCH_SERVERS', () =>
|
||||||
expect(reduce({}, { type: FETCH_SERVERS, servers })).toEqual(servers));
|
expect(reducer({}, { type: FETCH_SERVERS, servers })).toEqual(servers));
|
||||||
|
|
||||||
it('returns default when action is unknown', () =>
|
it('returns default when action is unknown', () =>
|
||||||
expect(reduce({}, { type: 'unknown' })).toEqual({}));
|
expect(reducer({}, { type: 'unknown' })).toEqual({}));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('action creators', () => {
|
describe('action creators', () => {
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
import reduce, {
|
import reducer, {
|
||||||
RESET_SHORT_URL_PARAMS,
|
RESET_SHORT_URL_PARAMS,
|
||||||
resetShortUrlParams,
|
resetShortUrlParams,
|
||||||
} from '../../../src/short-urls/reducers/shortUrlsListParams';
|
} from '../../../src/short-urls/reducers/shortUrlsListParams';
|
||||||
import { LIST_SHORT_URLS } from '../../../src/short-urls/reducers/shortUrlsList';
|
import { LIST_SHORT_URLS } from '../../../src/short-urls/reducers/shortUrlsList';
|
||||||
|
|
||||||
describe('shortUrlsListParamsReducer', () => {
|
describe('shortUrlsListParamsReducer', () => {
|
||||||
describe('reducer', () => {
|
describe('reducerr', () => {
|
||||||
const defaultState = { page: '1' };
|
const defaultState = { page: '1' };
|
||||||
|
|
||||||
it('returns default value when action is unknown', () =>
|
it('returns default value when action is unknown', () =>
|
||||||
expect(reduce(defaultState, { type: 'unknown' })).toEqual(defaultState));
|
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(reduce(defaultState, { type: LIST_SHORT_URLS, params: { searchTerm: 'foo' } })).toEqual({
|
expect(reducer(defaultState, { type: LIST_SHORT_URLS, params: { searchTerm: 'foo' } })).toEqual({
|
||||||
...defaultState,
|
...defaultState,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('returns default value when action is RESET_SHORT_URL_PARAMS', () =>
|
it('returns default value when action is RESET_SHORT_URL_PARAMS', () =>
|
||||||
expect(reduce(defaultState, { type: RESET_SHORT_URL_PARAMS })).toEqual(defaultState));
|
expect(reducer(defaultState, { type: RESET_SHORT_URL_PARAMS })).toEqual(defaultState));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('resetShortUrlParams', () => {
|
describe('resetShortUrlParams', () => {
|
||||||
|
|
Loading…
Reference in a new issue