Skip to content

Commit dfb4df6

Browse files
fix: Only show GH config banner when no welcome banner (#3680)
1 parent 53ce439 commit dfb4df6

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/shared/ListRepo/ListRepo.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ function ListRepo({ canRefetch, hasGhApp }) {
6060

6161
return (
6262
<>
63-
{!hasGhApp && <GithubConfigBanner />}
63+
{/* we only want one of these two banners to show at a time */}
64+
{!hasGhApp && !showDemoAlert && <GithubConfigBanner />}
6465
<OrgControlTable
6566
searchValue={params.search}
6667
repoDisplay={repoDisplay}

src/shared/ListRepo/ListRepo.test.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ describe('ListRepo', () => {
303303
})
304304

305305
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 () => {
307307
setup({})
308308
render(<ListRepo canRefetch hasGhApp={false} />, {
309309
wrapper: wrapper({
@@ -312,9 +312,21 @@ describe('ListRepo', () => {
312312
}),
313313
})
314314

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+
315327
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()
318330
})
319331
})
320332
})

0 commit comments

Comments
 (0)