Skip to content

Commit

Permalink
Bad timing routing issue, failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
wagenet committed Feb 7, 2022
1 parent 14b3d81 commit e5564cc
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions packages/ember/tests/routing/substates_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,50 @@ moduleFor(
});
}

['@test Bad timing issue ☠️'](assert) {
let appDeferred = RSVP.defer();

this.router.map(function () {
this.route('dummy');
});

this.addTemplate(
'application_loading',
`
<div id="toplevel-loading">TOPLEVEL LOADING</div>
`
);
this.add(
'route:application',
Route.extend({
model() {
return appDeferred.promise;
},
})
);

this.add(
'route:dummy',
Route.extend({
redirect() {
return RSVP.resolve().then(() => {
expectDeprecation(() => {
this.replaceWith('index');
}, 'Calling replaceWith on a route is deprecated. Use the RouterService instead.');
});
},
})
);

let promise = this.visit('/dummy').then(() => {
assert.ok(true);
});

appDeferred.resolve();

return promise;
}

['@test Enter child-loading route with correct query parameters'](assert) {
assert.expect(8);
let deferred = RSVP.defer();
Expand Down

0 comments on commit e5564cc

Please sign in to comment.