Skip to content

Commit b5decf6

Browse files
committed
Add test for rerender assertion during task cancelation
Was occuring in Ember 3.15+ within non-lifeycle or computed contexts such as native getters within Glimmer components
1 parent 3775068 commit b5decf6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/integration/no-render-breaking-test.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,32 @@ module('Integration | no render breaking', function(hooks) {
4444
`);
4545
assert.ok(true, "Renders");
4646
});
47+
48+
test('Issue #340 | internal task state updates in cancellation do not trigger re-render assertions w/ auto-tracking', async function(assert) {
49+
assert.expect(1);
50+
51+
this.owner.register(
52+
'component:e-c-test',
53+
Component.extend({
54+
layout: hbs`<div>{{this.value}}</div>`,
55+
56+
get value() {
57+
this._super(...arguments);
58+
59+
this.exampleTask.perform();
60+
this.exampleTask.perform();
61+
62+
return "value";
63+
},
64+
65+
exampleTask: task(function*() {
66+
yield timeout(100);
67+
}).restartable()
68+
})
69+
);
70+
71+
await render(hbs`<ECTest />`);
72+
assert.ok(true, "Renders");
73+
});
4774
}
4875
});

0 commit comments

Comments
 (0)