@@ -206,6 +206,64 @@ describe('useCopyIssueDetails', () => {
206206 expect ( result ) . toContain ( '**Type:** TypeError' ) ;
207207 expect ( result ) . toContain ( '**Value:** Cannot read property of undefined' ) ;
208208 expect ( result ) . toContain ( '#### Stacktrace' ) ;
209+ // No mechanism on this exception, so no handled line.
210+ expect ( result ) . not . toContain ( '**Handled:**' ) ;
211+ } ) ;
212+
213+ it ( 'marks an unhandled exception' , ( ) => {
214+ const eventWithUnhandled = EventFixture ( {
215+ ...event ,
216+ entries : [
217+ {
218+ type : EntryType . EXCEPTION ,
219+ data : {
220+ values : [
221+ {
222+ type : 'TypeError' ,
223+ value : 'boom' ,
224+ mechanism : { type : 'onerror' , handled : false } ,
225+ } ,
226+ ] ,
227+ } ,
228+ } ,
229+ ] ,
230+ } ) ;
231+
232+ const result = issueAndEventToMarkdown ( {
233+ group,
234+ event : eventWithUnhandled ,
235+ organization,
236+ } ) ;
237+
238+ expect ( result ) . toContain ( '**Handled:** No' ) ;
239+ } ) ;
240+
241+ it ( 'marks a handled exception' , ( ) => {
242+ const eventWithHandled = EventFixture ( {
243+ ...event ,
244+ entries : [
245+ {
246+ type : EntryType . EXCEPTION ,
247+ data : {
248+ values : [
249+ {
250+ type : 'ValueError' ,
251+ value : 'caught' ,
252+ mechanism : { type : 'generic' , handled : true } ,
253+ } ,
254+ ] ,
255+ } ,
256+ } ,
257+ ] ,
258+ } ) ;
259+
260+ const result = issueAndEventToMarkdown ( {
261+ group,
262+ event : eventWithHandled ,
263+ organization,
264+ } ) ;
265+
266+ expect ( result ) . toContain ( '**Handled:** Yes' ) ;
209267 } ) ;
210268
211269 it ( 'includes thread stacktrace when activeThreadId matches' , ( ) => {
0 commit comments