Skip to content

Commit fe99bd9

Browse files
committed
Bad timing routing issue, failing test
1 parent 370cf34 commit fe99bd9

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

packages/ember/tests/routing/substates_test.js

+44
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,50 @@ moduleFor(
268268
});
269269
}
270270

271+
['@test Bad timing issue ☠️'](assert) {
272+
let appDeferred = RSVP.defer();
273+
274+
this.router.map(function () {
275+
this.route('dummy');
276+
});
277+
278+
this.addTemplate(
279+
'application_loading',
280+
`
281+
<div id="toplevel-loading">TOPLEVEL LOADING</div>
282+
`
283+
);
284+
this.add(
285+
'route:application',
286+
Route.extend({
287+
model() {
288+
return appDeferred.promise;
289+
},
290+
})
291+
);
292+
293+
this.add(
294+
'route:dummy',
295+
Route.extend({
296+
redirect() {
297+
return RSVP.resolve().then(() => {
298+
expectDeprecation(() => {
299+
this.replaceWith('index');
300+
}, 'Calling replaceWith on a route is deprecated. Use the RouterService instead.');
301+
});
302+
},
303+
})
304+
);
305+
306+
let promise = this.visit('/dummy').then(() => {
307+
assert.ok(true);
308+
});
309+
310+
appDeferred.resolve();
311+
312+
return promise;
313+
}
314+
271315
['@test Enter child-loading route with correct query parameters'](assert) {
272316
assert.expect(8);
273317
let deferred = RSVP.defer();

0 commit comments

Comments
 (0)