Skip to content

Commit 51cae00

Browse files
committed
chore(charts): update testing-library to support React 18
1 parent ecd5394 commit 51cae00

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

packages/charts/react-charting/src/components/ResponsiveContainer/ResponsiveContainer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ export const ResponsiveContainer: React.FC<IResponsiveContainerProps> = props =>
7878
// Keep components styles
7979
...child.props.styles,
8080
root: {
81-
...child.props.styles?.root,
81+
...(typeof child.props.styles !== 'function' && typeof child.props.styles?.root === 'object'
82+
? child.props?.styles?.root
83+
: {}),
8284
// Ensure the child element fills the parent container
8385
// https://stackoverflow.com/questions/8468066/child-inside-parent-with-min-height-100-not-inheriting-height
8486
width: calculatedWidth,

packages/charts/react-charting/src/utilities/locale-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type LocaleStringDataProps = number | string | Date | undefined;
2-
export const convertToLocaleString = (data: LocaleStringDataProps, culture?: string): LocaleStringDataProps => {
2+
export const convertToLocaleString = (data: LocaleStringDataProps, culture?: string): string | number | undefined => {
33
if (!data) {
44
return data;
55
}

packages/charts/react-charting/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"preserveConstEnums": true,
1818
"skipLibCheck": true,
1919
"lib": ["es5", "dom"],
20-
"typeRoots": ["../../../node_modules/@types", "../../../typings"],
21-
"types": ["jest", "custom-global", "@testing-library/jest-dom"],
20+
"typeRoots": ["../../../node_modules/@types", "../../../typings", "../../../node_modules/@testing-library"],
21+
"types": ["jest", "custom-global", "jest-dom"],
2222
"isolatedModules": true
2323
},
2424
"include": ["src"]

0 commit comments

Comments
 (0)