Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tsing80 committed Oct 9, 2015
1 parent 6cc48d5 commit 28bedfc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test-module-for-integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,26 @@ test('can inject a service directly into test context, with aliased name', funct
this.set('hornedBeast.sparkliness', 'amazing');
equal(this.$('.x-foo').text().trim(), "amazing");
});

moduleForComponent('Component Integration Tests: willDestoryElement', {
integration: true,
beforeSetup: function() {
setResolverRegistry({
'component:my-component': Ember.Component.extend({
willDestroyElement: function() {
var stateIndicatesInDOM = (this._state === 'inDOM');
var actuallyInDOM = Ember.$.contains(document, this.$()[0]);

ok((actuallyInDOM === true) && (actuallyInDOM === stateIndicatesInDOM), 'component should still be in the DOM');
}

})
});
}
});

test('still in DOM in willDestroyElement', function() {
expect(1);
this.render("{{my-component}}");

});

0 comments on commit 28bedfc

Please sign in to comment.