Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. describe('Navbar Component', () => {
  2. let router: Router;
  3. // Other definitions...
  4.  
  5. beforeEach(async(() => {
  6. // Configuring Testbed etc...
  7. }))
  8.  
  9. describe('routes A', () => {
  10. beforeEach(async(() => {
  11. router = TestBed.get(Router)
  12. router.navigate(['/', 'a']);
  13. }))
  14.  
  15. it('should show the relevant links', async(() => {
  16. // Testing code
  17. }))
  18. })
  19. })
  20.  
  21. this.router.events
  22. .subscribe((routerEvent: Event) => {
  23. if (routerEvent instanceof NavigationStart) {
  24. // Do stuff
  25. }
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement