Skip to content

Commit

Permalink
Added failing test for #11539
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Jun 28, 2015
1 parent 165cd58 commit 78d0306
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/ember-routing-htmlbars/tests/helpers/outlet_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,31 @@ QUnit.test('{{outlet}} should rerender when bound name changes', function() {
equal(top.$().text().trim(), 'second');
});

QUnit.test('views created by {{outlet}} should get destroyed', function() {
let inserted = 0;
let destroyed = 0;
var routerState = {
render: {
ViewClass: EmberView.extend({
didInsertElement() {
inserted++;
},
willDestroyElement() {
destroyed++;
}
})
},
outlets: {}
};
top.setOutletState(routerState);
runAppend(top);
equal(inserted, 1, 'expected to see view inserted');
run(function() {
top.setOutletState(withTemplate('hello world'));
});
equal(destroyed, 1, 'expected to see view destroyed');
});


function withTemplate(string) {
return {
Expand Down

0 comments on commit 78d0306

Please sign in to comment.