Skip to content

Commit 0bbf550

Browse files
authored
chore: migrate to react 18 (#582)
* chore: migrate to react 18
1 parent 029d89b commit 0bbf550

File tree

79 files changed

+4642
-3812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+4642
-3812
lines changed

.mocharc.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
module.exports = {
44
extension: ["js", "jsx", "ts", "tsx"],
55
recursive: true,
6-
require: ["./test/ts-node", "./test/setup", "./test/assert-ext", "jsdom-global/register"],
6+
require: [
7+
"./test/setup/ts-node",
8+
"./test/setup/globals",
9+
"./test/setup/assert-ext",
10+
"./test/setup/configure-testing-library"
11+
],
712
};

lib/adapters/test-result/testplane.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const getStatus = (eventName: ValueOf<Testplane['events']>, events: Testp
3232
} else if (eventName === events.TEST_PENDING) {
3333
return TestStatus.SKIPPED;
3434
} else if (eventName === events.RETRY || eventName === events.TEST_FAIL) {
35-
return hasUnrelatedToScreenshotsErrors(testResult.err!) ? TestStatus.ERROR : TestStatus.FAIL;
35+
return hasUnrelatedToScreenshotsErrors(testResult.err as Error) ? TestStatus.ERROR : TestStatus.FAIL;
3636
} else if (eventName === events.TEST_BEGIN) {
3737
return TestStatus.RUNNING;
3838
}

lib/static/components/bottom-progress-bar/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const BottomProgressBar = (props) => {
3737

3838
BottomProgressBar.propTypes = {
3939
progressBar: PropTypes.object.isRequired,
40-
visibleRootSuiteIds: PropTypes.arrayOf(PropTypes.number)
40+
visibleRootSuiteIds: PropTypes.arrayOf(PropTypes.string)
4141
};
4242

4343
export default connect(

lib/static/components/bullet.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Bullet = ({status, onClick, className}) => {
1616
});
1717

1818
if (!isCheckbox) {
19-
return <div className='bullet-container'><ChevronUp className={classNames(className, 'bullet_type-simple')}/></div>;
19+
return <div className='bullet-container'><ChevronUp className={classNames(className, 'bullet_type-simple')} data-qa={'bullet-icon'}/></div>;
2020
}
2121

2222
return <div onClick={handleClick} className='bullet-container'>

lib/static/components/controls/common-controls.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class ControlButtons extends Component {
1818
view: PropTypes.shape({
1919
expand: PropTypes.string.isRequired,
2020
viewMode: PropTypes.string.isRequired,
21-
diffMode: PropTypes.string.isRequired,
22-
changeViewMode: PropTypes.func.isRequired
21+
diffMode: PropTypes.string.isRequired
2322
}),
2423
isStatisImageAccepterEnabled: PropTypes.bool,
2524
actions: PropTypes.object.isRequired

lib/static/components/controls/control-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import classNames from 'classnames';
44
import {Button} from '@gravity-ui/uikit';
55

66
interface ControlButtonProps {
7-
label: string | Component;
7+
label: React.ReactNode;
88
title?: string;
99
handler: () => void;
1010
isActive?: boolean;

lib/static/components/controls/menu-bar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MenuBar extends Component {
3333
}
3434

3535
return (
36-
<div className="menu-bar" data-test-id='menu-bar'>
36+
<div className="menu-bar" data-qa='menu-bar'>
3737
<DropdownMenu size='m' renderSwitcher={({className, ...props}) => (
3838
<Button className={classNames('menu-bar__dropdown', className)}{...props} view="flat">
3939
<Icon size={16} data={Bars} />

lib/static/components/details.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ export default class Details extends Component {
7070
size='l'>
7171
<Disclosure.Summary>
7272
{(props, defaultButton) => (
73-
<div className={classNames(className, 'details__summary')} {...props}>
74-
<div className='details__expand-button' onClick={this.stopPropagation}>
73+
<div className={classNames(className, 'details__summary')} aria-controls={props.ariaControls} onClick={props.onClick} id={props.id}>
74+
<div className="details__expand-button" onClick={this.stopPropagation}>
7575
{defaultButton}
7676
</div>
7777
{title}

lib/static/components/extension-point.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as plugins from '../modules/plugins';
66
export default class ExtensionPoint extends Component {
77
static propTypes = {
88
name: PropTypes.string.isRequired,
9-
children: PropTypes.oneOfType([PropTypes.element, PropTypes.string])
9+
children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.array])
1010
};
1111

1212
render() {

lib/static/components/header/summary/dbBtn.jsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import {Ref} from 'semantic-ui-react';
43
import {Button} from '@gravity-ui/uikit';
54
import {ChevronDown} from '@gravity-ui/icons';
65

@@ -11,16 +10,14 @@ const ForwardedDbBtn = React.forwardRef(function DbBtn({fetchDbDetails}, ref) {
1110
const content = `Databases loaded: ${value}`;
1211

1312
return (
14-
<Ref innerRef={ref}>
15-
<Button
16-
view={isFailed ? 'flat-danger' : 'flat'}
17-
>
18-
<div className='db-info'>
19-
<ChevronDown/>
20-
{content}
21-
</div>
22-
</Button>
23-
</Ref>
13+
<Button
14+
view={isFailed ? 'flat-danger' : 'flat'} ref={ref}
15+
>
16+
<div className='db-info'>
17+
<ChevronDown/>
18+
{content}
19+
</div>
20+
</Button>
2421
);
2522
});
2623

0 commit comments

Comments
 (0)