Skip to content

Instantly share code, notes, and snippets.

@benmurden
Created September 5, 2017 08:47
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/977a15878d8ddd8f46303c44bf050b3d to your computer and use it in GitHub Desktop.
Save benmurden/977a15878d8ddd8f46303c44bf050b3d to your computer and use it in GitHub Desktop.
Fixed Ember.js component 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(), '');
});
test('renders block content', function(assert) {
// 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