@@ -2,10 +2,9 @@ import { Location } from '@angular/common';
22import { Title } from '@angular/platform-browser' ;
33import { Router , UrlSegment } from '@angular/router' ;
44import { RouterTestingModule } from '@angular/router/testing' ;
5- import { IconType } from '@hypertrace/assets-library' ;
6- import { APP_TITLE , NavItemType } from '@hypertrace/common' ;
75import { patchRouterNavigateForTest } from '@hypertrace/test-utils' ;
86import { createServiceFactory , mockProvider , SpectatorService } from '@ngneat/spectator/jest' ;
7+ import { APP_TITLE } from './ht-route' ;
98import {
109 ExternalNavigationPathParams ,
1110 ExternalNavigationWindowHandling ,
@@ -69,6 +68,7 @@ describe('Navigation Service', () => {
6968 patchRouterNavigateForTest ( spectator ) ;
7069 router = spectator . inject ( Router ) ;
7170 } ) ;
71+
7272 test ( 'can retrieve a route config relative to the current route' , ( ) => {
7373 router . navigate ( [ 'root' ] ) ;
7474 expect ( spectator . service . getRouteConfig ( [ 'child' ] ) ) . toEqual ( firstChildRouteConfig ) ;
@@ -297,36 +297,6 @@ describe('Navigation Service', () => {
297297 }
298298 } ) ;
299299
300- test ( 'decorating navItem with features work as expected' , ( ) => {
301- expect (
302- spectator . service . decorateNavItem (
303- {
304- type : NavItemType . Header ,
305- label : 'Label'
306- } ,
307- spectator . service . getCurrentActivatedRoute ( )
308- )
309- ) . toEqual ( { type : NavItemType . Header , label : 'Label' } ) ;
310-
311- expect (
312- spectator . service . decorateNavItem (
313- {
314- type : NavItemType . Link ,
315- label : 'Label' ,
316- icon : IconType . None ,
317- matchPaths : [ 'root' ]
318- } ,
319- spectator . service . rootRoute ( )
320- )
321- ) . toEqual ( {
322- type : NavItemType . Link ,
323- label : 'Label' ,
324- icon : IconType . None ,
325- matchPaths : [ 'root' ] ,
326- features : [ 'test-feature' ]
327- } ) ;
328- } ) ;
329-
330300 test ( 'setting title should work as expected' , ( ) => {
331301 router . navigate ( [ 'root' , 'child' ] ) ;
332302 expect ( spectator . inject ( Title ) . setTitle ) . toHaveBeenCalledWith ( 'defaultAppTitle | child1' ) ;
0 commit comments