Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
add testID for element
Browse files Browse the repository at this point in the history
  • Loading branch information
alimek committed Sep 28, 2018
1 parent 74dcce9 commit 8bc7491
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-tooltip-menu",
"version": "1.1.1",
"version": "1.1.2",
"description": "ReactNative component showing tooltip with menu items.",
"main": "src/index.js",
"scripts": {
Expand Down
9 changes: 7 additions & 2 deletions src/TooltipMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ const StylePropType = PropTypes.oneOfType([
PropTypes.object,
]);

const TooltipMenuItem = ({ onPress, containerStyle, touchableStyle, label, labelStyle }) => (
<View style={containerStyle}>
const TooltipMenuItem = ({ onPress, containerStyle, touchableStyle, label, labelStyle, testID }) => (
<View
style={containerStyle}
testID={testID}
>
<TouchableOpacity style={[styles.container, touchableStyle]} onPress={onPress}>
{
typeof label === 'string' ?
Expand All @@ -35,12 +38,14 @@ TooltipMenuItem.propTypes = {
containerStyle: StylePropType,
touchableStyle: StylePropType,
labelStyle: StylePropType,
testID: PropTypes.string,
};

TooltipMenuItem.defaultProps = {
labelStyle: null,
containerStyle: null,
touchableStyle: null,
testID: undefined,
};

export default TooltipMenuItem;
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class Tooltip extends React.Component {
containerStyle={classes}
touchableStyle={touchableItemStyle}
labelStyle={labelStyle}
testID={item.testID}
/>
);
})}
Expand Down

0 comments on commit 8bc7491

Please sign in to comment.