我正在编写一个单元测试,以确保未注册的路由将用户带到PageNotFoundComponent。我不知道如何在茉莉花测试中测试它。如果这是一个愚蠢的问题,我是棱角分明的新人。
这是我想要完成的一个例子
it('should show page not found when route is not defined', () => {
router.navigate(['/not-a-route']).then(() => {
//TODO test this works as expected
//{ path: '**', component: PageNotFoundComponent }
});
});