Added test for preserving nested components on rerender

This commit is contained in:
Patrick Steele-Idem 2017-04-12 20:25:41 -06:00
parent 9db31cda04
commit 6f64ea8c24
3 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,10 @@
static var renderCount = 0;
class {
}
<div.hello>
Hello ${input.name}!
<span.render-count>${renderCount++}</span>
</div>

View File

@ -0,0 +1,6 @@
class {
}
<div>
<hello name="Frank"/>
</div>

View File

@ -0,0 +1,12 @@
var expect = require('chai').expect;
module.exports = function(helpers) {
var component = helpers.mount(require('./index'), {});
expect(component.el.querySelector('.render-count').innerHTML).to.equal('0');
component.forceUpdate();
component.update();
expect(component.el.querySelector('.render-count').innerHTML).to.equal('0');
};