mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Added test for destroy cleanup
This commit is contained in:
parent
081fd49ee9
commit
7d72e56b6e
@ -150,6 +150,19 @@ describe('widget' , function() {
|
||||
expect(document.getElementById('target').childNodes[1]).to.equal(newWidget.el);
|
||||
expect(document.getElementById('target').childNodes[2]).to.equal(nextSibling);
|
||||
});
|
||||
|
||||
it('should remove destroyed widgets from scoped widget collection', function() {
|
||||
var fooWidget = require('./fixtures/components/app-foo')
|
||||
.render({})
|
||||
.appendTo(document.getElementById('target'))
|
||||
.getWidget();
|
||||
|
||||
expect(fooWidget.widgets.bar).to.not.be.empty;
|
||||
|
||||
fooWidget.widgets.bar.destroy();
|
||||
|
||||
expect(fooWidget.widgets.bar).to.be.empty;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user