Merge pull request #10 from navi-infra/ch12386

ch12386| Deepak| fixing test
This commit is contained in:
Deepak Jain
2020-06-13 22:42:54 +05:30
committed by GitHub Enterprise
4 changed files with 18 additions and 18 deletions

View File

@@ -12,4 +12,4 @@ module.exports = {
moduleNameMapper: {
'\\.(css|scss|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__tests__/fileTransformer.js',
},
};
};

View File

@@ -1,16 +0,0 @@
export const reducer = (state, action) => {
switch (action.type) {
case "setAuthentication":
return {
...state,
isAuthenticated: action.value,
};
case "setUserInfo":
return {
...state,
userInfo: action.value,
};
default:
return state;
}
};

16
src/reducer/reducer.ts Normal file
View File

@@ -0,0 +1,16 @@
export const reducer = (state, action) => {
switch (action.type) {
case "setAuthentication":
return {
...state,
isAuthenticated: action.value,
};
case "setUserInfo":
return {
...state,
userInfo: action.value,
};
default:
return state;
}
};

View File

@@ -1,5 +1,5 @@
import React, { createContext, useReducer } from "react";
import { reducer } from "../reducer/reducer.js";
import { reducer } from "../reducer/reducer";
type initialStateType = {
isAuthenticated: Boolean;