#325 Updated to react 17

This commit is contained in:
Alejandro Celaya
2020-11-13 22:44:26 +01:00
parent 18bccab27a
commit 6c90d7072f
134 changed files with 2691 additions and 735 deletions

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Route } from 'react-router-dom';
import { identity } from 'ramda';

View File

@@ -1,5 +1,4 @@
import { shallow, ShallowWrapper } from 'enzyme';
import React from 'react';
import { Mock } from 'ts-mockery';
import asideMenuCreator from '../../src/common/AsideMenu';
import { ServerWithId } from '../../src/servers/data';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Button } from 'reactstrap';
import { Mock } from 'ts-mockery';

View File

@@ -1,5 +1,4 @@
import { shallow, ShallowWrapper } from 'enzyme';
import React from 'react';
import { Mock } from 'ts-mockery';
import Home, { HomeProps } from '../../src/common/Home';
import { ServerWithId } from '../../src/servers/data';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Link } from 'react-router-dom';
import NotFound from '../../src/common/NotFound';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import { RouteComponentProps } from 'react-router';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import ShlinkVersions, { ShlinkVersionsProps } from '../../src/common/ShlinkVersions';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { identity } from 'ramda';
import { PaginationItem } from 'reactstrap';
@@ -8,7 +7,6 @@ import { ELLIPSIS } from '../../src/utils/helpers/pagination';
describe('<SimplePaginator />', () => {
let wrapper: ShallowWrapper;
const createWrapper = (pagesCount: number, currentPage = 1) => {
// @ts-expect-error
wrapper = shallow(<SimplePaginator pagesCount={pagesCount} currentPage={currentPage} setCurrentPage={identity} />);
return wrapper;

View File

@@ -1,6 +1,4 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { identity } from 'ramda';
import { Mock } from 'ts-mockery';
import { History } from 'history';
import createServerConstruct from '../../src/servers/CreateServer';
@@ -18,9 +16,7 @@ describe('<CreateServer />', () => {
.mockReturnValueOnce([ importFailed, () => '' ]);
const CreateServer = createServerConstruct(ImportServersBtn, useStateFlagTimeout);
wrapper = shallow(
<CreateServer createServer={createServerMock} resetSelectedServer={identity} history={historyMock} />,
);
wrapper = shallow(<CreateServer createServer={createServerMock} history={historyMock} />);
return wrapper;
};

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import deleteServerButtonConstruct from '../../src/servers/DeleteServerButton';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';
import { History } from 'history';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { mount, ReactWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import { History, Location } from 'history';

View File

@@ -1,6 +1,6 @@
import { values } from 'ramda';
import { Mock } from 'ts-mockery';
import React, { FC } from 'react';
import { FC } from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { DropdownItem, DropdownToggle } from 'reactstrap';
import serversDropdownCreator, { ServersDropdownProps } from '../../src/servers/ServersDropdown';

View File

@@ -1,5 +1,4 @@
import { shallow, ShallowWrapper } from 'enzyme';
import React from 'react';
import { ListGroup } from 'reactstrap';
import { Mock } from 'ts-mockery';
import ServersListGroup from '../../src/servers/ServersListGroup';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { mount, ReactWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import ForServerVersion from '../../../src/servers/helpers/ForServerVersion';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { UncontrolledTooltip } from 'reactstrap';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { BrowserRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { ServerForm } from '../../../src/servers/helpers/ServerForm';
import { HorizontalFormGroup } from '../../../src/utils/HorizontalFormGroup';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import moment from 'moment';
import { identity } from 'ramda';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { PaginationItem } from 'reactstrap';
import Paginator from '../../src/short-urls/Paginator';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import searchBarCreator from '../../src/short-urls/SearchBar';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import shortUrlsCreator from '../../src/short-urls/ShortUrls';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCaretDown as caretDownIcon, faCaretUp as caretUpIcon } from '@fortawesome/free-solid-svg-icons';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { mount, ReactWrapper } from 'enzyme';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Modal } from 'reactstrap';

View File

@@ -1,6 +1,4 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { identity } from 'ramda';
import CopyToClipboard from 'react-copy-to-clipboard';
import { Tooltip } from 'reactstrap';
import { Mock } from 'ts-mockery';
@@ -15,7 +13,7 @@ describe('<CreateShortUrlResult />', () => {
const CreateShortUrlResult = createCreateShortUrlResult(useStateFlagTimeout);
const createWrapper = (result: ShortUrl | null = null, error = false) => {
wrapper = shallow(
<CreateShortUrlResult resetCreateShortUrl={identity} result={result} error={error} saving={false} />,
<CreateShortUrlResult resetCreateShortUrl={() => {}} result={result} error={error} saving={false} />,
);
return wrapper;

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { identity } from 'ramda';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { FormGroup } from 'reactstrap';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { FormGroup } from 'reactstrap';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Modal } from 'reactstrap';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { ExternalLink } from 'react-external-link';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { ExternalLink } from 'react-external-link';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { UncontrolledTooltip } from 'reactstrap';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import moment from 'moment';
import Moment from 'react-moment';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { ButtonDropdown, DropdownItem } from 'reactstrap';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Link } from 'react-router-dom';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Link } from 'react-router-dom';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { identity } from 'ramda';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Modal, ModalBody, ModalFooter } from 'reactstrap';
import DeleteTagConfirmModal from '../../../src/tags/helpers/DeleteTagConfirmModal';

View File

@@ -1,4 +1,4 @@
import React, { ChangeEvent, PropsWithChildren } from 'react';
import { ChangeEvent, PropsWithChildren } from 'react';
import { mount, ReactWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import Checkbox from '../../src/utils/Checkbox';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import moment from 'moment';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import DateRangeRow from '../../src/utils/DateRangeRow';
import DateInput from '../../src/utils/DateInput';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { DropdownItem } from 'reactstrap';
import { identity, values } from 'ramda';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { identity } from 'ramda';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import Moment from 'react-moment';
import { ExternalLink } from 'react-external-link';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import { History } from 'history';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import Tag from '../../src/tags/helpers/Tag';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import VisitsHeader from '../../src/visits/VisitsHeader';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Card, Progress } from 'reactstrap';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import VisitsTable from '../../src/visits/VisitsTable';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Doughnut, HorizontalBar } from 'react-chartjs-2';
import { keys, values } from 'ramda';

View File

@@ -1,4 +1,4 @@
import React, { ReactNode } from 'react';
import { ReactNode } from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Card, CardBody, CardHeader, CardFooter } from 'reactstrap';
import GraphCard from '../../../src/visits/helpers/GraphCard';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { CardHeader, DropdownItem } from 'reactstrap';
import { Line } from 'react-chartjs-2';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Modal } from 'reactstrap';
import { Marker, Popup } from 'react-leaflet';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { Dropdown, DropdownItem, UncontrolledTooltip } from 'reactstrap';
import { Mock } from 'ts-mockery';

View File

@@ -1,4 +1,3 @@
import React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { range } from 'ramda';
import SortableBarGraph from '../../../src/visits/helpers/SortableBarGraph';