11import { Component } from '@angular/core' ;
22import type { ActivatedRouteSnapshot , CanActivate , RouterStateSnapshot } from '@angular/router' ;
3- import { SentrySemanticAttributes } from '@sentry/core' ;
3+ import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core' ;
44
55import { TraceClassDecorator , TraceDirective , TraceMethodDecorator , instrumentAngularRouting } from '../src' ;
66import { getParameterizedRouteFromSnapshot } from '../src/tracing' ;
@@ -15,7 +15,7 @@ const defaultStartTransaction = (ctx: any) => {
1515 setAttribute : jest . fn ( ) ,
1616 toJSON : ( ) => ( {
1717 data : {
18- [ SentrySemanticAttributes . Source ] : 'custom' ,
18+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'custom' ,
1919 ...ctx . data ,
2020 } ,
2121 } ) ,
@@ -52,7 +52,7 @@ describe('Angular Tracing', () => {
5252 name : '/' ,
5353 op : 'pageload' ,
5454 origin : 'auto.pageload.angular' ,
55- data : { [ SentrySemanticAttributes . Source ] : 'url' } ,
55+ data : { [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'url' } ,
5656 } ) ;
5757 } ) ;
5858 } ) ;
@@ -117,7 +117,7 @@ describe('Angular Tracing', () => {
117117 toJSON : ( ) => ( {
118118 data : {
119119 ...ctx . data ,
120- [ SentrySemanticAttributes . Source ] : 'custom' ,
120+ [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'custom' ,
121121 } ,
122122 } ) ,
123123 metadata : ctx . metadata ,
@@ -146,12 +146,12 @@ describe('Angular Tracing', () => {
146146 name : url ,
147147 op : 'pageload' ,
148148 origin : 'auto.pageload.angular' ,
149- data : { [ SentrySemanticAttributes . Source ] : 'url' } ,
149+ data : { [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'url' } ,
150150 } ) ;
151151
152152 expect ( transaction . updateName ) . toHaveBeenCalledTimes ( 0 ) ;
153153 expect ( transaction . name ) . toEqual ( url ) ;
154- expect ( transaction . toJSON ( ) . data ) . toEqual ( { [ SentrySemanticAttributes . Source ] : 'custom' } ) ;
154+ expect ( transaction . toJSON ( ) . data ) . toEqual ( { [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'custom' } ) ;
155155
156156 env . destroy ( ) ;
157157 } ) ;
@@ -337,10 +337,10 @@ describe('Angular Tracing', () => {
337337 name : url ,
338338 op : 'navigation' ,
339339 origin : 'auto.navigation.angular' ,
340- data : { [ SentrySemanticAttributes . Source ] : 'url' } ,
340+ data : { [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'url' } ,
341341 } ) ;
342342 expect ( transaction . updateName ) . toHaveBeenCalledWith ( result ) ;
343- expect ( transaction . setAttribute ) . toHaveBeenCalledWith ( SentrySemanticAttributes . Source , 'route' ) ;
343+ expect ( transaction . setAttribute ) . toHaveBeenCalledWith ( SEMANTIC_ATTRIBUTE_SENTRY_SOURCE , 'route' ) ;
344344
345345 env . destroy ( ) ;
346346 } ) ;
0 commit comments