-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Move the banner above summary, and fix the use of team hook in c…
…overage tab
- Loading branch information
1 parent
e0d67da
commit 8cefc74
Showing
27 changed files
with
114 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/pages/RepoPage/CoverageTab/FirstPullRequestBanner/FirstPullRequestBanner.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { MemoryRouter, Route } from 'react-router-dom' | ||
|
||
import FirstPullRequestBanner from './FirstPullRequestBanner' | ||
|
||
const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => ( | ||
<MemoryRouter initialEntries={['/gh/codecov/gazebo']}> | ||
<Route path="/:provider/:owner/:repo">{children}</Route> | ||
</MemoryRouter> | ||
) | ||
|
||
describe('FirstPullRequestBanner', () => { | ||
it('renders content', () => { | ||
render(<FirstPullRequestBanner />, { wrapper }) | ||
const content = screen.getByText( | ||
'Once merged to your default branch, Codecov will show your report results on this dashboard.' | ||
) | ||
expect(content).toBeInTheDocument() | ||
}) | ||
|
||
it('renders the correct link', () => { | ||
render(<FirstPullRequestBanner />, { wrapper }) | ||
const link = screen.getByRole('link', { name: 'edit default branch' }) | ||
expect(link).toHaveAttribute('href', '/gh/codecov/gazebo/settings') | ||
}) | ||
}) |
27 changes: 27 additions & 0 deletions
27
src/pages/RepoPage/CoverageTab/FirstPullRequestBanner/FirstPullRequestBanner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import A from 'ui/A' | ||
import Banner from 'ui/Banner' | ||
import BannerContent from 'ui/Banner/BannerContent' | ||
|
||
const FirstPullRequestBanner = () => { | ||
return ( | ||
<Banner> | ||
<BannerContent> | ||
<p> | ||
Once merged to your default branch, Codecov will show your report | ||
results on this dashboard.{' '} | ||
<A | ||
to={{ pageName: 'settings' }} | ||
hook={'repo-to-edit-branch'} | ||
variant="semibold" | ||
isExternal={false} | ||
data-testid="settings-page" | ||
> | ||
edit default branch | ||
</A> | ||
</p> | ||
</BannerContent> | ||
</Banner> | ||
) | ||
} | ||
|
||
export default FirstPullRequestBanner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './FirstPullRequestBanner' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.