Skip to content

Commit 2eb6799

Browse files
committed
Bad timing routing issue, failing test
1 parent f19f186 commit 2eb6799

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

packages/ember/tests/routing/substates_test.js

+32
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,38 @@ moduleFor('Loading/Error Substates', class extends ApplicationTestCase {
219219
return promise;
220220
}
221221

222+
['@test Bad timing issue ☠️'](assert) {
223+
let appDeferred = RSVP.defer();
224+
225+
this.router.map(function() {
226+
this.route('dummy');
227+
});
228+
229+
this.addTemplate('application_loading', `
230+
<div id="toplevel-loading">TOPLEVEL LOADING</div>
231+
`);
232+
this.add('route:application', Route.extend({
233+
model() {
234+
return appDeferred.promise;
235+
}
236+
}));
237+
238+
this.add('route:dummy', Route.extend({
239+
redirect() {
240+
return RSVP.resolve()
241+
.then(() => this.replaceWith('index'));
242+
}
243+
}));
244+
245+
let promise = this.visit('/dummy').then(() => {
246+
assert.ok(true);
247+
});
248+
249+
appDeferred.resolve();
250+
251+
return promise;
252+
}
253+
222254
['@test Prioritized substate entry works with preserved-namespace nested routes'](assert) {
223255
let deferred = RSVP.defer();
224256

0 commit comments

Comments
 (0)