Skip to content

Commit

Permalink
Upgrade jest/RTL deps & remove unnecessary deps
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsomthd committed Jan 30, 2025
1 parent 7e4e4d4 commit b56561b
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 159 deletions.
18 changes: 7 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@
"@patternfly/react-table": "5.4.14",
"@patternfly/react-tokens": "5.4.1",
"@patternfly/react-topology": "5.4.1",
"@types/lodash-es": "^4.17.4",
"@types/react-dnd-html5-backend": "^3.0.2",
"buffer": "^6.0.3",
"cache-loader": "^4.1.0",
"circular-dependency-plugin": "^5.2.2",
Expand Down Expand Up @@ -147,18 +145,16 @@
"devDependencies": {
"@cypress/webpack-preprocessor": "^6.0.2",
"@discoveryjs/json-ext": "0.6.1",
"@swc/core": "^1.9.2",
"@swc/core": "^1.10.11",
"@swc/jest": "^0.2.37",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.2",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "^29.5.14",
"@types/luxon": "^3.3.1",
"@types/node": "^14.14.34",
"@types/react": "16.8.13",
"@types/react-helmet": "^6.1.1",
"@types/react-router": "^5.1.20",
"@types/lodash-es": "^4.17.12",
"@types/luxon": "^3.4.2",
"@types/react-helmet": "^6.1.11",
"@types/react-window": "^1.8.8",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.17.0",
Expand All @@ -171,8 +167,8 @@
"eslint-plugin-chai-friendly": "^1.0.1",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-jest-dom": "^5.4.0",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-mobx": "^0.0.13",
"eslint-plugin-react": "^7.37.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const GCPEndpointType: React.FC<GCPEndPointTypeProps> = (props) => {
const file = event.target.files[0];
const reader = new FileReader();
reader.onload = (ev) => {
const data = _.get(ev, 'target.result');
const data = _.get(ev, 'target.result') as string;
setFileData(data);
setInputData(file.name);
dispatch({ type: 'setGcpJSON', value: data });
Expand Down
2 changes: 1 addition & 1 deletion packages/odf/utils/mcg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const getNamespaceStoreType = (
): StoreProviders => {
let type: StoreProviders = null;
Object.entries(NS_PROVIDERS_NOOBAA_MAP).forEach(([k, v]) => {
if (ns?.spec?.[v]) {
if (ns?.spec?.[v as string]) {
type = k as StoreProviders;
}
});
Expand Down
5 changes: 0 additions & 5 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
"@patternfly/react-table": "5.4.14",
"@patternfly/react-tokens": "5.4.1",
"@patternfly/react-topology": "5.4.1",
"@types/lodash-es": "^4.17.4",
"@types/node": "^14.14.34",
"@types/react": "16.8.13",
"@types/react-dnd-html5-backend": "^3.0.2",
"@types/react-helmet": "^6.1.1",
"buffer": "^6.0.3",
"classnames": "^2.3.1",
"fuzzysearch": "^1.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/charts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const getRangeVectorStats: GetRangeStats = (
x: xMutator?.(x) ?? defaultXMutator(x),
y: threshold ? threshold : yMutator?.(y) ?? defaultYMutator(y),
description: _.isFunction(description)
? description(r, index)
? (description as Function)(r, index)
: description,
symbol,
} as DataPoint<Date>;
Expand Down
6 changes: 4 additions & 2 deletions packages/shared/src/generic/ButtonBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import { LoadingInline } from './Loading';

const injectDisabled = (children: React.ReactChild, disabled) => {
return React.Children.map(children, (c) => {
if (!_.isObject(c) || c.type !== 'button') {
if (!_.isObject(c) || (c as React.ReactElement).type !== 'button') {
return c;
}

return React.cloneElement(c, { disabled: c.props.disabled || disabled });
return React.cloneElement(c as React.ReactElement, {
disabled: (c as React.ReactElement).props.disabled || disabled,
});
});
};

Expand Down
7 changes: 6 additions & 1 deletion packages/shared/src/hooks/useUserSettingsLocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ export const useUserSettingsLocalStorage = <T>(
): [T, React.Dispatch<React.SetStateAction<T>>] => {
// Mount status for safty state updates
const mounted = React.useRef(true);
React.useEffect(() => () => (mounted.current = false), []);
React.useEffect(
() => () => {
mounted.current = false;
},
[]
);
const keyRef = React.useRef<string>(
userSettingsKey?.replace(/[^-._a-zA-Z0-9]/g, '_')
);
Expand Down
Loading

0 comments on commit b56561b

Please sign in to comment.