@@ -75,7 +75,7 @@ describe("SilkActivityControl error report", () => {
7575
7676 it ( "uses the translated `showErrorReport` text as fallback name for a titleless error report dialog" , async ( ) => {
7777 const warnSpy = jest . spyOn ( console , "warn" ) . mockImplementation ( ( ) => undefined ) ;
78- const { openErrorReport } = renderFailedActivity ( { title : "" } ) ;
78+ const { openErrorReport } = renderFailedActivity ( { title : "" , "aria-label" : "" } ) ;
7979 openErrorReport ( ) ;
8080 expect ( await screen . findByRole ( "dialog" , { name : "showErrorReport" } ) ) . toHaveAttribute ( "aria-modal" , "true" ) ;
8181 expect ( warnSpy ) . not . toHaveBeenCalled ( ) ;
@@ -107,16 +107,20 @@ describe("SilkActivityControl error report", () => {
107107} ) ;
108108
109109describe ( "ActivityExecutionErrorReportModal" , ( ) => {
110- it ( "uses an english fallback name if neither title nor aria attributes are given" , ( ) => {
111- render (
112- < ActivityExecutionErrorReportModal
113- onDiscard = { jest . fn ( ) }
114- report = { < p > Error details</ p > }
115- downloadButtonValue = "Download"
116- closeButtonValue = "Close"
117- fetchErrorReport = { async ( ) => "Error details" }
118- /> ,
119- ) ;
120- expect ( screen . getByRole ( "dialog" , { name : "Activity execution error report" } ) ) . toBeInTheDocument ( ) ;
121- } ) ;
110+ it . each ( [ undefined , "" ] ) (
111+ "uses an english fallback name if neither title nor aria attributes are given (aria-label: %p)" ,
112+ ( ariaLabel ) => {
113+ render (
114+ < ActivityExecutionErrorReportModal
115+ aria-label = { ariaLabel }
116+ onDiscard = { jest . fn ( ) }
117+ report = { < p > Error details</ p > }
118+ downloadButtonValue = "Download"
119+ closeButtonValue = "Close"
120+ fetchErrorReport = { async ( ) => "Error details" }
121+ /> ,
122+ ) ;
123+ expect ( screen . getByRole ( "dialog" , { name : "Activity execution error report" } ) ) . toBeInTheDocument ( ) ;
124+ } ,
125+ ) ;
122126} ) ;
0 commit comments