From 4186b7e0d0718a4634010b59a5e05ff14f02d1aa Mon Sep 17 00:00:00 2001 From: Fernanda Toledo Date: Wed, 26 May 2021 10:28:20 -0300 Subject: [PATCH 1/3] fix: add testID prop to ui components --- src/components/ui/autocomplete/autocomplete.component.tsx | 3 ++- src/components/ui/datepicker/baseDatepicker.component.tsx | 5 ++++- src/components/ui/input/input.component.tsx | 2 ++ src/components/ui/select/select.component.tsx | 2 ++ src/components/ui/spinner/spinner.component.tsx | 2 +- src/components/ui/tab/tabBar.component.tsx | 4 ++-- src/components/ui/toggle/toggle.component.tsx | 3 ++- 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/ui/autocomplete/autocomplete.component.tsx b/src/components/ui/autocomplete/autocomplete.component.tsx index 8782a22f0..b36d2aa9c 100644 --- a/src/components/ui/autocomplete/autocomplete.component.tsx +++ b/src/components/ui/autocomplete/autocomplete.component.tsx @@ -205,13 +205,14 @@ export class Autocomplete extends React.Component { }; public render(): PopoverElement { - const { placement, children, ...inputProps } = this.props; + const { placement, children, testID, ...inputProps } = this.props; return ( this.renderInputElement(inputProps)} diff --git a/src/components/ui/datepicker/baseDatepicker.component.tsx b/src/components/ui/datepicker/baseDatepicker.component.tsx index ba6ace83f..7201cfe2b 100644 --- a/src/components/ui/datepicker/baseDatepicker.component.tsx +++ b/src/components/ui/datepicker/baseDatepicker.component.tsx @@ -229,6 +229,7 @@ export abstract class BaseDatepickerComponent extends React.Compone const { eva, style, + testID, backdropStyle, controlStyle, placement, @@ -242,7 +243,9 @@ export abstract class BaseDatepickerComponent extends React.Compone const evaStyle = this.getComponentStyle(eva.style); return ( - + implements WebEventRespon caption, accessoryLeft, accessoryRight, + testID, ...textInputProps } = this.props; @@ -261,6 +262,7 @@ export class Input extends React.Component implements WebEventRespon return ( >; status?: EvaStatus; size?: EvaInputSize; + testID?: React.ReactText; } export type SelectElement = React.ReactElement; @@ -455,6 +456,7 @@ export class Select extends React.Component { return ( { const evaStyle = this.getComponentStyle(this.animation.toProps()); return ( - + {this.renderArcElement(evaStyle.start, containerSize)} {this.renderArcElement(evaStyle.end, containerSize)} diff --git a/src/components/ui/tab/tabBar.component.tsx b/src/components/ui/tab/tabBar.component.tsx index f126ab243..61bcde8cf 100644 --- a/src/components/ui/tab/tabBar.component.tsx +++ b/src/components/ui/tab/tabBar.component.tsx @@ -180,12 +180,12 @@ export class TabBar extends React.Component { }; public render(): React.ReactElement { - const { eva, style, indicatorStyle, selectedIndex, children, ...viewProps } = this.props; + const { eva, style, testID, indicatorStyle, selectedIndex, children, ...viewProps } = this.props; const evaStyle = this.getComponentStyle(eva.style); const tabElements: TabElement[] = this.renderTabElements(children); return ( - + diff --git a/src/components/ui/toggle/toggle.component.tsx b/src/components/ui/toggle/toggle.component.tsx index 9710986f7..d541a1596 100644 --- a/src/components/ui/toggle/toggle.component.tsx +++ b/src/components/ui/toggle/toggle.component.tsx @@ -370,11 +370,12 @@ export class Toggle extends React.Component implements PanResponder }; public render(): React.ReactElement { - const { eva, style, checked, children, ...touchableProps } = this.props; + const { eva, style, checked, children, testID, ...touchableProps } = this.props; const evaStyle = this.getComponentStyle(eva.style); return ( Date: Fri, 4 Jun 2021 19:16:10 +0300 Subject: [PATCH 2/3] Fix: update interface --- src/components/ui/select/select.component.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ui/select/select.component.tsx b/src/components/ui/select/select.component.tsx index d8eec9182..14f139c2f 100644 --- a/src/components/ui/select/select.component.tsx +++ b/src/components/ui/select/select.component.tsx @@ -69,7 +69,6 @@ export interface SelectProps extends TouchableWebProps, SelectStyledProps { accessoryRight?: RenderProp>; status?: EvaStatus; size?: EvaInputSize; - testID?: React.ReactText; } export type SelectElement = React.ReactElement; From fd699a5f0c6ea640bec47edf382d3113c624dbeb Mon Sep 17 00:00:00 2001 From: malashkevich Date: Tue, 15 Jun 2021 17:53:41 +0300 Subject: [PATCH 3/3] fix(styles): code style --- src/components/ui/datepicker/baseDatepicker.component.tsx | 6 +++--- src/components/ui/spinner/spinner.component.tsx | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/ui/datepicker/baseDatepicker.component.tsx b/src/components/ui/datepicker/baseDatepicker.component.tsx index 7201cfe2b..13f943c5e 100644 --- a/src/components/ui/datepicker/baseDatepicker.component.tsx +++ b/src/components/ui/datepicker/baseDatepicker.component.tsx @@ -243,9 +243,9 @@ export abstract class BaseDatepickerComponent extends React.Compone const evaStyle = this.getComponentStyle(eva.style); return ( - + { const evaStyle = this.getComponentStyle(this.animation.toProps()); return ( - + {this.renderArcElement(evaStyle.start, containerSize)} {this.renderArcElement(evaStyle.end, containerSize)}