Created
January 25, 2019 16:46
-
-
Save ahuggins/0168801656297de8dae74846281d6a19 to your computer and use it in GitHub Desktop.
Example with Wrapper, adding MemoryRouter
This file contains hidden or 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 { render, mount, shallow } from 'enzyme'; | |
| import EditDatasource from './EditDatasource'; | |
| import { MemoryRouter } from 'react-router-dom'; | |
| describe('tests for EditDatasource', function () { | |
| it.only('changes the datasource.type when a select button is clicked', function () { | |
| const wrap = mount( | |
| <MemoryRouter> | |
| <EditDatasource | |
| notify={notify} | |
| navigate={navigate} | |
| action={actionSetup()} /> | |
| </MemoryRouter> | |
| ); | |
| expect(wrap.state().datasource.type === 'datawarehouse').to.be.true; | |
| wrap.find('.manualUpload').simulate('click'); | |
| expect(wrap.state().datasource.type === 'manual').to.be.true; | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment