Created
September 4, 2017 14:46
-
-
Save benmurden/28a3aafea6fce11ebf6e72bde8deba2f to your computer and use it in GitHub Desktop.
Example Ember.js component integration test
This file contains 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 { moduleForComponent, test } from 'ember-qunit'; | |
import hbs from 'htmlbars-inline-precompile'; | |
moduleForComponent('foo-bar', 'Integration | Component | foo bar', { | |
integration: true | |
}); | |
test('it renders', function(assert) { | |
// Set any properties with this.set('myProperty', 'value'); | |
// Handle any actions with this.on('myAction', function(val) { ... }); | |
this.render(hbs`{{foo-bar}}`); | |
assert.equal(this.$().text().trim(), ''); | |
// Template block usage: | |
this.render(hbs` | |
{{#foo-bar}} | |
template block text | |
{{/foo-bar}} | |
`); | |
assert.equal(this.$().text().trim(), 'template block text'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment