Created
June 15, 2015 02:03
-
-
Save lucasmazza/4e3755955a4f7062f816 to your computer and use it in GitHub Desktop.
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
var PasteMessage = require('components/messages/paste'), | |
React = require('react'); | |
function render(Component, props, callback) { | |
var element = React.createElement(Component, props), | |
root = document.createElement('div'); | |
var component = React.render(element, root, function() { | |
setTimeout(function() { | |
callback(root.childNodes[0], component); | |
}); | |
}); | |
} | |
QUnit.module('Components.Messages.Paste'); | |
QUnit.test('renders the tweet message element', function(assert) { | |
var message = { body: 'Cool, cool cool cool.'}; | |
var done = assert.async(); | |
render(PasteMessage, { message: message }, function(node) { | |
assert.hasSelector('.paste-message'); | |
assert.hasText(node, 'pre.pasted-content code', 'Cool, cool cool cool.'); | |
done(); | |
}); | |
}); |
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
var PasteMessage = require('components/messages/paste'), | |
React = require('react'); | |
QUnit.module('Components.Messages.Paste'); | |
QUnit.test('renders the tweet message element', function(assert) { | |
var message = { body: 'Cool, cool cool cool.'}; | |
// this.renderComponent | |
// this.render | |
// whatevz | |
assert.renderComponent(PasteMessage, { message: message }, function(node) { | |
assert.hasSelector('.paste-message'); | |
assert.hasText(node, 'pre.pasted-content code', 'Cool, cool cool cool.'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment