Skip to content

Commit 2b206f9

Browse files
committed
Bad timing routing issue, failing test
1 parent 56c3520 commit 2b206f9

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

packages/ember/tests/routing/substates_test.js

+40
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,46 @@ 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(
278+
'application_loading',
279+
`
280+
<div id="toplevel-loading">TOPLEVEL LOADING</div>
281+
`
282+
);
283+
this.add(
284+
'route:application',
285+
Route.extend({
286+
model() {
287+
return appDeferred.promise;
288+
},
289+
})
290+
);
291+
292+
this.add(
293+
'route:dummy',
294+
Route.extend({
295+
redirect() {
296+
return RSVP.resolve().then(() => this.replaceWith('index'));
297+
},
298+
})
299+
);
300+
301+
let promise = this.visit('/dummy').then(() => {
302+
assert.ok(true);
303+
});
304+
305+
appDeferred.resolve();
306+
307+
return promise;
308+
}
309+
270310
['@test Enter child-loading route with correct query parameters'](assert) {
271311
assert.expect(9);
272312
let deferred = RSVP.defer();

0 commit comments

Comments
 (0)