chore: hide status if undefined (review change)
Signed-off-by: Josh Uvi <joshuauvbiekpahor@gmail.com>
This commit is contained in:
+4
-1
@@ -162,4 +162,7 @@ e2e-test-report/
|
||||
*svg.dtmp
|
||||
|
||||
# Scripts
|
||||
plugins-report.csv
|
||||
plugins-report.csv
|
||||
github-matt-credentails.yaml
|
||||
app-config-local.yaml
|
||||
packages/app/src/cookieAuth.ts
|
||||
@@ -69,7 +69,12 @@ describe('<CardHeader/>', () => {
|
||||
});
|
||||
|
||||
it('does not find commit status in PR Card Header when PR does not include status', async () => {
|
||||
await renderInTestApp(<CardHeader {...props} />);
|
||||
const propsWithNoStatus = {
|
||||
...props,
|
||||
status: undefined,
|
||||
};
|
||||
await renderInTestApp(<CardHeader {...propsWithNoStatus} />);
|
||||
expect(CardHeader.defaultProps?.status).toBeUndefined();
|
||||
expect(screen.queryByText('Commit Status:')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -88,12 +88,14 @@ const CardHeader: FunctionComponent<Props> = (props: Props) => {
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
<Box display="flex" alignItems="center" flexWrap="wrap" paddingTop={1}>
|
||||
<Typography variant="body2" component="p">
|
||||
Commit Status:{' '}
|
||||
<strong>{status?.commit.statusCheckRollup.state}</strong>
|
||||
</Typography>
|
||||
</Box>
|
||||
{status && (
|
||||
<Box display="flex" alignItems="center" flexWrap="wrap" paddingTop={1}>
|
||||
<Typography variant="body2" component="p">
|
||||
Commit Status:{' '}
|
||||
<strong>{status.commit.statusCheckRollup.state}</strong>
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
{labels && (
|
||||
<Box display="flex" alignItems="center" flexWrap="wrap" paddingTop={1}>
|
||||
{labels.map(data => {
|
||||
|
||||
Reference in New Issue
Block a user