Skip to content

Instantly share code, notes, and snippets.

@timrwood
Created February 12, 2014 02:04
Show Gist options
  • Save timrwood/8948641 to your computer and use it in GitHub Desktop.
Save timrwood/8948641 to your computer and use it in GitHub Desktop.
test('Testing a component', function () {
var component = App.ExampleButtonComponent.create({
layoutName : 'components/example-button'
});
Ember.run(function () {
component.append();
});
equal(component.$('.is-not-enabled').length, 1, 'Should show the .is-not-enabled element');
equal(component.$('.is-enabled').length, 0, 'Should not show the .is-not-enabled element');
Ember.run(function () {
component.set('isEnabled', true);
});
equal(component.$('.is-not-enabled').length, 0, 'Should not show the .is-not-enabled element');
equal(component.$('.is-enabled').length, 1, 'Should show the .is-not-enabled element');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment