Skip to content

Feat/action sheet e2e tests #549

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 2 commits into from
Oct 23, 2019
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
5 changes: 4 additions & 1 deletion demo/src/screens/MainScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default class MainScreen extends Component {
const navigationStyle = this.getSearchNavigationStyle();
navigationStyle.topBar.rightButtons.push({
id: 'uilib.settingsButton',
testID: 'uilib.settingsButton',
enabled: true,
icon: Assets.icons.settings,
});
Expand Down Expand Up @@ -73,6 +74,7 @@ export default class MainScreen extends Component {
rightButtons: [
{
id: 'uilib.searchButton',
testID: 'uilib.searchButton',
enabled: true,
icon: Assets.icons.search,
},
Expand Down Expand Up @@ -199,7 +201,7 @@ export default class MainScreen extends Component {
<TextField
ref={r => (this.input = r)}
value={this.state.filterText}
placeholder="Search your component.."
placeholder="Search for your component..."
onChangeText={this.filterExplorerScreens}
onBlur={this.onSearchBoxBlur}
style={{
Expand All @@ -211,6 +213,7 @@ export default class MainScreen extends Component {
hideUnderline
/>
<Button
testID={'SearchButton'}
style={{marginRight: 16, marginTop: Constants.isIOS ? Constants.statusBarHeight : 0}}
iconSource={Assets.icons.search}
size={'small'}
Expand Down
1 change: 1 addition & 0 deletions demo/src/screens/SettingsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class SettingsScreen extends Component {
Set default screen to open on app startup
</Text>
<Picker
testID={'uilib.defaultScreenPicker'}
placeholder="Pick default screen..."
showSearch
value={defaultScreen}
Expand Down
3 changes: 2 additions & 1 deletion src/components/picker/PickerModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class PickerModal extends BaseComponent {
}

renderSearchInput() {
const {showSearch, searchStyle, searchPlaceholder, onSearchChange, renderCustomSearch} = this.props;
const {showSearch, searchStyle, searchPlaceholder, onSearchChange, renderCustomSearch, testID} = this.props;

if (showSearch) {
if (_.isFunction(renderCustomSearch)) {
Expand All @@ -57,6 +57,7 @@ class PickerModal extends BaseComponent {
<View style={this.styles.searchInputContainer}>
<Image style={this.styles.searchIcon} source={Assets.icons.search}/>
<TextInput
testID={testID}
ref={r => (this.search = r)}
style={[this.styles.searchInput, {color: searchStyle.color}]}
placeholderTextColor={searchStyle.placeholderTextColor}
Expand Down
4 changes: 3 additions & 1 deletion src/components/picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ class Picker extends BaseComponent {
searchPlaceholder,
renderCustomSearch,
renderCustomModal,
listProps
listProps,
testID
} = this.getThemeProps();
const {showExpandableModal, selectedItemPosition} = this.state;
const children = this.appendPropsToChildren(this.props.children);
Expand All @@ -279,6 +280,7 @@ class Picker extends BaseComponent {

return (
<PickerModal
testID={`${testID}.modal`}
visible={showExpandableModal}
scrollPosition={selectedItemPosition}
enableModalBlur={enableModalBlur}
Expand Down