react-native-ui-lib 8.4.3-snapshot.7923 → 8.4.3-snapshot.7927
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -130,11 +130,10 @@ class Badge extends PureComponent {
|
|
|
130
130
|
renderLabel() {
|
|
131
131
|
const {
|
|
132
132
|
labelStyle,
|
|
133
|
-
label
|
|
134
|
-
testID
|
|
133
|
+
label
|
|
135
134
|
} = this.props;
|
|
136
135
|
if (label) {
|
|
137
|
-
return <Text style={[this.styles.label, this.isSmallBadge() && this.styles.labelSmall, labelStyle]} allowFontScaling={false} numberOfLines={1} testID=
|
|
136
|
+
return <Text style={[this.styles.label, this.isSmallBadge() && this.styles.labelSmall, labelStyle]} allowFontScaling={false} numberOfLines={1} testID="badge" recorderTag={'unmask'}>
|
|
138
137
|
{this.getFormattedLabel()}
|
|
139
138
|
</Text>;
|
|
140
139
|
}
|
|
@@ -151,13 +150,12 @@ class Badge extends PureComponent {
|
|
|
151
150
|
iconStyle,
|
|
152
151
|
iconProps,
|
|
153
152
|
borderColor,
|
|
154
|
-
label
|
|
155
|
-
testID
|
|
153
|
+
label
|
|
156
154
|
} = this.props;
|
|
157
155
|
const flex = label ? 0 : 1;
|
|
158
156
|
return icon && <Image source={icon} resizeMode="contain" tintColor={Colors.$iconDefaultLight}
|
|
159
157
|
//@ts-ignore
|
|
160
|
-
borderColor={borderColor}
|
|
158
|
+
borderColor={borderColor} {...iconProps} style={{
|
|
161
159
|
flex,
|
|
162
160
|
...iconStyle
|
|
163
161
|
}} />;
|
package/src/testkit/index.d.ts
CHANGED
|
@@ -23,4 +23,3 @@ export { ToastDriver } from '../incubator/toast/Toast.driver.new';
|
|
|
23
23
|
export { DateTimePickerDriver } from '../components/dateTimePicker/DateTimePicker.driver';
|
|
24
24
|
export { TimelineDriver } from '../components/timeline/timeline.driver';
|
|
25
25
|
export { ChipDriver } from '../components/chip/chip.driver';
|
|
26
|
-
export { BadgeDriver } from '../components/badge/badge.driver';
|
package/src/testkit/index.js
CHANGED
|
@@ -22,5 +22,4 @@ export { ExpandableOverlayDriver } from "../incubator/expandableOverlay/Expandab
|
|
|
22
22
|
export { ToastDriver } from "../incubator/toast/Toast.driver.new";
|
|
23
23
|
export { DateTimePickerDriver } from "../components/dateTimePicker/DateTimePicker.driver";
|
|
24
24
|
export { TimelineDriver } from "../components/timeline/timeline.driver";
|
|
25
|
-
export { ChipDriver } from "../components/chip/chip.driver";
|
|
26
|
-
export { BadgeDriver } from "../components/badge/badge.driver";
|
|
25
|
+
export { ChipDriver } from "../components/chip/chip.driver";
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from '../../testkit/new/Component.driver';
|
|
2
|
-
export declare const BadgeDriver: (props: ComponentProps) => {
|
|
3
|
-
getLabel: () => {
|
|
4
|
-
getText: () => string | (string | import("react-test-renderer").ReactTestInstance)[];
|
|
5
|
-
getStyle: () => import("react-native").TextStyle;
|
|
6
|
-
press: () => void;
|
|
7
|
-
hasOnPress: () => boolean;
|
|
8
|
-
onPressIn: () => void;
|
|
9
|
-
hasOnPressIn: () => boolean;
|
|
10
|
-
onPressOut: () => void;
|
|
11
|
-
hasOnPressOut: () => boolean;
|
|
12
|
-
onLongPress: () => void;
|
|
13
|
-
hasOnLongPress: () => boolean;
|
|
14
|
-
getElement: () => import("react-test-renderer").ReactTestInstance;
|
|
15
|
-
queryElement: () => import("react-test-renderer").ReactTestInstance | undefined;
|
|
16
|
-
exists: () => boolean;
|
|
17
|
-
};
|
|
18
|
-
getIcon: () => {
|
|
19
|
-
exists: () => boolean;
|
|
20
|
-
getStyle: () => any;
|
|
21
|
-
getElement: () => import("react-test-renderer").ReactTestInstance;
|
|
22
|
-
queryElement: () => import("react-test-renderer").ReactTestInstance | undefined;
|
|
23
|
-
};
|
|
24
|
-
getStyle: () => any;
|
|
25
|
-
getSize: () => number;
|
|
26
|
-
press: () => void;
|
|
27
|
-
hasOnPress: () => boolean;
|
|
28
|
-
onPressIn: () => void;
|
|
29
|
-
hasOnPressIn: () => boolean;
|
|
30
|
-
onPressOut: () => void;
|
|
31
|
-
hasOnPressOut: () => boolean;
|
|
32
|
-
onLongPress: () => void;
|
|
33
|
-
hasOnLongPress: () => boolean;
|
|
34
|
-
getElement: () => import("react-test-renderer").ReactTestInstance;
|
|
35
|
-
queryElement: () => import("react-test-renderer").ReactTestInstance | undefined;
|
|
36
|
-
exists: () => boolean;
|
|
37
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from 'react-native';
|
|
2
|
-
import { useComponentDriver } from "../../testkit/new/Component.driver";
|
|
3
|
-
import { usePressableDriver } from "../../testkit/new/usePressable.driver";
|
|
4
|
-
import { TextDriver } from "../text/Text.driver.new";
|
|
5
|
-
import { ImageDriver } from "../image/Image.driver.new";
|
|
6
|
-
export const BadgeDriver = props => {
|
|
7
|
-
const driver = usePressableDriver(useComponentDriver(props));
|
|
8
|
-
const labelDriver = TextDriver({
|
|
9
|
-
renderTree: props.renderTree,
|
|
10
|
-
testID: `${props.testID}.label`
|
|
11
|
-
});
|
|
12
|
-
const iconDriver = ImageDriver({
|
|
13
|
-
renderTree: props.renderTree,
|
|
14
|
-
testID: `${props.testID}.icon`
|
|
15
|
-
});
|
|
16
|
-
const getLabel = () => {
|
|
17
|
-
return {
|
|
18
|
-
...labelDriver
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
const getIcon = () => {
|
|
22
|
-
const exists = () => {
|
|
23
|
-
return iconDriver.exists();
|
|
24
|
-
};
|
|
25
|
-
const getStyle = () => {
|
|
26
|
-
return StyleSheet.flatten(iconDriver.getElement().props.style);
|
|
27
|
-
};
|
|
28
|
-
return {
|
|
29
|
-
...iconDriver,
|
|
30
|
-
exists,
|
|
31
|
-
getStyle
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
const getStyle = () => {
|
|
35
|
-
return StyleSheet.flatten(driver.getElement().props.style);
|
|
36
|
-
};
|
|
37
|
-
const getSize = () => {
|
|
38
|
-
return getStyle().height;
|
|
39
|
-
};
|
|
40
|
-
return {
|
|
41
|
-
...driver,
|
|
42
|
-
getLabel,
|
|
43
|
-
getIcon,
|
|
44
|
-
getStyle,
|
|
45
|
-
getSize
|
|
46
|
-
};
|
|
47
|
-
};
|