-
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.
- Loading branch information
1 parent
38b5531
commit a42a563
Showing
5 changed files
with
86 additions
and
0 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
36 changes: 36 additions & 0 deletions
36
...ageOnboarding/ActivationBanner/ActivationRequiredBanner/ActivationRequiredBanner.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,36 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { MemoryRouter, Route } from 'react-router-dom' | ||
|
||
import ActivationRequiredBanner from './ActivationRequiredBanner' | ||
|
||
const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => ( | ||
<MemoryRouter initialEntries={['/gh/codecov/gazebo/new']}> | ||
<Route path="/:provider/:owner/:repo/new">{children}</Route> | ||
</MemoryRouter> | ||
) | ||
|
||
describe('ActivationRequiredBanner', () => { | ||
it('renders the banner with correct content', () => { | ||
render(<ActivationRequiredBanner />, { wrapper }) | ||
|
||
const bannerHeading = screen.getByRole('heading', { | ||
name: /Activation Required/, | ||
}) | ||
expect(bannerHeading).toBeInTheDocument() | ||
|
||
const description = screen.getByText( | ||
/You have available seats, but activation is needed./ | ||
) | ||
expect(description).toBeInTheDocument() | ||
}) | ||
|
||
it('renders correct links', () => { | ||
render(<ActivationRequiredBanner />, { wrapper }) | ||
|
||
const manageMembersLink = screen.getByRole('link', { | ||
name: /Manage Members/, | ||
}) | ||
expect(manageMembersLink).toBeInTheDocument() | ||
expect(manageMembersLink).toHaveAttribute('href', '/members/gh/codecov') | ||
}) | ||
}) |
33 changes: 33 additions & 0 deletions
33
...CoverageOnboarding/ActivationBanner/ActivationRequiredBanner/ActivationRequiredBanner.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,33 @@ | ||
import Banner from 'ui/Banner' | ||
import BannerContent from 'ui/Banner/BannerContent' | ||
import BannerHeading from 'ui/Banner/BannerHeading' | ||
import Button from 'ui/Button' | ||
|
||
function ActivationRequiredBanner() { | ||
return ( | ||
<Banner variant="plain"> | ||
<BannerContent> | ||
<BannerHeading> | ||
<h2 className="font-semibold">ℹ Activation Required</h2> | ||
</BannerHeading> | ||
<div className="flex justify-between"> | ||
<p>You have available seats, but activation is needed.</p> | ||
<div className="mt-[-9px]"> | ||
<Button | ||
hook="trial-eligible-banner-start-trial" | ||
to={{ | ||
pageName: 'membersTab', | ||
}} | ||
disabled={false} | ||
variant="primary" | ||
> | ||
Manage Members | ||
</Button> | ||
</div> | ||
</div> | ||
</BannerContent> | ||
</Banner> | ||
) | ||
} | ||
|
||
export default ActivationRequiredBanner |
1 change: 1 addition & 0 deletions
1
src/pages/RepoPage/CoverageOnboarding/ActivationBanner/ActivationRequiredBanner/index.ts
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 './ActivationRequiredBanner' |