Skip to content

Commit 6b091db

Browse files
authored
Adding testID to events on day view (#2519)
* Adding testID to events on day view * Adding testID to events on day view
1 parent 77056d4 commit 6b091db

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/timeline/EventBlock.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export interface EventBlockProps {
2626
renderEvent?: (event: PackedEvent) => JSX.Element;
2727
format24h?: boolean;
2828
styles: {[key: string]: ViewStyle | TextStyle};
29+
testID?: string;
2930
}
3031

3132
const TEXT_LINE_HEIGHT = 17;
@@ -53,7 +54,7 @@ const EventBlock = (props: EventBlockProps) => {
5354
}, [index, onPress]);
5455

5556
return (
56-
<TouchableOpacity activeOpacity={0.9} onPress={_onPress} style={[styles.event, eventStyle]}>
57+
<TouchableOpacity testID={props.testID} activeOpacity={0.9} onPress={_onPress} style={[styles.event, eventStyle]}>
5758
{renderEvent ? (
5859
renderEvent(event)
5960
) : (

src/timeline/Timeline.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ const Timeline = (props: TimelineProps) => {
220220
format24h={format24h}
221221
onPress={onEventPress}
222222
renderEvent={renderEvent}
223+
testID={`${testID}.event.${event.id}`}
223224
/>
224225
);
225226
});

0 commit comments

Comments
 (0)