@@ -198,6 +198,7 @@ describe('IssuePreview', () => {
198198 const stackTrace = await screen . findByRole ( 'region' , { name : 'Stack Trace' } ) ;
199199 expect ( within ( stackTrace ) . getByText ( 'an error occurred' ) ) . toBeVisible ( ) ;
200200 expect ( within ( stackTrace ) . getByText ( 'doThing' ) ) . toBeVisible ( ) ;
201+ expect ( within ( stackTrace ) . getByTestId ( 'core-stacktrace-frame-context' ) ) . toBeVisible ( ) ;
201202 expect ( summaryRequest ) . not . toHaveBeenCalled ( ) ;
202203 } ) ;
203204
@@ -309,11 +310,30 @@ describe('IssuePreview', () => {
309310 } ) ;
310311 } ) ;
311312
312- it ( 'shows the recommended stack trace alongside Seer analysis' , async ( ) => {
313+ it ( 'keeps frames expanded when historical RCA metadata has no Seer content to show' , async ( ) => {
314+ MockApiClient . addMockResponse ( {
315+ url : `/organizations/${ organization . slug } /issues/${ group . id } /` ,
316+ body : { ...group , derivedData : fixAppliedGroup . derivedData } ,
317+ } ) ;
313318 MockApiClient . addMockResponse ( {
314319 url : `/organizations/${ organization . slug } /issues/${ group . id } /events/recommended/` ,
315320 body : EventStacktraceExceptionFixture ( ) ,
316321 } ) ;
322+
323+ render ( < IssuePreview groupId = { group . id } /> , { organization} ) ;
324+
325+ const stackTrace = await screen . findByRole ( 'region' , { name : 'Stack Trace' } ) ;
326+ expect ( within ( stackTrace ) . getByTestId ( 'core-stacktrace-frame-context' ) ) . toBeVisible ( ) ;
327+ } ) ;
328+
329+ it ( 'keeps stack trace frames visible with their details collapsed alongside Seer content' , async ( ) => {
330+ const event = EventStacktraceExceptionFixture ( ) ;
331+ const exception = event . entries . find ( entry => entry . type === EntryType . EXCEPTION ) ! ;
332+ exception . data . values ! [ 0 ] ! . stacktrace ! . frames ! [ 1 ] ! . context = [ [ 2 , 'doThing();' ] ] ;
333+ MockApiClient . addMockResponse ( {
334+ url : `/organizations/${ organization . slug } /issues/${ group . id } /events/recommended/` ,
335+ body : event ,
336+ } ) ;
317337 MockApiClient . addMockResponse ( {
318338 url : `/organizations/${ organization . slug } /issues/${ group . id } /autofix/` ,
319339 body : ExplorerAutofixResponseFixture ( ) ,
@@ -338,6 +358,14 @@ describe('IssuePreview', () => {
338358 ) ;
339359 const stackTrace = await screen . findByRole ( 'region' , { name : 'Stack Trace' } ) ;
340360 expect ( within ( stackTrace ) . getByText ( 'doThing' ) ) . toBeVisible ( ) ;
361+ expect (
362+ within ( stackTrace ) . queryByRole ( 'button' , { name : 'View Stack Trace Section' } )
363+ ) . not . toBeInTheDocument ( ) ;
364+ expect (
365+ within ( stackTrace ) . queryByTestId ( 'core-stacktrace-frame-context' )
366+ ) . not . toBeInTheDocument ( ) ;
367+ await userEvent . click ( within ( stackTrace ) . getByText ( 'doThing' ) ) ;
368+ expect ( within ( stackTrace ) . getByTestId ( 'core-stacktrace-frame-context' ) ) . toBeVisible ( ) ;
341369 await userEvent . click (
342370 within ( stackTrace ) . getByRole ( 'button' , { name : 'Display options' } )
343371 ) ;
0 commit comments