-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- returns an object, not an array like other components
- Loading branch information
Showing
12 changed files
with
64 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export default { | ||
users: [], | ||
loggedInUser: [] | ||
loggedInUser: {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import loggedInUserReducer from '../../reducers/loggedInUserReducer' | ||
import { POST_LOGIN_INFO } from '../../types' | ||
|
||
describe('reduces a user', () => { | ||
it('defaults to empty projects if none are passed in', () => { | ||
expect(loggedInUserReducer(undefined, {})).toEqual({}) | ||
}) | ||
|
||
it('reduces the signed in user', () => { | ||
expect( | ||
loggedInUserReducer([], { | ||
type: POST_LOGIN_INFO, | ||
payload: { id: 1, email: 'some.email@example.com' } | ||
}) | ||
).toEqual({ id: 1, email: 'some.email@example.com' }) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import store from '../../store' | ||
|
||
describe('Store', () => { | ||
it('should update after login', async () => { | ||
await store.dispatch({ | ||
type: 'POST_LOGIN_INFO', | ||
payload: { id: 2, email: 'someEmail@example.com' } | ||
}) | ||
|
||
expect(store.getState()).toEqual({ | ||
loggedInUser: { id: 2, email: 'someEmail@example.com' }, | ||
users: [] | ||
}) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import store from '../../store' | ||
|
||
describe('Store', () => { | ||
it('should update', async () => { | ||
await store.dispatch({ | ||
type: 'GET_USERS', | ||
payload: ['Run the tests'] | ||
}) | ||
|
||
expect(store.getState()).toEqual({ | ||
users: ['Run the tests'], | ||
loggedInUser: {} | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters