chore: changes made due to review comments

Signed-off-by: Josh Uvi <joshuauvbiekpahor@gmail.com>
This commit is contained in:
Josh Uvi
2024-02-20 13:17:24 +00:00
parent 3c2d7c0e72
commit 6ee98792ca
5 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -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 && (
@@ -30,7 +30,7 @@ type Props = {
author: Author;
url: string;
reviews: Reviews;
status: Status;
status?: Status;
repositoryName: string;
repositoryIsArchived: boolean;
isDraft: boolean;