chore: changes made due to review comments
Signed-off-by: Josh Uvi <joshuauvbiekpahor@gmail.com>
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
'@backstage/plugin-github-pull-requests-board': patch
|
||||
---
|
||||
|
||||
The cardheader component in the github-pull-requests-board plugin now requires that a `status` is passed to the component.
|
||||
The `CardHeader` component in the `github-pull-requests-board` plugin will show the status for the PR
|
||||
|
||||
@@ -29,7 +29,7 @@ type Props = {
|
||||
isDraft: boolean;
|
||||
repositoryIsArchived: boolean;
|
||||
labels?: Label[];
|
||||
status: Status;
|
||||
status?: Status;
|
||||
};
|
||||
|
||||
const Card: FunctionComponent<PropsWithChildren<Props>> = (
|
||||
|
||||
@@ -65,6 +65,11 @@ describe('<CardHeader/>', () => {
|
||||
it('finds commit status in PR Card Header', async () => {
|
||||
await renderInTestApp(<CardHeader {...props} />);
|
||||
expect(screen.getByText('Commit Status:')).toBeInTheDocument();
|
||||
expect(props.status.commit.statusCheckRollup.state).toBeTruthy();
|
||||
expect(props.status?.commit.statusCheckRollup.state).toBeTruthy();
|
||||
});
|
||||
|
||||
it('does not find commit status in PR Card Header when PR does not include status', async () => {
|
||||
await renderInTestApp(<CardHeader {...props} />);
|
||||
expect(CardHeader.defaultProps?.status).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ type Props = {
|
||||
isDraft: boolean;
|
||||
repositoryIsArchived: boolean;
|
||||
labels?: Label[];
|
||||
status: Status;
|
||||
status?: Status;
|
||||
};
|
||||
|
||||
const CardHeader: FunctionComponent<Props> = (props: Props) => {
|
||||
@@ -91,7 +91,7 @@ const CardHeader: FunctionComponent<Props> = (props: Props) => {
|
||||
<Box display="flex" alignItems="center" flexWrap="wrap" paddingTop={1}>
|
||||
<Typography variant="body2" component="p">
|
||||
Commit Status:{' '}
|
||||
<strong>{status.commit.statusCheckRollup.state}</strong>
|
||||
<strong>{status?.commit.statusCheckRollup.state}</strong>
|
||||
</Typography>
|
||||
</Box>
|
||||
{labels && (
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ type Props = {
|
||||
author: Author;
|
||||
url: string;
|
||||
reviews: Reviews;
|
||||
status: Status;
|
||||
status?: Status;
|
||||
repositoryName: string;
|
||||
repositoryIsArchived: boolean;
|
||||
isDraft: boolean;
|
||||
|
||||
Reference in New Issue
Block a user