Updating acceptance tests
MODIFY
tests/acceptance/deferred-render-test.js
tests/acceptance/deferred-render-test.js
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
-import { visit } from '@ember/test-helpers';
+import { visit, currentRouteName } from '@ember/test-helpers';
import { setupRouter, reset } from 'ember-app-scheduler';
module('Acceptance | deferred render', function(hooks) {
@@ -17,20 +17,29 @@ module('Acceptance | deferred render', function(hooks) {
});
test('visiting route renders deferred content via whenRoutePainted', async function(assert) {
- assert.expect(0);
+ assert.expect(2);
await visit('/first-paint');
+
+ assert.equal(currentRouteName(), 'first-paint');
+ assert.dom('.only-when-route-painted').exists();
});
test('visiting route renders deferred content via whenRouteIdle', async function(assert) {
- assert.expect(0);
+ assert.expect(2);
await visit('/content-paint');
+
+ assert.equal(currentRouteName(), 'content-paint');
+ assert.dom('.only-when-route-idle').exists();
});
test('visiting a route and immediately transitioning correctly aborts current transition', async function(assert) {
- assert.expect(0);
+ assert.expect(2);
await visit('/aborted-paint');
+
+ assert.equal(currentRouteName(), 'first-paint');
+ assert.dom('.only-when-route-painted').exists();
});
});

MODIFY
tests/integration/deferred-render-in-component-test.js
tests/integration/deferred-render-in-component-test.js
@@ -89,4 +89,8 @@ module('deferred render in component', function(hooks) {
assert.isVisible(foo);
});
+
+ test('existing transition signals correctly if transition is aborted before completion', async function(assert) {
+ assert.expect(0);
+ });
});

Updating acceptance tests