Skip to content

Commit 4ea1e26

Browse files
committed
Try this
1 parent 081016d commit 4ea1e26

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

addon/src/settled.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,24 @@ if (loader.registry['ember-testing/test/waiters']) {
190190
function checkWaiters() {
191191
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
192192
type Waiter = [any, Function];
193-
const EmberTest = Ember.Test as any as { waiters: Array<Waiter> };
193+
const EmberTest = Ember.Test as any as {
194+
waiters: Array<Waiter>;
195+
checkWaiters: () => boolean;
196+
};
194197

195198
if (_internalCheckWaiters) {
196199
return _internalCheckWaiters();
197-
} else if (EmberTest.waiters) {
200+
}
201+
202+
if (EmberTest.waiters) {
198203
if (
199204
EmberTest.waiters.some(([context, callback]) => !callback.call(context))
200205
) {
201206
return true;
202207
}
203208
}
204209

205-
return false;
210+
return EmberTest.checkWaiters();
206211
}
207212

208213
export interface SettledState {

test-app/ember-cli-build.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ module.exports = function (defaults) {
3939
'{{inner-comp}}': { safeToIgnore: true },
4040
'{{template-only}}': { safeToIgnore: true },
4141
},
42-
helpers: {
43-
'{{jax}}': { safeToIgnore: true },
44-
},
4542
},
4643
],
4744
});

test-app/tests/unit/setup-rendering-context-test.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ module('setupRenderingContext', function (hooks) {
8787
'component:js-only': Component.extend({
8888
classNames: ['js-only'],
8989
}),
90-
'helper:jax': helper(([name]) => `${name}-jax`),
9190
'component:outer-comp': setComponentTemplate(
9291
hbs`outer{{inner-comp}}outer`,
9392
class extends Component {}
@@ -287,15 +286,21 @@ module('setupRenderingContext', function (hooks) {
287286
});
288287

289288
test('can invoke helper', async function (assert) {
290-
await render(hbs`{{jax "max"}}`);
289+
this.setProperties({
290+
jax: helper(([name]) => `${name}-jax`),
291+
});
292+
await render(hbs`{{this.jax "max"}}`);
291293

292294
assert.equal(this.element.textContent, 'max-jax');
293295
});
294296

295297
test('can pass arguments to helper from context', async function (assert) {
298+
this.setProperties({
299+
jax: helper(([name]) => `${name}-jax`),
300+
});
296301
this.set('name', 'james');
297302

298-
await render(hbs`{{jax this.name}}`);
303+
await render(hbs`{{this.jax this.name}}`);
299304

300305
assert.equal(this.element.textContent, 'james-jax');
301306
});

0 commit comments

Comments
 (0)