Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Only show GH config banner when no welcome banner #3680

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/shared/ListRepo/ListRepo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ function ListRepo({ canRefetch, hasGhApp }) {

return (
<>
{!hasGhApp && <GithubConfigBanner />}
{/* we only want one of these two banners to show at a time */}
{!hasGhApp && !showDemoAlert && <GithubConfigBanner />}
<OrgControlTable
searchValue={params.search}
repoDisplay={repoDisplay}
Expand Down
18 changes: 15 additions & 3 deletions src/shared/ListRepo/ListRepo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ describe('ListRepo', () => {
})

describe('user does not have gh app installed', () => {
it('displays github app config banner', async () => {
it('displays github app config banner if showDemoAlert is false', async () => {
setup({})
render(<ListRepo canRefetch hasGhApp={false} />, {
wrapper: wrapper({
Expand All @@ -312,9 +312,21 @@ describe('ListRepo', () => {
}),
})

const banner = await screen.findByText("Codecov's GitHub app")
return expect(banner).toBeInTheDocument()
})
it('does not display github app config banner if showDemoAlert is true', async () => {
setup({})
render(<ListRepo canRefetch hasGhApp={false} />, {
wrapper: wrapper({
url: '/gh/janedoe?source=onboarding',
path: '/:provider/:owner',
}),
})

await waitFor(() => {
const banner = screen.getByText("Codecov's GitHub app")
return expect(banner).toBeInTheDocument()
const banner = screen.queryByText("Codecov's GitHub app")
expect(banner).not.toBeInTheDocument()
})
})
})
Expand Down
Loading