我正在尝试在我的应用程序中测试页面,但是通常该页面需要登录用户才能访问它。我想绕过此身份验证防护,因此无需登录即可访问页面,因为此测试并非旨在测试防护功能。
// clients.routing.module.ts
const clientsRoutes: Routes = [
{
path: 'clients',
component: ClientIndexPage,
canActivate: [AuthGuard],
data: {animation: 'ClientIndexPage'}
},
...
]
// client-index.e2e-spec.ts
describe('ClientIndex', () => {
beforeEach(() => {
browser.get('/clients');
})
it("should set the page title correctly", () => {
expect(browser.getTitle()).toEqual("Client Index")
})
})
这是我嘲笑AuthGuard
的情况吗?我该怎么办?