@@ -171,16 +171,21 @@ describe("real security audit frontend integration", () => {
171171 } )
172172
173173 it . each ( [
174- [ "an unsupported query field" , "/settings/audit?scope=hub&page=2" ] ,
175- [ "repository scope" , "/settings/audit?scope=repository" ] ,
176- [ "an empty cursor" , "/settings/audit?scope=hub&before=" ] ,
177- [ "repeated cursors" , "/settings/audit?scope=hub&before=one&before=two" ] ,
178- [ "an oversized cursor" , `/settings/audit?scope=hub&before=${ "a" . repeat ( 501 ) } ` ] ,
179- ] ) ( "shows a 400 error for %s before loading audit data" , async ( _label , path ) => {
174+ [ "an unsupported query field" , "/settings/audit?scope=hub&page=2" , null ] ,
175+ [
176+ "repository scope" ,
177+ "/settings/audit?scope=repository" ,
178+ "Only the Hub-wide security audit is available." ,
179+ ] ,
180+ [ "an empty cursor" , "/settings/audit?scope=hub&before=" , null ] ,
181+ [ "repeated cursors" , "/settings/audit?scope=hub&before=one&before=two" , null ] ,
182+ [ "an oversized cursor" , `/settings/audit?scope=hub&before=${ "a" . repeat ( 501 ) } ` , null ] ,
183+ ] ) ( "shows a 400 error for %s before loading audit data" , async ( _label , path , message ) => {
180184 const { requests } = await renderApplication ( path , [ authenticatedSession ( ) ] )
181185
182186 expect ( await screen . findByRole ( "heading" , { name : "Invalid address" } ) ) . toBeVisible ( )
183187 expect ( screen . getByText ( "400" ) ) . toBeVisible ( )
188+ if ( message ) expect ( screen . getByText ( message ) ) . toBeVisible ( )
184189 expect ( requests . some ( ( request ) => request . includes ( "/api/security-audits" ) ) ) . toBe ( false )
185190 } )
186191
0 commit comments