Setup tests environment

This commit is contained in:
Alejandro Celaya
2018-06-14 19:42:42 +02:00
parent e150b35e33
commit 9ac0811200
8 changed files with 74 additions and 28 deletions

View File

@@ -1,5 +1,9 @@
import { combineReducers } from 'redux';
const rootReducer = combineReducers({});
import serversReducer from './servers';
const rootReducer = combineReducers({
servers: serversReducer
});
export default rootReducer;

15
src/reducers/servers.js Normal file
View File

@@ -0,0 +1,15 @@
const FETCH_SERVERS = 'shlink/FETCH_SERVERS';
const CREATE_SERVER = 'shlink/FETCH_SERVERS';
export default function serversReducer(state = [{ name: 'bar' }], action) {
switch (action.type) {
case FETCH_SERVERS:
return action.servers;
case CREATE_SERVER:
return [ ...state, action.server ];
}
return state;
}