fix(router): handle URL that does not match a route
Closes #7349 Closes #7203
This commit is contained in:

committed by
Alex Eagle

parent
aa43d2f87b
commit
8e3e45097a
@ -145,6 +145,22 @@ export function main() {
|
||||
});
|
||||
}));
|
||||
|
||||
|
||||
it('should trigger the onError callback of a router change subscription if the URL does not match a route',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
var outlet = makeDummyOutlet();
|
||||
|
||||
router.registerPrimaryOutlet(outlet)
|
||||
.then((_) => router.config([new Route({path: '/a', component: DummyComponent})]))
|
||||
.then((_) => {
|
||||
router.subscribe((_) => {}, (url) => {
|
||||
expect(url).toEqual('b');
|
||||
async.done();
|
||||
});
|
||||
(<SpyLocation>location).simulateHashChange('b');
|
||||
});
|
||||
}));
|
||||
|
||||
it('should navigate after being configured', inject([AsyncTestCompleter], (async) => {
|
||||
var outlet = makeDummyOutlet();
|
||||
|
||||
|
Reference in New Issue
Block a user