Created
January 25, 2019 17:03
-
-
Save ahuggins/4a0fe663efa87184c2cdeb0733033dda to your computer and use it in GitHub Desktop.
Final Test with instance()
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.find(EditDatasource).instance().state.datasource.type === 'datawarehouse').to.be.true; | |
| wrap.find('.manualUpload').simulate('click'); | |
| expect(wrap.find(EditDatasource).instance().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