File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ function ListRepo({ canRefetch, hasGhApp }) {
60
60
61
61
return (
62
62
< >
63
- { ! hasGhApp && < GithubConfigBanner /> }
63
+ { /* we only want one of these two banners to show at a time */ }
64
+ { ! hasGhApp && ! showDemoAlert && < GithubConfigBanner /> }
64
65
< OrgControlTable
65
66
searchValue = { params . search }
66
67
repoDisplay = { repoDisplay }
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ describe('ListRepo', () => {
303
303
} )
304
304
305
305
describe ( 'user does not have gh app installed' , ( ) => {
306
- it ( 'displays github app config banner' , async ( ) => {
306
+ it ( 'displays github app config banner if showDemoAlert is false ' , async ( ) => {
307
307
setup ( { } )
308
308
render ( < ListRepo canRefetch hasGhApp = { false } /> , {
309
309
wrapper : wrapper ( {
@@ -312,9 +312,21 @@ describe('ListRepo', () => {
312
312
} ) ,
313
313
} )
314
314
315
+ const banner = await screen . findByText ( "Codecov's GitHub app" )
316
+ return expect ( banner ) . toBeInTheDocument ( )
317
+ } )
318
+ it ( 'does not display github app config banner if showDemoAlert is true' , async ( ) => {
319
+ setup ( { } )
320
+ render ( < ListRepo canRefetch hasGhApp = { false } /> , {
321
+ wrapper : wrapper ( {
322
+ url : '/gh/janedoe?source=onboarding' ,
323
+ path : '/:provider/:owner' ,
324
+ } ) ,
325
+ } )
326
+
315
327
await waitFor ( ( ) => {
316
- const banner = screen . getByText ( "Codecov's GitHub app" )
317
- return expect ( banner ) . toBeInTheDocument ( )
328
+ const banner = screen . queryByText ( "Codecov's GitHub app" )
329
+ expect ( banner ) . not . toBeInTheDocument ( )
318
330
} )
319
331
} )
320
332
} )
You can’t perform that action at this time.
0 commit comments