Skip to content

Commit

Permalink
Added failing test for #11539
Browse files Browse the repository at this point in the history
(cherry picked from commit 78d0306)
(cherry picked from commit fb883c4)
  • Loading branch information
ef4 authored and rwjblue committed Jul 1, 2015
1 parent 0472f7a commit b74c260
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 @@ -321,6 +321,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 b74c260

Please sign in to comment.