Skip to content

Commit

Permalink
[BUGFIX] Ensure that delayed transition retrys work
Browse files Browse the repository at this point in the history
Targeting master branch with same fix as #17328
  • Loading branch information
chadhietala committed Dec 10, 2018
1 parent 1edb3f9 commit 259b5f7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"puppeteer": "^1.3.0",
"qunit": "^2.8.0",
"route-recognizer": "^0.3.4",
"router_js": "^6.1.3",
"router_js": "^6.2.1",
"rsvp": "^4.8.4",
"semver": "^5.5.0",
"serve-static": "^1.13.2",
Expand Down
28 changes: 28 additions & 0 deletions packages/ember/tests/routing/router_service_test/events_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { RouterTestCase, moduleFor } from 'internal-test-helpers';
import { EMBER_ROUTING_ROUTER_SERVICE } from '@ember/canary-features';
import { inject as service } from '@ember/service';
import { Route } from '@ember/-internals/routing';
import { later } from '@ember/runloop';

if (EMBER_ROUTING_ROUTER_SERVICE) {
moduleFor(
Expand Down Expand Up @@ -99,6 +100,33 @@ if (EMBER_ROUTING_ROUTER_SERVICE) {
});
}

'@test transitions can be retried async'(assert) {
let done = assert.async();
this.add(
`route:parent.child`,
Route.extend({
actions: {
willTransition(transition) {
transition.abort();
this.intermediateTransitionTo('parent.sister');
later(() => {
transition.retry();
done();
}, 500);
},
},
})
);

return this.visit('/child')
.then(() => {
return this.visit('/');
})
.catch(e => {
assert.equal(e.message, 'TransitionAborted');
});
}

'@test redirection with `transitionTo`'(assert) {
assert.expect(8);
let toChild = false;
Expand Down

0 comments on commit 259b5f7

Please sign in to comment.