Skip to content

Commit

Permalink
Improve tests, coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwr18 committed Feb 4, 2019
1 parent 083df8b commit 6fc0629
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/reducers/projectsReducer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GET_PROJECTS, FETCH_PROJECTS_FAILURE } from '../types'
import { GET_PROJECTS } from '../types'
import initialState from './initialState'

const projectsReducer = (state = initialState.projects, action) => {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/actions/getProjectsAction.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('fetchProjects action', () => {
'/api/v1/projects',
{
status: 200,
response: { projects: projectsResponse, languages: { 'Autograder': [] }, followers: [], documents: [] }
response: { projects: projectsResponse, languages: { 'Autograder': ['Ruby'] }, followers: [], documents: [] }
}
)

Expand Down
7 changes: 1 addition & 6 deletions src/tests/store/loggedInUser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ describe('Store', () => {
payload: { id: 2, email: 'someEmail@example.com' }
})

expect(store.getState()).toEqual({
loggedInUser: { id: 2, email: 'someEmail@example.com' },
signedUpUser: {},
users: [],
projects: []
})
expect(store.getState().loggedInUser).toEqual({ id: 2, email: 'someEmail@example.com' })
})
})
7 changes: 1 addition & 6 deletions src/tests/store/signedUpUser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ describe('Store', () => {
payload: { id: 2, email: 'someEmail@example.com' }
})

expect(store.getState()).toEqual({
signedUpUser: { id: 2, email: 'someEmail@example.com' },
loggedInUser: {},
users: [],
projects: []
})
expect(store.getState().signedUpUser).toEqual({ id: 2, email: 'someEmail@example.com' })
})
})
4 changes: 2 additions & 2 deletions src/tests/store/store.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ describe('Store', () => {

expect(store.getState()).toEqual({
users: ['Run the tests'],
projects: [],
loggedInUser: {},
signedUpUser: {}
signedUpUser: {},
projects: []
})
})
})
7 changes: 1 addition & 6 deletions src/tests/store/users.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ describe('Store', () => {
payload: ['Run the tests']
})

expect(store.getState()).toEqual({
users: ['Run the tests'],
loggedInUser: {},
signedUpUser: {},
projects: []
})
expect(store.getState().users).toEqual(['Run the tests'])
})
})

0 comments on commit 6fc0629

Please sign in to comment.