@hero-design/rn 8.101.2 → 8.101.3-alpha.0
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/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +6 -0
- package/es/index.js +2 -1
- package/lib/index.js +2 -1
- package/package.json +1 -1
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/TextInput/__tests__/index.spec.tsx +18 -7
- package/src/components/TextInput/index.tsx +3 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(node:
|
|
1
|
+
(node:4149) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
|
|
2
2
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
3
3
|
[36m
|
|
4
4
|
[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
@@ -15,9 +15,9 @@ node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/sr
|
|
|
15
15
|
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~[0m
|
|
16
16
|
[39m
|
|
17
17
|
[1m[33m(!) [plugin node-resolve] preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.[39m[22m
|
|
18
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [1m1m
|
|
18
|
+
[32mcreated [1mlib/index.js, es/index.js[22m in [1m1m 11.2s[22m[39m
|
|
19
19
|
[36m
|
|
20
20
|
[1m/home/runner/work/hero-design/hero-design/packages/rn/src/locales/en_AU.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/en_CA.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/index.ts, /home/runner/work/hero-design/hero-design/packages/rn/src/locales/types.ts[22m → [1m., .[22m...[39m
|
|
21
21
|
[1m[33m(!) Generated empty chunks[39m[22m
|
|
22
22
|
"locales/types" and "locales/types"
|
|
23
|
-
[32mcreated [1m., .[22m in [
|
|
23
|
+
[32mcreated [1m., .[22m in [1m25.9s[22m[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hero-design/rn
|
|
2
2
|
|
|
3
|
+
## 8.101.3-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4de62c1c0bda0ef6f78a9c93956192641b6e9eea`](https://github.com/Thinkei/hero-design/commit/4de62c1c0bda0ef6f78a9c93956192641b6e9eea) Thanks [@cuongnguyeneh](https://github.com/cuongnguyeneh)! - chore: update testId of native text input
|
|
8
|
+
|
|
3
9
|
## 8.101.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/es/index.js
CHANGED
|
@@ -20175,12 +20175,13 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref8, ref) {
|
|
|
20175
20175
|
}, [style, theme]),
|
|
20176
20176
|
backgroundColor = _useMemo2.backgroundColor,
|
|
20177
20177
|
styleWithoutBackgroundColor = _useMemo2.styleWithoutBackgroundColor;
|
|
20178
|
+
var nativeInputTestIDSuffix = testID ? "-".concat(testID) : '';
|
|
20178
20179
|
var nativeInputProps = _objectSpread2(_objectSpread2({
|
|
20179
20180
|
style: StyleSheet$1.flatten([{
|
|
20180
20181
|
backgroundColor: backgroundColor,
|
|
20181
20182
|
color: theme.__hd__.textInput.colors.text
|
|
20182
20183
|
}, textStyleWithoutBorderStyle]),
|
|
20183
|
-
testID:
|
|
20184
|
+
testID: "text-input".concat(nativeInputTestIDSuffix),
|
|
20184
20185
|
accessibilityState: {
|
|
20185
20186
|
disabled: state === 'disabled' || state === 'readonly'
|
|
20186
20187
|
},
|
package/lib/index.js
CHANGED
|
@@ -20204,12 +20204,13 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
20204
20204
|
}, [style, theme]),
|
|
20205
20205
|
backgroundColor = _useMemo2.backgroundColor,
|
|
20206
20206
|
styleWithoutBackgroundColor = _useMemo2.styleWithoutBackgroundColor;
|
|
20207
|
+
var nativeInputTestIDSuffix = testID ? "-".concat(testID) : '';
|
|
20207
20208
|
var nativeInputProps = _objectSpread2(_objectSpread2({
|
|
20208
20209
|
style: reactNative.StyleSheet.flatten([{
|
|
20209
20210
|
backgroundColor: backgroundColor,
|
|
20210
20211
|
color: theme.__hd__.textInput.colors.text
|
|
20211
20212
|
}, textStyleWithoutBorderStyle]),
|
|
20212
|
-
testID:
|
|
20213
|
+
testID: "text-input".concat(nativeInputTestIDSuffix),
|
|
20213
20214
|
accessibilityState: {
|
|
20214
20215
|
disabled: state === 'disabled' || state === 'readonly'
|
|
20215
20216
|
},
|
package/package.json
CHANGED
|
@@ -1185,7 +1185,7 @@ exports[`TextInput disabled renders correctly 1`] = `
|
|
|
1185
1185
|
},
|
|
1186
1186
|
]
|
|
1187
1187
|
}
|
|
1188
|
-
testID="text-input"
|
|
1188
|
+
testID="text-input-disabled-text-input"
|
|
1189
1189
|
themeVariant="text"
|
|
1190
1190
|
value="100"
|
|
1191
1191
|
/>
|
|
@@ -2320,7 +2320,7 @@ exports[`TextInput idle renders correctly 1`] = `
|
|
|
2320
2320
|
},
|
|
2321
2321
|
]
|
|
2322
2322
|
}
|
|
2323
|
-
testID="text-input"
|
|
2323
|
+
testID="text-input-idle-text-input"
|
|
2324
2324
|
themeVariant="text"
|
|
2325
2325
|
/>
|
|
2326
2326
|
</View>
|
|
@@ -54,7 +54,9 @@ describe('TextInput', () => {
|
|
|
54
54
|
expect(toJSON()).toMatchSnapshot();
|
|
55
55
|
expect(getByTestId('idle-text-input')).toBeTruthy();
|
|
56
56
|
expect(
|
|
57
|
-
within(getByTestId('idle-text-input')).queryAllByTestId(
|
|
57
|
+
within(getByTestId('idle-text-input')).queryAllByTestId(
|
|
58
|
+
'text-input-idle-text-input'
|
|
59
|
+
)
|
|
58
60
|
).toHaveLength(1);
|
|
59
61
|
expect(
|
|
60
62
|
within(getByTestId('idle-text-input')).queryAllByText('Amount (AUD)')
|
|
@@ -69,7 +71,9 @@ describe('TextInput', () => {
|
|
|
69
71
|
within(getByTestId('idle-text-input')).queryAllByTestId('input-suffix')
|
|
70
72
|
).toHaveLength(1);
|
|
71
73
|
|
|
72
|
-
expect(getByTestId('text-input').props.placeholder).toBe(
|
|
74
|
+
expect(getByTestId('text-input-idle-text-input').props.placeholder).toBe(
|
|
75
|
+
' '
|
|
76
|
+
);
|
|
73
77
|
});
|
|
74
78
|
|
|
75
79
|
it('should not render input-label if label is empty', () => {
|
|
@@ -104,7 +108,7 @@ describe('TextInput', () => {
|
|
|
104
108
|
);
|
|
105
109
|
|
|
106
110
|
const testInput = within(getByTestId('idle-text-input')).getByTestId(
|
|
107
|
-
'text-input'
|
|
111
|
+
'text-input-idle-text-input'
|
|
108
112
|
);
|
|
109
113
|
|
|
110
114
|
fireEvent.changeText(testInput, 'Thong Quach');
|
|
@@ -305,13 +309,18 @@ describe('TextInput', () => {
|
|
|
305
309
|
expect(toJSON()).toMatchSnapshot();
|
|
306
310
|
expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
|
|
307
311
|
expect(queryAllByTestId('input-label')).toHaveLength(1);
|
|
308
|
-
expect(queryAllByTestId('text-input')).toHaveLength(
|
|
312
|
+
expect(queryAllByTestId('text-input-disabled-text-input')).toHaveLength(
|
|
313
|
+
1
|
|
314
|
+
);
|
|
309
315
|
expect(getByTestId('disabled-text-input')).toHaveProp(
|
|
310
316
|
'pointerEvents',
|
|
311
317
|
'none'
|
|
312
318
|
);
|
|
313
319
|
|
|
314
|
-
expect(getByTestId('text-input')).not.toHaveProp(
|
|
320
|
+
expect(getByTestId('text-input-disabled-text-input')).not.toHaveProp(
|
|
321
|
+
'multiline',
|
|
322
|
+
'true'
|
|
323
|
+
);
|
|
315
324
|
});
|
|
316
325
|
});
|
|
317
326
|
|
|
@@ -560,7 +569,7 @@ describe('renderInput', () => {
|
|
|
560
569
|
{renderInput({
|
|
561
570
|
variant: 'textarea',
|
|
562
571
|
nativeInputProps: {
|
|
563
|
-
testID: 'text-input',
|
|
572
|
+
testID: 'text-input-idle-text-input',
|
|
564
573
|
value: 'text input value',
|
|
565
574
|
},
|
|
566
575
|
theme,
|
|
@@ -568,7 +577,9 @@ describe('renderInput', () => {
|
|
|
568
577
|
</>
|
|
569
578
|
);
|
|
570
579
|
|
|
571
|
-
expect(wrapper.queryAllByTestId('text-input')).toHaveLength(
|
|
580
|
+
expect(wrapper.queryAllByTestId('text-input-idle-text-input')).toHaveLength(
|
|
581
|
+
1
|
|
582
|
+
);
|
|
572
583
|
expect(wrapper.queryAllByDisplayValue('text input value')).toHaveLength(1);
|
|
573
584
|
});
|
|
574
585
|
});
|
|
@@ -397,6 +397,8 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
|
397
397
|
};
|
|
398
398
|
}, [style, theme]);
|
|
399
399
|
|
|
400
|
+
const nativeInputTestIDSuffix = testID ? `-${testID}` : '';
|
|
401
|
+
|
|
400
402
|
const nativeInputProps: NativeTextInputProps = {
|
|
401
403
|
style: StyleSheet.flatten([
|
|
402
404
|
{
|
|
@@ -405,7 +407,7 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
|
405
407
|
},
|
|
406
408
|
textStyleWithoutBorderStyle,
|
|
407
409
|
]),
|
|
408
|
-
testID:
|
|
410
|
+
testID: `text-input${nativeInputTestIDSuffix}`,
|
|
409
411
|
accessibilityState: {
|
|
410
412
|
disabled: state === 'disabled' || state === 'readonly',
|
|
411
413
|
},
|