@@ -86,7 +86,7 @@ describe("breadcrumbs", function() {
86
86
87
87
it (
88
88
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" ,
90
90
IS_LOADER
91
91
) ,
92
92
function ( ) {
@@ -112,7 +112,44 @@ describe("breadcrumbs", function() {
112
112
return ;
113
113
}
114
114
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" ) ;
116
153
assert . equal ( summary . breadcrumbs [ 0 ] . level , "warning" ) ;
117
154
assert . equal ( summary . breadcrumbs [ 0 ] . message , "someMessage" ) ;
118
155
} ) ;
0 commit comments