Skip to content

infra add testids to color picker dialog #2797

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
Nov 8, 2023
Merged
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
7 changes: 5 additions & 2 deletions src/components/colorPicker/ColorPickerDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class ColorPickerDialog extends PureComponent<Props, State> {
};

renderHeader() {
const {doneButtonColor, accessibilityLabels} = this.props;
const {doneButtonColor, accessibilityLabels, testID} = this.props;
const {valid} = this.state;

return (
Expand All @@ -239,6 +239,7 @@ class ColorPickerDialog extends PureComponent<Props, State> {
iconStyle={{tintColor: Colors.$iconDefault}}
onPress={this.onDismiss}
accessibilityLabel={_.get(accessibilityLabels, 'dismissButton')}
testID={`${testID}.dialog.cancel`}
/>
<Button
color={doneButtonColor}
Expand All @@ -247,6 +248,7 @@ class ColorPickerDialog extends PureComponent<Props, State> {
iconSource={Assets.icons.check}
onPress={this.onDonePressed}
accessibilityLabel={_.get(accessibilityLabels, 'doneButton')}
testID={`${testID}.dialog.done`}
/>
</View>
);
Expand All @@ -272,7 +274,7 @@ class ColorPickerDialog extends PureComponent<Props, State> {
}

renderPreview() {
const {accessibilityLabels, previewInputStyle} = this.props;
const {accessibilityLabels, previewInputStyle, testID} = this.props;
const {color, text} = this.state;
const hex = this.getHexString(color);
const textColor = this.getTextColor(hex);
Expand Down Expand Up @@ -322,6 +324,7 @@ class ColorPickerDialog extends PureComponent<Props, State> {
enablesReturnKeyAutomatically
onFocus={this.onFocus}
accessibilityLabel={accessibilityLabels?.input}
testID={`${testID}.dialog.textInput`}
/>
</View>
<View style={[{backgroundColor: textColor}, styles.underline]}/>
Expand Down