Skip to content

OverlayFadingBackground - add testID #938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/dialog/OverlayFadingBackground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import View from '../view';
import {Animated} from 'react-native';

interface Props {
testID?: string;
dialogVisibility?: boolean;
modalVisibility?: boolean;
overlayBackgroundColor?: string;
}

const OverlayFadingBackground = ({
testID,
dialogVisibility,
modalVisibility,
overlayBackgroundColor
Expand Down Expand Up @@ -42,7 +44,7 @@ const OverlayFadingBackground = ({
};
}, [overlayBackgroundColor, fadeAnimation]);

return <View absF animated style={style} pointerEvents="none"/>;
return <View testID={testID} absF animated style={style} pointerEvents="none"/>;
};

OverlayFadingBackground.displayName = 'IGNORE';
Expand Down
3 changes: 2 additions & 1 deletion src/components/dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class Dialog extends Component<DialogProps, DialogState> {
// TODO: renderOverlay {_.invoke(this.props, 'renderOverlay')}
renderDialogContainer = () => {
const {modalVisibility, dialogVisibility} = this.state;
const {useSafeArea, bottom, overlayBackgroundColor} = this.props;
const {useSafeArea, bottom, overlayBackgroundColor, testID} = this.props;
const addBottomSafeArea = Constants.isIphoneX && (useSafeArea && bottom);
const bottomInsets = Constants.getSafeAreaInsets().bottom - 8; // TODO: should this be here or in the input style?

Expand All @@ -229,6 +229,7 @@ class Dialog extends Component<DialogProps, DialogState> {
pointerEvents="box-none"
>
<OverlayFadingBackground
testID={`${testID}.overlayFadingBackground`}
modalVisibility={modalVisibility}
dialogVisibility={dialogVisibility}
overlayBackgroundColor={overlayBackgroundColor}
Expand Down