Created
January 10, 2017 11:20
-
-
Save NetguruGist/c0338cfca9ec52d36b81ffd8a2561aa5 to your computer and use it in GitHub Desktop.
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
import quotes from './Quotes'; | |
describe('Quotes reducer', () => { | |
it('returns proper initial state', () => { | |
expect(quotes(undefined, {})).toEqual([]); | |
}); | |
it('adds the quotes', () => { | |
expect(quotes(['sample quote 1'], { | |
type: 'FETCH_QUOTES_SUCCESS', | |
data: ['sample quote 2', 'sample quote 3'], | |
})).toEqual([ | |
'sample quote 1', | |
'sample quote 2', | |
'sample quote 3', | |
]); | |
}); | |
it('returns same state for unknown action', () => { | |
expect(quotes( | |
['sample quote 1'], | |
{ type: 'UNKNOWN_ACTION' } | |
)).toEqual(['sample quote 1']); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment