@@ -86,7 +86,7 @@ describe("breadcrumbs", function() {
8686
8787 it (
8888 optional (
89- "should transform XMLHttpRequests to the Sentry store endpoint as sentry type breadcrumb" ,
89+ "should transform XMLHttpRequests with events to the Sentry store endpoint as sentry.event type breadcrumb" ,
9090 IS_LOADER
9191 ) ,
9292 function ( ) {
@@ -112,7 +112,44 @@ describe("breadcrumbs", function() {
112112 return ;
113113 }
114114 assert . equal ( summary . breadcrumbs . length , 1 ) ;
115- assert . equal ( summary . breadcrumbs [ 0 ] . category , "sentry" ) ;
115+ assert . equal ( summary . breadcrumbs [ 0 ] . category , "sentry.event" ) ;
116+ assert . equal ( summary . breadcrumbs [ 0 ] . level , "warning" ) ;
117+ assert . equal ( summary . breadcrumbs [ 0 ] . message , "someMessage" ) ;
118+ } ) ;
119+ }
120+ ) ;
121+
122+ it (
123+ optional (
124+ "should transform XMLHttpRequests with transactions to the Sentry store endpoint as sentry.transaction type breadcrumb" ,
125+ IS_LOADER
126+ ) ,
127+ function ( ) {
128+ return runInSandbox ( sandbox , { manual : true } , function ( ) {
129+ var store =
130+ document . location . protocol +
131+ "//" +
132+ document . location . hostname +
133+ ( document . location . port ? ":" + document . location . port : "" ) +
134+ "/api/1/store/" +
135+ "?sentry_key=1337" ;
136+
137+ var xhr = new XMLHttpRequest ( ) ;
138+ xhr . open ( "POST" , store ) ;
139+ xhr . send (
140+ '{"message":"someMessage","transaction":"wat","level":"warning"}'
141+ ) ;
142+ waitForXHR ( xhr , function ( ) {
143+ Sentry . captureMessage ( "test" ) ;
144+ window . finalizeManualTest ( ) ;
145+ } ) ;
146+ } ) . then ( function ( summary ) {
147+ // The async loader doesn't wrap XHR
148+ if ( IS_LOADER ) {
149+ return ;
150+ }
151+ assert . equal ( summary . breadcrumbs . length , 1 ) ;
152+ assert . equal ( summary . breadcrumbs [ 0 ] . category , "sentry.transaction" ) ;
116153 assert . equal ( summary . breadcrumbs [ 0 ] . level , "warning" ) ;
117154 assert . equal ( summary . breadcrumbs [ 0 ] . message , "someMessage" ) ;
118155 } ) ;
0 commit comments