Skip to content

Commit 8992c33

Browse files
authored
OverlayFadingBackground - add testID (#938)
1 parent fef1117 commit 8992c33

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/components/dialog/OverlayFadingBackground.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import View from '../view';
33
import {Animated} from 'react-native';
44

55
interface Props {
6+
testID?: string;
67
dialogVisibility?: boolean;
78
modalVisibility?: boolean;
89
overlayBackgroundColor?: string;
910
}
1011

1112
const OverlayFadingBackground = ({
13+
testID,
1214
dialogVisibility,
1315
modalVisibility,
1416
overlayBackgroundColor
@@ -42,7 +44,7 @@ const OverlayFadingBackground = ({
4244
};
4345
}, [overlayBackgroundColor, fadeAnimation]);
4446

45-
return <View absF animated style={style} pointerEvents="none"/>;
47+
return <View testID={testID} absF animated style={style} pointerEvents="none"/>;
4648
};
4749

4850
OverlayFadingBackground.displayName = 'IGNORE';

src/components/dialog/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class Dialog extends Component<DialogProps, DialogState> {
218218
// TODO: renderOverlay {_.invoke(this.props, 'renderOverlay')}
219219
renderDialogContainer = () => {
220220
const {modalVisibility, dialogVisibility} = this.state;
221-
const {useSafeArea, bottom, overlayBackgroundColor} = this.props;
221+
const {useSafeArea, bottom, overlayBackgroundColor, testID} = this.props;
222222
const addBottomSafeArea = Constants.isIphoneX && (useSafeArea && bottom);
223223
const bottomInsets = Constants.getSafeAreaInsets().bottom - 8; // TODO: should this be here or in the input style?
224224

@@ -229,6 +229,7 @@ class Dialog extends Component<DialogProps, DialogState> {
229229
pointerEvents="box-none"
230230
>
231231
<OverlayFadingBackground
232+
testID={`${testID}.overlayFadingBackground`}
232233
modalVisibility={modalVisibility}
233234
dialogVisibility={dialogVisibility}
234235
overlayBackgroundColor={overlayBackgroundColor}

0 commit comments

Comments
 (0)