Skip to content

Instantly share code, notes, and snippets.

@benmurden
Created September 4, 2017 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benmurden/28a3aafea6fce11ebf6e72bde8deba2f to your computer and use it in GitHub Desktop.
Save benmurden/28a3aafea6fce11ebf6e72bde8deba2f to your computer and use it in GitHub Desktop.
Example Ember.js component integration test
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