Fix failing unit tests in browser (#5688)

* format js files using prettier

Used the following command to format the files
prettier --write "browser/app/js/**/*.js"

* fix failing unit tests in browser
This commit is contained in:
Kanagaraj M
2018-03-23 00:55:56 +05:30
committed by Harshavardhana
parent cb3818be27
commit c0e45f9098
95 changed files with 839 additions and 890 deletions

View File

@@ -21,16 +21,16 @@ const add = (files, action) => ({
[action.slug]: {
loaded: 0,
size: action.size,
name: action.name,
},
name: action.name
}
})
const updateProgress = (files, action) => ({
...files,
[action.slug]: {
...files[action.slug],
loaded: action.loaded,
},
loaded: action.loaded
}
})
const stop = (files, action) => {
@@ -42,30 +42,30 @@ const stop = (files, action) => {
export default (
state = {
files: {},
showAbortModal: false,
showAbortModal: false
},
action,
action
) => {
switch (action.type) {
case uploadsActions.ADD:
return {
...state,
files: add(state.files, action),
files: add(state.files, action)
}
case uploadsActions.UPDATE_PROGRESS:
return {
...state,
files: updateProgress(state.files, action),
files: updateProgress(state.files, action)
}
case uploadsActions.STOP:
return {
...state,
files: stop(state.files, action),
files: stop(state.files, action)
}
case uploadsActions.SHOW_ABORT_MODAL:
return {
...state,
showAbortModal: action.show,
showAbortModal: action.show
}
default:
return state