Skip to content

Commit 490042f

Browse files
committed
Bad timing routing issue, failing test
1 parent 56c3520 commit 490042f

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
@@ -267,6 +267,38 @@ moduleFor(
267267
});
268268
}
269269

270+
['@test Bad timing issue ☠️'](assert) {
271+
let appDeferred = RSVP.defer();
272+
273+
this.router.map(function() {
274+
this.route('dummy');
275+
});
276+
277+
this.addTemplate('application_loading', `
278+
<div id="toplevel-loading">TOPLEVEL LOADING</div>
279+
`);
280+
this.add('route:application', Route.extend({
281+
model() {
282+
return appDeferred.promise;
283+
}
284+
}));
285+
286+
this.add('route:dummy', Route.extend({
287+
redirect() {
288+
return RSVP.resolve()
289+
.then(() => this.replaceWith('index'));
290+
}
291+
}));
292+
293+
let promise = this.visit('/dummy').then(() => {
294+
assert.ok(true);
295+
});
296+
297+
appDeferred.resolve();
298+
299+
return promise;
300+
}
301+
270302
['@test Enter child-loading route with correct query parameters'](assert) {
271303
assert.expect(9);
272304
let deferred = RSVP.defer();

0 commit comments

Comments
 (0)