You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New to TDD.
Making an app with Meteor and React using mocha and expect for client end.
Can I use test double with enzyme to test the functionality of button click? and other features.
import { Meteor } from 'meteor/meteor';
import React from 'react';
import { mount } from 'enzyme';
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-15.4';
import Header from './Header';
configure({ adapter: new Adapter() });
if (Meteor.isClient) {
describe('Header Test', function () {
it('should logout user on button click', function() {
const titleProp = 'Test Title';
const wrapper = mount(<PrivateHeader title={titleProp} />);
wrapper.find('button').simulate('click');
/* How to proceed from now */
});
});
}
Please if someone could guide me in the right direction.
Or if not test double which library will be most suitable, I don't wanna make any change in souce code for testing.
The text was updated successfully, but these errors were encountered:
It may be possible, but for something that integrated, I don't think I'd recommend using a test double library. I'd create an artificial UI event instead, as opposed to trying to use testdouble.js to poke a hole in any particular method. td.js is designed to fake out APIs you own, so that it can influence their design by responding to pain—I suspect in this case you'd be faking methods you don't own, which would result in useless pain.
New to TDD.
Making an app with Meteor and React using mocha and expect for client end.
Can I use test double with enzyme to test the functionality of button click? and other features.
Example
Header.jsx
** Header.test.js**
Please if someone could guide me in the right direction.
Or if not test double which library will be most suitable, I don't wanna make any change in souce code for testing.
The text was updated successfully, but these errors were encountered: