Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. import { NgModule } from '@angular/core';
  2. import { Routes, RouterModule } from '@angular/router';
  3.  
  4. export const routes: Routes = [
  5. {path: 'dashboard', loadChildren: './dashboard/dashboard.module#DashboardModule'},
  6. {path: '', loadChildren: './splash/splash.module#SplashModule'},
  7. ];
  8.  
  9. @NgModule({
  10. imports: [RouterModule.forRoot(routes)],
  11. exports: [RouterModule]
  12. })
  13. export class AppRoutingModule { }
  14.  
  15. import { TestBed, fakeAsync, tick, async } from "@angular/core/testing";
  16. import { RouterTestingModule } from '@angular/router/testing';
  17. import { AppComponent } from './app.component';
  18. import { routes } from './app-routing.module';
  19.  
  20. describe('AppComponent', () => {
  21. beforeEach(async(() => {
  22. TestBed.configureTestingModule({
  23. imports: [
  24. RouterTestingModule.withRoutes(routes)
  25. ],
  26. declarations: [
  27. AppComponent
  28. ],
  29. }).compileComponents();
  30. }));
  31.  
  32. it('should create the app', async(() => {
  33. const fixture = TestBed.createComponent(AppComponent);
  34. const app = fixture.debugElement.componentInstance;
  35. expect(app).toBeTruthy();
  36. }));
  37.  
  38. it('should have as title "feedback-analytics"', async(() => {
  39. const fixture = TestBed.createComponent(AppComponent);
  40. const app = fixture.debugElement.componentInstance;
  41. expect(app.title).toEqual("feedback-analytics");
  42. }));
  43.  
  44. // it("navigate to '' redirects you to /dashboard ", fakeAsync(() => {
  45. // this.routes.navigate(['']);
  46. // tick();
  47. // expect(location.path()).toBe('/dashboard');
  48. // }));
  49. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement