@@ -56,6 +56,13 @@ describe('Angular Tracing', () => {
5656 describe ( 'getParameterizedRouteFromSnapshot' , ( ) => {
5757 it . each ( [
5858 [ 'returns `/` empty object if the route no children' , { } , '/' ] ,
59+ [
60+ 'returns `/` if the route with empty child' ,
61+ {
62+ firstChild : { routeConfig : { path : '' } } ,
63+ } ,
64+ '/' ,
65+ ] ,
5966 [
6067 'returns the route of a snapshot without children' ,
6168 {
@@ -76,6 +83,21 @@ describe('Angular Tracing', () => {
7683 } ,
7784 '/orgs/:orgId/projects/:projId/overview/' ,
7885 ] ,
86+ [
87+ 'returns the route of a snapshot without children but with empty paths' ,
88+ {
89+ firstChild : {
90+ routeConfig : { path : 'users' } ,
91+ firstChild : {
92+ routeConfig : { path : '' } ,
93+ firstChild : {
94+ routeConfig : { path : ':id' } ,
95+ } ,
96+ } ,
97+ } ,
98+ } ,
99+ '/users/:id/' ,
100+ ] ,
79101 ] ) ( '%s' , ( _ , routeSnapshot , expectedParams ) => {
80102 expect ( getParameterizedRouteFromSnapshot ( routeSnapshot as unknown as ActivatedRouteSnapshot ) ) . toEqual (
81103 expectedParams ,
@@ -345,6 +367,7 @@ describe('Angular Tracing', () => {
345367 public ngOnInit ( ) {
346368 origNgOnInitMock ( ) ;
347369 }
370+
348371 public ngAfterViewInit ( ) {
349372 origNgAfterViewInitMock ( ) ;
350373 }
@@ -398,6 +421,7 @@ describe('Angular Tracing', () => {
398421 public ngOnInit ( ) {
399422 origNgOnInitMock ( ) ;
400423 }
424+
401425 @TraceMethodDecorator ( )
402426 public ngAfterViewInit ( ) {
403427 origNgAfterViewInitMock ( ) ;
0 commit comments