fix RelationInput proptypes issues

This commit is contained in:
Julie Plantey 2022-09-13 12:25:50 +02:00
parent 2766b93940
commit f7b51cd2f2
5 changed files with 6 additions and 5 deletions

View File

@ -156,7 +156,7 @@ const RelationInput = ({
inputId={id}
isSearchable
isClear
loadingMessage={() => loadingMessage}
loadingMessage={loadingMessage}
onChange={(relation) => {
setValue(null);
onRelationAdd(relation);

View File

@ -50,5 +50,5 @@ Relation.propTypes = {
search: PropTypes.node,
loadMore: PropTypes.node,
size: PropTypes.number.isRequired,
totalNumberOfRelations: PropTypes.string,
totalNumberOfRelations: PropTypes.number,
};

View File

@ -43,10 +43,10 @@ export const RelationList = ({ children, ...props }) => {
};
RelationList.defaultProps = {
overflow: undefined,
overflow: '',
};
RelationList.propTypes = {
children: PropTypes.node.isRequired,
overflow: PropTypes.oneOf(['top-bottom', 'bottom', 'top']),
overflow: PropTypes.oneOf(['top-bottom', 'bottom', 'top', '']),
};

View File

@ -97,6 +97,7 @@ exports[`Content-Manager || RelationInput || RelationList should render and matc
<div>
<div
class="c0"
overflow=""
>
<div
class="c1 c2"

View File

@ -63,7 +63,7 @@ const setup = (props) =>
name="some-relation-1"
label="Some Relation"
labelLoadMore="Load more"
loadingMessage="Relations are loading"
loadingMessage={() => 'Relations are loading'}
numberOfRelationsToDisplay={5}
onRelationAdd={() => jest.fn()}
onSearchOpen={() => jest.fn()}