Skip to content

Instantly share code, notes, and snippets.

@ahuggins
Created January 25, 2019 16:36
Show Gist options
  • Select an option

  • Save ahuggins/e862d5fdfd4cf8b73d707b84f17b1b72 to your computer and use it in GitHub Desktop.

Select an option

Save ahuggins/e862d5fdfd4cf8b73d707b84f17b1b72 to your computer and use it in GitHub Desktop.
Real World Example of Wrapper issues
import React from 'react';
import { render, mount, shallow } from 'enzyme';
import EditDatasource from './EditDatasource';
describe('tests for EditDatasource', function () {
it.only('changes the datasource.type when a select button is clicked', function () {
const wrap = mount(
<EditDatasource
notify={notify}
navigate={navigate}
action={actionSetup()} />
);
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