Last active
August 29, 2015 14:16
-
-
Save ninjapanzer/f6151ec909afe72b271f to your computer and use it in GitHub Desktop.
Error: Unable to parse child response data: 2 Tests
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
// __tests__/eventComp.js | |
jest.dontMock('../src/events/eventComp.coffee'); | |
describe('eventComp', function() { | |
it('sees if the state is passed correctly to event', function() { | |
var EventComp = require('../src/events/eventComp'); | |
var TestUtils = React.addons.TestUtils; | |
var event = { | |
get: function(thing){ | |
return thing; | |
} | |
}; | |
var eventBox = TestUtils.renderIntoDocument( | |
React.createElement(EventComp, {event: event}) | |
); | |
var box = TestUtils.findRenderedDOMComponentWithTag( | |
eventBox, 'div.event'); | |
expect(box.getDOMNode().textContent).toEqual('created'); | |
expect(eventBox.state.get('created')).toEqual('created'); | |
}); | |
}); |
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
jest.dontMock('../src/events/eventsComp.coffee'); | |
describe('eventsComp', function() { | |
it('YAY mutliple events', function() { | |
var EventsComp = require('../src/events/eventsComp'); | |
var TestUtils = React.addons.TestUtils; | |
var event = { | |
get: function(thing){ | |
return thing; | |
} | |
}; | |
var events = [event,event]; | |
var eventBox = TestUtils.renderIntoDocument( | |
React.createElement(EventsComp, {event: event}) | |
); | |
var box = TestUtils.findRenderedDOMComponentWithTag( | |
eventBox, 'span'); | |
expect(box.getDOMNode().textContent).toEqual('created'); | |
expect(eventBox.state.get('created')).toEqual('created'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment