Created
June 8, 2017 01:20
-
-
Save jasongaare/fee048190fb3a9bf3a2ce2b4a966c04f 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 React from 'react'; | |
import sinon from 'sinon'; | |
import { shallow } from 'enzyme'; | |
import FilterBar from 'components/filter/FilterBar'; | |
const sampleFilters = { ids: [1, 2] }; | |
describe('Testing FilterBar', () => { | |
it('removeFilters removes filters as expected', () => { | |
const onFiltersChangeSpy = sinon.spy(); | |
const render = shallow( | |
<FilterBar filters={sampleFilters} onFiltersChange={onFiltersChangeSpy} /> | |
); | |
render.instance().removeFilter({ id: 1 }); | |
render.instance().removeFilter({ id: 2 }); | |
expect(onFiltersChangeSpy.args).toMatchSnapshot(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment