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 a559e8f commit 715d49d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
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.2.0",
"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
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7436,10 +7436,10 @@ route-recognizer@^0.3.4:
resolved "https://registry.yarnpkg.com/route-recognizer/-/route-recognizer-0.3.4.tgz#39ab1ffbce1c59e6d2bdca416f0932611e4f3ca3"
integrity sha512-2+MhsfPhvauN1O8KaXpXAOfR/fwe8dnUXVM+xw7yt40lJRfPVQxV6yryZm0cgRvAj5fMF/mdRZbL2ptwbs5i2g==

router_js@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/router_js/-/router_js-6.2.0.tgz#df2eac625169997f03d7cdf67507bda49d98be3a"
integrity sha512-K57PWU58OiXlaGzHw1vXg0PeC8NpMRIsd3poXq0qXZRIzB3OtMJQolHUuJ0c88544gv+tKw1kaYYM/0E1XNmng==
router_js@^6.2.1:
version "6.2.1"
resolved "https://registry.yarnpkg.com/router_js/-/router_js-6.2.1.tgz#60130764ad3ed41592a41b9a0bb9133b3edc7d84"
integrity sha512-DL0FPuLZUkk7/mhIcXK3SO7215gyOVcQinPtdcLRHKJDt8GGqN6c0pNr0+vuE1IQX7QW1YyuIxBICZ0egzn8Dg==
dependencies:
"@types/node" "^10.5.5"

Expand Down

0 comments on commit 715d49d

Please sign in to comment.