Skip to content

Commit 2cfb538

Browse files
committed
use a clearer test for this PR
This test was presumably extracted from https://github.com/emberjs/ember.js/pull/20907/files wher eit makes sense. I'm replacing it with one that only covers the immediate change being made in this PR.
1 parent 4f48e3b commit 2cfb538

File tree

1 file changed

+4
-35
lines changed

1 file changed

+4
-35
lines changed

packages/@ember/-internals/glimmer/tests/integration/components/runtime-template-compiler-implicit-test.ts

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,32 @@
1-
import { tracked } from '@ember/-internals/metal';
21
import { template } from '@ember/template-compiler/runtime';
3-
import { RenderingTestCase, defineSimpleModifier, moduleFor, runTask } from 'internal-test-helpers';
2+
import { RenderingTestCase, defineSimpleModifier, moduleFor } from 'internal-test-helpers';
43
import GlimmerishComponent from '../../utils/glimmerish-component';
54
import { on } from '@ember/modifier/on';
65
import { fn } from '@ember/helper';
76

87
moduleFor(
98
'Strict Mode - Runtime Template Compiler (implicit)',
109
class extends RenderingTestCase {
11-
async '@test can have in-scope tracked data'(assert: Assert) {
10+
async '@test can immediately render a runtime-compiled template'() {
1211
class State {
13-
@tracked str = `hello there`;
14-
1512
get component() {
16-
assert.step('get component');
17-
18-
let getStr = () => {
19-
assert.step('getStr()');
20-
return this.str;
21-
};
22-
23-
hide(getStr);
24-
25-
return template(`{{ (getStr) }}`, {
26-
eval() {
27-
return eval(arguments[0]);
28-
},
29-
});
13+
return template(`hello there`);
3014
}
3115
}
3216

17+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
3318
let state = new State();
3419

3520
await this.renderComponentModule(() => {
3621
return template('<state.component />', {
3722
eval() {
38-
assert.step('eval');
3923
return eval(arguments[0]);
4024
},
4125
});
4226
});
4327

4428
this.assertHTML('hello there');
4529
this.assertStableRerender();
46-
assert.verifySteps([
47-
// for every value in the component, for eevry node traversed in the compiler
48-
'eval', // precompileJSON -> ... ElementNode -> ... -> lexicalScope -> isScope('state', ...)
49-
'eval', // "..."
50-
'eval', // "..."
51-
'eval', // creating the templateFactory
52-
'get component',
53-
'getStr()',
54-
]);
55-
56-
runTask(() => (state.str += '!'));
57-
58-
this.assertHTML('hello there!');
59-
this.assertStableRerender();
60-
assert.verifySteps(['getStr()']);
6130
}
6231

6332
async '@test Can use a component in scope'() {

0 commit comments

Comments
 (0)