chore: adds tests for action bar component (#88)

This commit is contained in:
Ayush Sharma
2019-07-07 19:30:01 +02:00
committed by GitHub
parent b6b0ecdb1e
commit f6e62d95bb
3 changed files with 60 additions and 9 deletions

View File

@@ -44,7 +44,7 @@ class ActionBar extends Component {
);
}
private renderActionBarListItems = packageMeta => {
private renderActionBar = ({ packageMeta }) => {
// @ts-ignore
const { latest: { bugs: { url: issue } = {}, homepage, dist: { tarball } = {} } = {} } = packageMeta;
@@ -68,15 +68,15 @@ class ActionBar extends Component {
return component;
}, []);
return (
<>
<ActionListItem alignItems={'flex-start'}>{renderList}</ActionListItem>
</>
);
};
if (renderList.length > 0) {
return (
<List>
<ActionListItem alignItems={'flex-start'}>{renderList}</ActionListItem>
</List>
);
}
private renderActionBar = ({ packageMeta = {} }) => {
return <List>{this.renderActionBarListItems(packageMeta)}</List>;
return null;
};
}