Skip to content

Commit

Permalink
feat: add testID to ItemType and set on item TouchableOpacity
Browse files Browse the repository at this point in the history
  • Loading branch information
jamie-phlo authored and mikehardy committed Oct 22, 2021
1 parent 7920dd9 commit e5a31c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ declare module "react-native-dropdown-picker" {
parent?: ValueType;
selectable?: boolean;
disabled?: boolean;
testID?: string;
};

export type ModeType = "DEFAULT" | "SIMPLE" | "BADGE";
Expand Down
2 changes: 1 addition & 1 deletion src/components/RenderListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function RenderListItem({
}, [onPress, parent, categorySelectable, custom]);

return (
<TouchableOpacity style={_listItemContainerStyle} onPress={__onPress} disabled={selectable === false || disabled}>
<TouchableOpacity style={_listItemContainerStyle} onPress={__onPress} disabled={selectable === false || disabled} testID={item.testID}>
{IconComponent}
<Text style={_listItemLabelStyle}>
{label}
Expand Down

0 comments on commit e5a31c6

Please sign in to comment.