Skip to content

Commit 1cca24c

Browse files
committed
sets back adding nodelist to newDeepChildren and makes test track being torn down
1 parent d727472 commit 1cca24c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

can-component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ var Component = Construct.extend(
590590

591591
// This adds support for components being rendered as values in stache templates
592592
Component.prototype[viewInsertSymbol] = function(viewData) {
593-
viewData.nodeList.deepChildren.push(this.nodeList);
593+
viewData.nodeList.newDeepChildren.push(this.nodeList);
594594
return this.element;
595595
};
596596

test/component-instantiation-test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,18 @@ QUnit.test("Component binding instantiation works as documented", function() {
289289
QUnit.equal(family.get("full"), "Milo Flanders", "map “to” prop is correct");
290290
});
291291

292-
QUnit.test("Component can be removed from the page", function(){
292+
QUnit.test("Component can be removed from the page", 2, function(){
293+
293294
var ToBeRemoved = Component.extend({
294295
tag: "to-be-removed",
295296
view: "{{prop}}",
296297
ViewModel: {
297298
prop: "string"
299+
},
300+
events: {
301+
"{element} beforeremove": function(){
302+
QUnit.ok(true, "torn down");
303+
}
298304
}
299305
});
300306

@@ -317,4 +323,6 @@ QUnit.test("Component can be removed from the page", function(){
317323

318324
show.set(false);
319325
QUnit.ok(true, "got here without an error");
326+
327+
320328
});

0 commit comments

Comments
 (0)