Ordered imports alphabetically

This commit is contained in:
Alejandro Celaya
2023-02-18 11:11:01 +01:00
parent 2a5480da79
commit 1f41f8da23
259 changed files with 853 additions and 853 deletions

View File

@@ -1,6 +1,6 @@
import type { ReactElement } from 'react';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import type { ReactElement } from 'react';
export const setUpCanvas = (element: ReactElement) => {
const result = render(element);

View File

@@ -1,10 +1,10 @@
import { Mock } from 'ts-mockery';
import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { OptionalString } from '../../../src/utils/utils';
import type { ShlinkDomain, ShlinkVisits, ShlinkVisitsOverview } from '../../../src/api/types';
import type { ShortUrl, ShortUrlsOrder } from '../../../src/short-urls/data';
import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors';
import type { HttpClient } from '../../../src/common/services/HttpClient';
import type { ShortUrl, ShortUrlsOrder } from '../../../src/short-urls/data';
import type { OptionalString } from '../../../src/utils/utils';
describe('ShlinkApiClient', () => {
const fetchJson = jest.fn().mockResolvedValue({});

View File

@@ -1,8 +1,8 @@
import { Mock } from 'ts-mockery';
import { buildShlinkApiClient } from '../../../src/api/services/ShlinkApiClientBuilder';
import type { ReachableServer, SelectedServer } from '../../../src/servers/data';
import type { ShlinkState } from '../../../src/container/types';
import type { HttpClient } from '../../../src/common/services/HttpClient';
import type { ShlinkState } from '../../../src/container/types';
import type { ReachableServer, SelectedServer } from '../../../src/servers/data';
describe('ShlinkApiClientBuilder', () => {
const server = (data: Partial<ReachableServer>) => Mock.of<ReachableServer>(data);

View File

@@ -1,9 +1,9 @@
import { render, screen } from '@testing-library/react';
import { Router } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import { Router } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import type { Settings } from '../../src/settings/reducers/settings';
import { App as createApp } from '../../src/app/App';
import type { Settings } from '../../src/settings/reducers/settings';
describe('<App />', () => {
const App = createApp(

View File

@@ -1,4 +1,4 @@
import { appUpdatesReducer, appUpdateAvailable, resetAppUpdate } from '../../../src/app/reducers/appUpdates';
import { appUpdateAvailable, appUpdatesReducer, resetAppUpdate } from '../../../src/app/reducers/appUpdates';
describe('appUpdatesReducer', () => {
describe('reducer', () => {

View File

@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import { AsideMenu as createAsideMenu } from '../../src/common/AsideMenu';
import type { ReachableServer } from '../../src/servers/data';

View File

@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import { Home } from '../../src/common/Home';
import type { ServersMap, ServerWithId } from '../../src/servers/data';

View File

@@ -1,6 +1,6 @@
import { screen, waitFor } from '@testing-library/react';
import { Router } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import { Router } from 'react-router-dom';
import { MainHeader as createMainHeader } from '../../src/common/MainHeader';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import { Router, useParams } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import { Router, useParams } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import { MenuLayout as createMenuLayout } from '../../src/common/MenuLayout';
import type { NonReachableServer, NotFoundServer, ReachableServer, SelectedServer } from '../../src/servers/data';

View File

@@ -1,8 +1,8 @@
import { render } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { Sidebar } from '../../src/common/reducers/sidebar';
import { ShlinkVersionsContainer } from '../../src/common/ShlinkVersionsContainer';
import type { SelectedServer } from '../../src/servers/data';
import type { Sidebar } from '../../src/common/reducers/sidebar';
describe('<ShlinkVersionsContainer />', () => {
const setUp = (sidebar: Sidebar) => render(

View File

@@ -1,4 +1,4 @@
import { sidebarReducer, sidebarNotPresent, sidebarPresent } from '../../../src/common/reducers/sidebar';
import { sidebarNotPresent, sidebarPresent, sidebarReducer } from '../../../src/common/reducers/sidebar';
describe('sidebarReducer', () => {
describe('reducer', () => {

View File

@@ -1,6 +1,6 @@
import { Mock } from 'ts-mockery';
import { ImageDownloader } from '../../../src/common/services/ImageDownloader';
import type { HttpClient } from '../../../src/common/services/HttpClient';
import { ImageDownloader } from '../../../src/common/services/ImageDownloader';
import { windowMock } from '../../__mocks__/Window.mock';
describe('ImageDownloader', () => {

View File

@@ -1,7 +1,7 @@
import { ReportExporter } from '../../../src/common/services/ReportExporter';
import type { ExportableShortUrl } from '../../../src/short-urls/data';
import type { NormalizedVisit } from '../../../src/visits/types';
import { windowMock } from '../../__mocks__/Window.mock';
import type { ExportableShortUrl } from '../../../src/short-urls/data';
describe('ReportExporter', () => {
const jsonToCsv = jest.fn();

View File

@@ -1,9 +1,9 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { ShlinkDomainRedirects } from '../../src/api/types';
import type { Domain } from '../../src/domains/data';
import { DomainRow } from '../../src/domains/DomainRow';
import type { SelectedServer } from '../../src/servers/data';
import type { Domain } from '../../src/domains/data';
describe('<DomainRow />', () => {
const redirectsCombinations = [

View File

@@ -1,8 +1,8 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { ShlinkDomain } from '../../src/api/types';
import { DomainSelector } from '../../src/domains/DomainSelector';
import type { DomainsList } from '../../src/domains/reducers/domainsList';
import type { ShlinkDomain } from '../../src/api/types';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<DomainSelector />', () => {

View File

@@ -1,11 +1,11 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { DomainsList } from '../../src/domains/reducers/domainsList';
import { ManageDomains } from '../../src/domains/ManageDomains';
import type { ShlinkDomain } from '../../src/api/types';
import type { ProblemDetailsError } from '../../src/api/types/errors';
import { ManageDomains } from '../../src/domains/ManageDomains';
import type { DomainsList } from '../../src/domains/reducers/domainsList';
import type { SelectedServer } from '../../src/servers/data';
import { renderWithEvents } from '../__helpers__/setUpTest';
import type { ProblemDetailsError } from '../../src/api/types/errors';
describe('<ManageDomains />', () => {
const listDomains = jest.fn();

View File

@@ -1,8 +1,8 @@
import { screen, waitForElementToBeRemoved } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import { DomainDropdown } from '../../../src/domains/helpers/DomainDropdown';
import { Mock } from 'ts-mockery';
import type { Domain } from '../../../src/domains/data';
import { DomainDropdown } from '../../../src/domains/helpers/DomainDropdown';
import type { ReachableServer, SelectedServer } from '../../../src/servers/data';
import type { SemVer } from '../../../src/utils/helpers/version';
import { renderWithEvents } from '../../__helpers__/setUpTest';

View File

@@ -1,8 +1,8 @@
import { Mock } from 'ts-mockery';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkDomainRedirects } from '../../../src/api/types';
import type { EditDomainRedirects } from '../../../src/domains/reducers/domainRedirects';
import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects';
import type { ShlinkDomainRedirects } from '../../../src/api/types';
describe('domainRedirectsReducer', () => {
beforeEach(jest.clearAllMocks);

View File

@@ -1,18 +1,18 @@
import { Mock } from 'ts-mockery';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkDomainRedirects } from '../../../src/api/types';
import { parseApiError } from '../../../src/api/utils';
import type { ShlinkState } from '../../../src/container/types';
import type { Domain } from '../../../src/domains/data';
import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects';
import type {
DomainsList } from '../../../src/domains/reducers/domainsList';
import {
domainsListReducerCreator,
replaceRedirectsOnDomain,
replaceStatusOnDomain,
domainsListReducerCreator,
} from '../../../src/domains/reducers/domainsList';
import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects';
import type { ShlinkDomainRedirects } from '../../../src/api/types';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { Domain } from '../../../src/domains/data';
import type { ShlinkState } from '../../../src/container/types';
import type { SelectedServer, ServerData } from '../../../src/servers/data';
import { parseApiError } from '../../../src/api/utils';
describe('domainsListReducer', () => {
const dispatch = jest.fn();

View File

@@ -1,6 +1,6 @@
import { EventSourcePolyfill } from 'event-source-polyfill';
import { Mock } from 'ts-mockery';
import { identity } from 'ramda';
import { Mock } from 'ts-mockery';
import { bindToMercureTopic } from '../../../src/mercure/helpers';
import type { MercureInfo } from '../../../src/mercure/reducers/mercureInfo';

View File

@@ -1,7 +1,7 @@
import { Mock } from 'ts-mockery';
import { mercureInfoReducerCreator } from '../../../src/mercure/reducers/mercureInfo';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { GetState } from '../../../src/container/types';
import { mercureInfoReducerCreator } from '../../../src/mercure/reducers/mercureInfo';
describe('mercureInfoReducer', () => {
const mercureInfo = {

View File

@@ -1,6 +1,6 @@
import { fireEvent, screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { useNavigate } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import { CreateServer as createCreateServer } from '../../src/servers/CreateServer';
import type { ServerWithId } from '../../src/servers/data';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,8 +1,8 @@
import type { ReactNode } from 'react';
import { screen, waitFor } from '@testing-library/react';
import type { ReactNode } from 'react';
import { Mock } from 'ts-mockery';
import { DeleteServerButton as createDeleteServerButton } from '../../src/servers/DeleteServerButton';
import type { ServerWithId } from '../../src/servers/data';
import { DeleteServerButton as createDeleteServerButton } from '../../src/servers/DeleteServerButton';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<DeleteServerButton />', () => {

View File

@@ -1,8 +1,8 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { useNavigate } from 'react-router-dom';
import { DeleteServerModal } from '../../src/servers/DeleteServerModal';
import { Mock } from 'ts-mockery';
import type { ServerWithId } from '../../src/servers/data';
import { DeleteServerModal } from '../../src/servers/DeleteServerModal';
import { renderWithEvents } from '../__helpers__/setUpTest';
import { TestModalWrapper } from '../__helpers__/TestModalWrapper';

View File

@@ -1,8 +1,8 @@
import { fireEvent, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter, useNavigate } from 'react-router-dom';
import { EditServer as editServerConstruct } from '../../src/servers/EditServer';
import { Mock } from 'ts-mockery';
import type { ReachableServer, SelectedServer } from '../../src/servers/data';
import { EditServer as editServerConstruct } from '../../src/servers/EditServer';
import { renderWithEvents } from '../__helpers__/setUpTest';
jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useNavigate: jest.fn() }));

View File

@@ -1,9 +1,9 @@
import { Mock } from 'ts-mockery';
import { screen, waitFor } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import type ServersExporter from '../../src/servers/services/ServersExporter';
import { ManageServers as createManageServers } from '../../src/servers/ManageServers';
import { Mock } from 'ts-mockery';
import type { ServersMap, ServerWithId } from '../../src/servers/data';
import { ManageServers as createManageServers } from '../../src/servers/ManageServers';
import type ServersExporter from '../../src/servers/services/ServersExporter';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<ManageServers />', () => {

View File

@@ -1,7 +1,7 @@
import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import { ManageServersRow as createManageServersRow } from '../../src/servers/ManageServersRow';
import type { ServerWithId } from '../../src/servers/data';
import { ManageServersRow as createManageServersRow } from '../../src/servers/ManageServersRow';
describe('<ManageServersRow />', () => {
const ManageServersRow = createManageServersRow(() => <span>ManageServersRowDropdown</span>);

View File

@@ -1,6 +1,6 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import type { ServerWithId } from '../../src/servers/data';
import { ManageServersRowDropdown as createManageServersRowDropdown } from '../../src/servers/ManageServersRowDropdown';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,13 +1,13 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import type { ShortUrlsList as ShortUrlsListState } from '../../src/short-urls/reducers/shortUrlsList';
import { Overview as overviewCreator } from '../../src/servers/Overview';
import type { TagsList } from '../../src/tags/reducers/tagsList';
import type { VisitsOverview } from '../../src/visits/reducers/visitsOverview';
import { Mock } from 'ts-mockery';
import type { MercureInfo } from '../../src/mercure/reducers/mercureInfo';
import type { ReachableServer } from '../../src/servers/data';
import { Overview as overviewCreator } from '../../src/servers/Overview';
import type { ShortUrlsList as ShortUrlsListState } from '../../src/short-urls/reducers/shortUrlsList';
import type { TagsList } from '../../src/tags/reducers/tagsList';
import { prettify } from '../../src/utils/helpers/numbers';
import type { VisitsOverview } from '../../src/visits/reducers/visitsOverview';
describe('<Overview />', () => {
const ShortUrlsTable = () => <>ShortUrlsTable</>;

View File

@@ -1,9 +1,9 @@
import { screen } from '@testing-library/react';
import { values } from 'ramda';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import { ServersDropdown } from '../../src/servers/ServersDropdown';
import { Mock } from 'ts-mockery';
import type { ServersMap, ServerWithId } from '../../src/servers/data';
import { ServersDropdown } from '../../src/servers/ServersDropdown';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<ServersDropdown />', () => {

View File

@@ -1,8 +1,8 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import { ServersListGroup } from '../../src/servers/ServersListGroup';
import { Mock } from 'ts-mockery';
import type { ServerWithId } from '../../src/servers/data';
import { ServersListGroup } from '../../src/servers/ServersListGroup';
describe('<ServersListGroup />', () => {
const servers = [

View File

@@ -1,7 +1,7 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { DuplicatedServersModal } from '../../../src/servers/helpers/DuplicatedServersModal';
import type { ServerData } from '../../../src/servers/data';
import { DuplicatedServersModal } from '../../../src/servers/helpers/DuplicatedServersModal';
import { renderWithEvents } from '../../__helpers__/setUpTest';
describe('<DuplicatedServersModal />', () => {

View File

@@ -1,12 +1,12 @@
import { fireEvent, screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { ServersMap, ServerWithId } from '../../../src/servers/data';
import type {
ImportServersBtnProps } from '../../../src/servers/helpers/ImportServersBtn';
import {
ImportServersBtn as createImportServersBtn,
} from '../../../src/servers/helpers/ImportServersBtn';
import type { ServersImporter } from '../../../src/servers/services/ServersImporter';
import type { ServersMap, ServerWithId } from '../../../src/servers/data';
import { renderWithEvents } from '../../__helpers__/setUpTest';
describe('<ImportServersBtn />', () => {

View File

@@ -1,8 +1,8 @@
import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import { ServerError as createServerError } from '../../../src/servers/helpers/ServerError';
import type { NonReachableServer, NotFoundServer } from '../../../src/servers/data';
import { ServerError as createServerError } from '../../../src/servers/helpers/ServerError';
describe('<ServerError />', () => {
const ServerError = createServerError(() => null);

View File

@@ -1,7 +1,7 @@
import { Mock } from 'ts-mockery';
import type { HttpClient } from '../../../src/common/services/HttpClient';
import { fetchServers } from '../../../src/servers/reducers/remoteServers';
import { createServers } from '../../../src/servers/reducers/servers';
import type { HttpClient } from '../../../src/common/services/HttpClient';
describe('remoteServersReducer', () => {
afterEach(jest.clearAllMocks);

View File

@@ -1,16 +1,16 @@
import { v4 as uuid } from 'uuid';
import { Mock } from 'ts-mockery';
import {
selectServer as selectServerCreator,
resetSelectedServer,
selectedServerReducerCreator,
selectServerListener,
MAX_FALLBACK_VERSION,
MIN_FALLBACK_VERSION,
} from '../../../src/servers/reducers/selectedServer';
import { v4 as uuid } from 'uuid';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkState } from '../../../src/container/types';
import type { NonReachableServer, NotFoundServer, ReachableServer, RegularServer } from '../../../src/servers/data';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import {
MAX_FALLBACK_VERSION,
MIN_FALLBACK_VERSION,
resetSelectedServer,
selectedServerReducerCreator,
selectServer as selectServerCreator,
selectServerListener,
} from '../../../src/servers/reducers/selectedServer';
describe('selectedServerReducer', () => {
const dispatch = jest.fn();

View File

@@ -1,13 +1,13 @@
import { dissoc, values } from 'ramda';
import { Mock } from 'ts-mockery';
import {
deleteServer,
createServers,
editServer,
setAutoConnect,
serversReducer,
} from '../../../src/servers/reducers/servers';
import type { RegularServer } from '../../../src/servers/data';
import {
createServers,
deleteServer,
editServer,
serversReducer,
setAutoConnect,
} from '../../../src/servers/reducers/servers';
describe('serversReducer', () => {
const list = {

View File

@@ -1,6 +1,6 @@
import { Mock } from 'ts-mockery';
import { ServersImporter } from '../../../src/servers/services/ServersImporter';
import type { RegularServer } from '../../../src/servers/data';
import { ServersImporter } from '../../../src/servers/services/ServersImporter';
describe('ServersImporter', () => {
const servers: RegularServer[] = [Mock.all<RegularServer>(), Mock.all<RegularServer>()];

View File

@@ -1,10 +1,10 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { RealTimeUpdatesSettings } from '../../src/settings/RealTimeUpdatesSettings';
import type {
RealTimeUpdatesSettings as RealTimeUpdatesSettingsOptions,
Settings,
} from '../../src/settings/reducers/settings';
import { RealTimeUpdatesSettings } from '../../src/settings/RealTimeUpdatesSettings';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<RealTimeUpdatesSettings />', () => {

View File

@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import { Router } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import { Router } from 'react-router-dom';
import { Settings as createSettings } from '../../src/settings/Settings';
describe('<Settings />', () => {

View File

@@ -1,6 +1,6 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { ShortUrlCreationSettings as ShortUrlsSettings, Settings } from '../../src/settings/reducers/settings';
import type { Settings, ShortUrlCreationSettings as ShortUrlsSettings } from '../../src/settings/reducers/settings';
import { ShortUrlCreationSettings } from '../../src/settings/ShortUrlCreationSettings';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,6 +1,6 @@
import { Mock } from 'ts-mockery';
import { migrateDeprecatedSettings } from '../../../src/settings/helpers';
import type { ShlinkState } from '../../../src/container/types';
import { migrateDeprecatedSettings } from '../../../src/settings/helpers';
describe('settings-helpers', () => {
describe('migrateDeprecatedSettings', () => {

View File

@@ -1,13 +1,13 @@
import {
DEFAULT_SHORT_URLS_ORDERING,
settingsReducer,
toggleRealTimeUpdates,
setRealTimeUpdatesInterval,
setShortUrlCreationSettings,
setShortUrlsListSettings,
setTagsSettings,
settingsReducer,
setUiSettings,
setVisitsSettings,
setTagsSettings,
setShortUrlsListSettings,
toggleRealTimeUpdates,
} from '../../../src/settings/reducers/settings';
describe('settingsReducer', () => {

View File

@@ -1,8 +1,8 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { Settings } from '../../src/settings/reducers/settings';
import { CreateShortUrl as createShortUrlsCreator } from '../../src/short-urls/CreateShortUrl';
import type { ShortUrlCreation } from '../../src/short-urls/reducers/shortUrlCreation';
import type { Settings } from '../../src/settings/reducers/settings';
describe('<CreateShortUrl />', () => {
const ShortUrlForm = () => <span>ShortUrlForm</span>;

View File

@@ -1,11 +1,11 @@
import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import { EditShortUrl as createEditShortUrl } from '../../src/short-urls/EditShortUrl';
import type { Settings } from '../../src/settings/reducers/settings';
import type { ShortUrl } from '../../src/short-urls/data';
import { EditShortUrl as createEditShortUrl } from '../../src/short-urls/EditShortUrl';
import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail';
import type { ShortUrlEdition } from '../../src/short-urls/reducers/shortUrlEdition';
import type { ShortUrl } from '../../src/short-urls/data';
describe('<EditShortUrl />', () => {
const shortUrlCreation = { validateUrls: true };

View File

@@ -1,8 +1,8 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import { Paginator } from '../../src/short-urls/Paginator';
import { Mock } from 'ts-mockery';
import type { ShlinkPaginator } from '../../src/api/types';
import { Paginator } from '../../src/short-urls/Paginator';
import { ELLIPSIS } from '../../src/utils/helpers/pagination';
describe('<Paginator />', () => {

View File

@@ -2,9 +2,9 @@ import { screen } from '@testing-library/react';
import type { UserEvent } from '@testing-library/user-event/setup/setup';
import { formatISO } from 'date-fns';
import { Mock } from 'ts-mockery';
import type { ReachableServer, SelectedServer } from '../../src/servers/data';
import type { Mode } from '../../src/short-urls/ShortUrlForm';
import { ShortUrlForm as createShortUrlForm } from '../../src/short-urls/ShortUrlForm';
import type { ReachableServer, SelectedServer } from '../../src/servers/data';
import { parseDate } from '../../src/utils/helpers/date';
import type { OptionalString } from '../../src/utils/utils';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,12 +1,12 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { endOfDay, formatISO, startOfDay } from 'date-fns';
import { MemoryRouter, useLocation, useNavigate } from 'react-router-dom';
import { ShortUrlsFilteringBar as filteringBarCreator } from '../../src/short-urls/ShortUrlsFilteringBar';
import { Mock } from 'ts-mockery';
import type { ReachableServer, SelectedServer } from '../../src/servers/data';
import type { Settings } from '../../src/settings/reducers/settings';
import type { DateRange } from '../../src/utils/helpers/dateIntervals';
import { ShortUrlsFilteringBar as filteringBarCreator } from '../../src/short-urls/ShortUrlsFilteringBar';
import { formatDate } from '../../src/utils/helpers/date';
import type { DateRange } from '../../src/utils/helpers/dateIntervals';
import { renderWithEvents } from '../__helpers__/setUpTest';
jest.mock('react-router-dom', () => ({

View File

@@ -1,15 +1,15 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter, useNavigate } from 'react-router-dom';
import { ShortUrlsList as createShortUrlsList } from '../../src/short-urls/ShortUrlsList';
import type { ShortUrl, ShortUrlsOrder } from '../../src/short-urls/data';
import { Mock } from 'ts-mockery';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { ShortUrlsList as ShortUrlsListModel } from '../../src/short-urls/reducers/shortUrlsList';
import type { ReachableServer } from '../../src/servers/data';
import type { Settings } from '../../src/settings/reducers/settings';
import type { ShortUrl, ShortUrlsOrder } from '../../src/short-urls/data';
import type { ShortUrlsList as ShortUrlsListModel } from '../../src/short-urls/reducers/shortUrlsList';
import { ShortUrlsList as createShortUrlsList } from '../../src/short-urls/ShortUrlsList';
import type { ShortUrlsTableType } from '../../src/short-urls/ShortUrlsTable';
import { renderWithEvents } from '../__helpers__/setUpTest';
import type { SemVer } from '../../src/utils/helpers/version';
import { renderWithEvents } from '../__helpers__/setUpTest';
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),

View File

@@ -1,10 +1,10 @@
import { fireEvent, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { ShortUrlsTable as shortUrlsTableCreator } from '../../src/short-urls/ShortUrlsTable';
import type { ShortUrlsList } from '../../src/short-urls/reducers/shortUrlsList';
import type { ReachableServer, SelectedServer } from '../../src/servers/data';
import type { ShortUrlsOrderableFields } from '../../src/short-urls/data';
import { SHORT_URLS_ORDERABLE_FIELDS } from '../../src/short-urls/data';
import type { ShortUrlsList } from '../../src/short-urls/reducers/shortUrlsList';
import { ShortUrlsTable as shortUrlsTableCreator } from '../../src/short-urls/ShortUrlsTable';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<ShortUrlsTable />', () => {

View File

@@ -1,10 +1,10 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { CreateShortUrlResult as createResult } from '../../../src/short-urls/helpers/CreateShortUrlResult';
import type { ShortUrl } from '../../../src/short-urls/data';
import { CreateShortUrlResult as createResult } from '../../../src/short-urls/helpers/CreateShortUrlResult';
import type { ShortUrlCreation } from '../../../src/short-urls/reducers/shortUrlCreation';
import type { TimeoutToggle } from '../../../src/utils/helpers/hooks';
import { renderWithEvents } from '../../__helpers__/setUpTest';
import type { ShortUrlCreation } from '../../../src/short-urls/reducers/shortUrlCreation';
describe('<CreateShortUrlResult />', () => {
const copyToClipboard = jest.fn();

View File

@@ -1,11 +1,11 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { DeleteShortUrlModal } from '../../../src/short-urls/helpers/DeleteShortUrlModal';
import type { ShortUrl } from '../../../src/short-urls/data';
import type { ShortUrlDeletion } from '../../../src/short-urls/reducers/shortUrlDeletion';
import { renderWithEvents } from '../../__helpers__/setUpTest';
import type { InvalidShortUrlDeletion, ProblemDetailsError } from '../../../src/api/types/errors';
import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors';
import type { ShortUrl } from '../../../src/short-urls/data';
import { DeleteShortUrlModal } from '../../../src/short-urls/helpers/DeleteShortUrlModal';
import type { ShortUrlDeletion } from '../../../src/short-urls/reducers/shortUrlDeletion';
import { renderWithEvents } from '../../__helpers__/setUpTest';
import { TestModalWrapper } from '../../__helpers__/TestModalWrapper';
describe('<DeleteShortUrlModal />', () => {

View File

@@ -1,9 +1,9 @@
import { Mock } from 'ts-mockery';
import { screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import type { ReportExporter } from '../../../src/common/services/ReportExporter';
import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/short-urls/helpers/ExportShortUrlsBtn';
import type { NotFoundServer, ReachableServer, SelectedServer } from '../../../src/servers/data';
import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/short-urls/helpers/ExportShortUrlsBtn';
import { renderWithEvents } from '../../__helpers__/setUpTest';
describe('<ExportShortUrlsBtn />', () => {

View File

@@ -1,10 +1,10 @@
import { fireEvent, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { QrCodeModal as createQrCodeModal } from '../../../src/short-urls/helpers/QrCodeModal';
import type { ShortUrl } from '../../../src/short-urls/data';
import type { ReachableServer } from '../../../src/servers/data';
import type { SemVer } from '../../../src/utils/helpers/version';
import type { ImageDownloader } from '../../../src/common/services/ImageDownloader';
import type { ReachableServer } from '../../../src/servers/data';
import type { ShortUrl } from '../../../src/short-urls/data';
import { QrCodeModal as createQrCodeModal } from '../../../src/short-urls/helpers/QrCodeModal';
import type { SemVer } from '../../../src/utils/helpers/version';
import { renderWithEvents } from '../../__helpers__/setUpTest';
describe('<QrCodeModal />', () => {

View File

@@ -1,10 +1,10 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import type { LinkSuffix } from '../../../src/short-urls/helpers/ShortUrlDetailLink';
import { ShortUrlDetailLink } from '../../../src/short-urls/helpers/ShortUrlDetailLink';
import { Mock } from 'ts-mockery';
import type { NotFoundServer, ReachableServer } from '../../../src/servers/data';
import type { ShortUrl } from '../../../src/short-urls/data';
import type { LinkSuffix } from '../../../src/short-urls/helpers/ShortUrlDetailLink';
import { ShortUrlDetailLink } from '../../../src/short-urls/helpers/ShortUrlDetailLink';
describe('<ShortUrlDetailLink />', () => {
it.each([

View File

@@ -1,8 +1,8 @@
import userEvent from '@testing-library/user-event';
import { render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { Mock } from 'ts-mockery';
import { ShortUrlStatus } from '../../../src/short-urls/helpers/ShortUrlStatus';
import type { ShortUrl, ShortUrlMeta, ShortUrlVisitsSummary } from '../../../src/short-urls/data';
import { ShortUrlStatus } from '../../../src/short-urls/helpers/ShortUrlStatus';
describe('<ShortUrlStatus />', () => {
const setUp = (shortUrl: ShortUrl) => ({

View File

@@ -1,8 +1,8 @@
import { render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { Mock } from 'ts-mockery';
import { ShortUrlVisitsCount } from '../../../src/short-urls/helpers/ShortUrlVisitsCount';
import type { ShortUrl } from '../../../src/short-urls/data';
import { ShortUrlVisitsCount } from '../../../src/short-urls/helpers/ShortUrlVisitsCount';
describe('<ShortUrlVisitsCount />', () => {
const setUp = (visitsCount: number, shortUrl: ShortUrl) => ({

View File

@@ -1,16 +1,16 @@
import { screen } from '@testing-library/react';
import { last } from 'ramda';
import { Mock } from 'ts-mockery';
import { addDays, formatISO, subDays } from 'date-fns';
import { last } from 'ramda';
import { MemoryRouter, useLocation } from 'react-router-dom';
import { ShortUrlsRow as createShortUrlsRow } from '../../../src/short-urls/helpers/ShortUrlsRow';
import type { TimeoutToggle } from '../../../src/utils/helpers/hooks';
import type { ShortUrl, ShortUrlMeta } from '../../../src/short-urls/data';
import type { Settings } from '../../../src/settings/reducers/settings';
import { Mock } from 'ts-mockery';
import type { ReachableServer } from '../../../src/servers/data';
import { parseDate, now } from '../../../src/utils/helpers/date';
import { renderWithEvents } from '../../__helpers__/setUpTest';
import type { Settings } from '../../../src/settings/reducers/settings';
import type { ShortUrl, ShortUrlMeta } from '../../../src/short-urls/data';
import { ShortUrlsRow as createShortUrlsRow } from '../../../src/short-urls/helpers/ShortUrlsRow';
import { now, parseDate } from '../../../src/utils/helpers/date';
import type { TimeoutToggle } from '../../../src/utils/helpers/hooks';
import type { OptionalString } from '../../../src/utils/utils';
import { renderWithEvents } from '../../__helpers__/setUpTest';
import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock';
interface SetUpOptions {

View File

@@ -1,9 +1,9 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../src/short-urls/helpers/ShortUrlsRowMenu';
import { Mock } from 'ts-mockery';
import type { ReachableServer } from '../../../src/servers/data';
import type { ShortUrl } from '../../../src/short-urls/data';
import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../src/short-urls/helpers/ShortUrlsRowMenu';
import { renderWithEvents } from '../../__helpers__/setUpTest';
describe('<ShortUrlsRowMenu />', () => {

View File

@@ -1,6 +1,6 @@
import { screen } from '@testing-library/react';
import type { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes';
import { QrErrorCorrectionDropdown } from '../../../../src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown';
import type { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes';
import { renderWithEvents } from '../../../__helpers__/setUpTest';
describe('<QrErrorCorrectionDropdown />', () => {

View File

@@ -1,6 +1,6 @@
import { screen } from '@testing-library/react';
import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes';
import { QrFormatDropdown } from '../../../../src/short-urls/helpers/qr-codes/QrFormatDropdown';
import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes';
import { renderWithEvents } from '../../../__helpers__/setUpTest';
describe('<QrFormatDropdown />', () => {

View File

@@ -1,13 +1,13 @@
import { Mock } from 'ts-mockery';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkState } from '../../../src/container/types';
import type { ShortUrl } from '../../../src/short-urls/data';
import type {
CreateShortUrlAction } from '../../../src/short-urls/reducers/shortUrlCreation';
import {
shortUrlCreationReducerCreator,
createShortUrl as createShortUrlCreator,
shortUrlCreationReducerCreator,
} from '../../../src/short-urls/reducers/shortUrlCreation';
import type { ShortUrl } from '../../../src/short-urls/data';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkState } from '../../../src/container/types';
describe('shortUrlCreationReducer', () => {
const shortUrl = Mock.of<ShortUrl>();

View File

@@ -1,10 +1,10 @@
import { Mock } from 'ts-mockery';
import {
shortUrlDeletionReducerCreator,
deleteShortUrl as deleteShortUrlCretor,
} from '../../../src/short-urls/reducers/shortUrlDeletion';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ProblemDetailsError } from '../../../src/api/types/errors';
import {
deleteShortUrl as deleteShortUrlCretor,
shortUrlDeletionReducerCreator,
} from '../../../src/short-urls/reducers/shortUrlDeletion';
describe('shortUrlDeletionReducer', () => {
const deleteShortUrlCall = jest.fn();

View File

@@ -1,9 +1,9 @@
import { Mock } from 'ts-mockery';
import type { ShortUrlDetailAction } from '../../../src/short-urls/reducers/shortUrlDetail';
import { shortUrlDetailReducerCreator } from '../../../src/short-urls/reducers/shortUrlDetail';
import type { ShortUrl } from '../../../src/short-urls/data';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkState } from '../../../src/container/types';
import type { ShortUrl } from '../../../src/short-urls/data';
import type { ShortUrlDetailAction } from '../../../src/short-urls/reducers/shortUrlDetail';
import { shortUrlDetailReducerCreator } from '../../../src/short-urls/reducers/shortUrlDetail';
import type { ShortUrlsList } from '../../../src/short-urls/reducers/shortUrlsList';
describe('shortUrlDetailReducer', () => {

View File

@@ -1,13 +1,13 @@
import { Mock } from 'ts-mockery';
import type { ShlinkState } from '../../../src/container/types';
import type { SelectedServer } from '../../../src/servers/data';
import type { ShortUrl } from '../../../src/short-urls/data';
import type {
ShortUrlEditedAction } from '../../../src/short-urls/reducers/shortUrlEdition';
import {
shortUrlEditionReducerCreator,
editShortUrl as editShortUrlCreator,
shortUrlEditionReducerCreator,
} from '../../../src/short-urls/reducers/shortUrlEdition';
import type { ShlinkState } from '../../../src/container/types';
import type { ShortUrl } from '../../../src/short-urls/data';
import type { SelectedServer } from '../../../src/servers/data';
describe('shortUrlEditionReducer', () => {
const longUrl = 'https://shlink.io';

View File

@@ -1,15 +1,15 @@
import { Mock } from 'ts-mockery';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkPaginator, ShlinkShortUrlsResponse } from '../../../src/api/types';
import type { ShortUrl } from '../../../src/short-urls/data';
import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation';
import { shortUrlDeleted } from '../../../src/short-urls/reducers/shortUrlDeletion';
import { editShortUrl as editShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlEdition';
import {
listShortUrls as listShortUrlsCreator,
shortUrlsListReducerCreator,
} from '../../../src/short-urls/reducers/shortUrlsList';
import { shortUrlDeleted } from '../../../src/short-urls/reducers/shortUrlDeletion';
import type { ShlinkPaginator, ShlinkShortUrlsResponse } from '../../../src/api/types';
import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation';
import { editShortUrl as editShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlEdition';
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
import type { ShortUrl } from '../../../src/short-urls/data';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
describe('shortUrlsListReducer', () => {
const shortCode = 'abc123';

View File

@@ -1,11 +1,11 @@
import { screen, waitFor } from '@testing-library/react';
import { identity } from 'ramda';
import { Mock } from 'ts-mockery';
import type { TagsListProps } from '../../src/tags/TagsList';
import { TagsList as createTagsList } from '../../src/tags/TagsList';
import type { TagsList } from '../../src/tags/reducers/tagsList';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { Settings } from '../../src/settings/reducers/settings';
import type { TagsList } from '../../src/tags/reducers/tagsList';
import type { TagsListProps } from '../../src/tags/TagsList';
import { TagsList as createTagsList } from '../../src/tags/TagsList';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<TagsList />', () => {

View File

@@ -1,10 +1,10 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { useLocation } from 'react-router-dom';
import { TagsTable as createTagsTable } from '../../src/tags/TagsTable';
import { Mock } from 'ts-mockery';
import type { SelectedServer } from '../../src/servers/data';
import { rangeOf } from '../../src/utils/utils';
import type { NormalizedTag } from '../../src/tags/data';
import { TagsTable as createTagsTable } from '../../src/tags/TagsTable';
import { rangeOf } from '../../src/utils/utils';
import { renderWithEvents } from '../__helpers__/setUpTest';
jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useLocation: jest.fn() }));

View File

@@ -1,8 +1,8 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { MemoryRouter } from 'react-router-dom';
import { TagsTableRow as createTagsTableRow } from '../../src/tags/TagsTableRow';
import { Mock } from 'ts-mockery';
import type { ReachableServer } from '../../src/servers/data';
import { TagsTableRow as createTagsTableRow } from '../../src/tags/TagsTableRow';
import { renderWithEvents } from '../__helpers__/setUpTest';
import { colorGeneratorMock } from '../utils/services/__mocks__/ColorGenerator.mock';

View File

@@ -1,10 +1,10 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { TagEdition } from '../../../src/tags/reducers/tagEdit';
import type { ProblemDetailsError } from '../../../src/api/types/errors';
import { EditTagModal as createEditTagModal } from '../../../src/tags/helpers/EditTagModal';
import type { TagEdition } from '../../../src/tags/reducers/tagEdit';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
import { renderWithEvents } from '../../__helpers__/setUpTest';
import type { ProblemDetailsError } from '../../../src/api/types/errors';
describe('<EditTagModal />', () => {
const EditTagModal = createEditTagModal(Mock.of<ColorGenerator>({ getColorForKey: jest.fn(() => 'green') }));

View File

@@ -1,9 +1,9 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { ReactNode } from 'react';
import { Mock } from 'ts-mockery';
import { Tag } from '../../../src/tags/helpers/Tag';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
import { MAIN_COLOR } from '../../../src/utils/theme';
import { Tag } from '../../../src/tags/helpers/Tag';
import { renderWithEvents } from '../../__helpers__/setUpTest';
const hexToRgb = (hex: string) => {

View File

@@ -1,8 +1,8 @@
import { screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { Settings } from '../../../src/settings/reducers/settings';
import { TagsSelector as createTagsSelector } from '../../../src/tags/helpers/TagsSelector';
import type { TagsList } from '../../../src/tags/reducers/tagsList';
import type { Settings } from '../../../src/settings/reducers/settings';
import { renderWithEvents } from '../../__helpers__/setUpTest';
import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock';

View File

@@ -1,7 +1,7 @@
import { Mock } from 'ts-mockery';
import { tagDeleted, tagDeleteReducerCreator } from '../../../src/tags/reducers/tagDelete';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkState } from '../../../src/container/types';
import { tagDeleted, tagDeleteReducerCreator } from '../../../src/tags/reducers/tagDelete';
describe('tagDeleteReducer', () => {
const deleteTagsCall = jest.fn();

View File

@@ -1,9 +1,9 @@
import { Mock } from 'ts-mockery';
import type { EditTagAction } from '../../../src/tags/reducers/tagEdit';
import { tagEdited, editTag as editTagCreator, tagEditReducerCreator } from '../../../src/tags/reducers/tagEdit';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
import type { ShlinkState } from '../../../src/container/types';
import type { EditTagAction } from '../../../src/tags/reducers/tagEdit';
import { editTag as editTagCreator, tagEdited, tagEditReducerCreator } from '../../../src/tags/reducers/tagEdit';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
describe('tagEditReducer', () => {
const oldName = 'foo';

View File

@@ -1,4 +1,9 @@
import { Mock } from 'ts-mockery';
import type { ShlinkState } from '../../../src/container/types';
import type { ShortUrl } from '../../../src/short-urls/data';
import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation';
import { tagDeleted } from '../../../src/tags/reducers/tagDelete';
import { tagEdited } from '../../../src/tags/reducers/tagEdit';
import type {
TagsList } from '../../../src/tags/reducers/tagsList';
import {
@@ -6,11 +11,6 @@ import {
listTags as listTagsCreator,
tagsListReducerCreator,
} from '../../../src/tags/reducers/tagsList';
import type { ShlinkState } from '../../../src/container/types';
import type { ShortUrl } from '../../../src/short-urls/data';
import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation';
import { tagEdited } from '../../../src/tags/reducers/tagEdit';
import { tagDeleted } from '../../../src/tags/reducers/tagDelete';
describe('tagsListReducer', () => {
const state = (props: Partial<TagsList>) => Mock.of<TagsList>(props);

View File

@@ -1,5 +1,5 @@
import { screen, waitFor } from '@testing-library/react';
import type { Placement } from '@popperjs/core';
import { screen, waitFor } from '@testing-library/react';
import type { InfoTooltipProps } from '../../src/utils/InfoTooltip';
import { InfoTooltip } from '../../src/utils/InfoTooltip';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,8 +1,8 @@
import { screen } from '@testing-library/react';
import { values } from 'ramda';
import type { OrderDir } from '../../src/utils/helpers/ordering';
import type { OrderingDropdownProps } from '../../src/utils/OrderingDropdown';
import { OrderingDropdown } from '../../src/utils/OrderingDropdown';
import type { OrderDir } from '../../src/utils/helpers/ordering';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<OrderingDropdown />', () => {

View File

@@ -1,6 +1,6 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { parseISO } from 'date-fns';
import { Mock } from 'ts-mockery';
import type { DateInputProps } from '../../../src/utils/dates/DateInput';
import { DateInput } from '../../../src/utils/dates/DateInput';
import { renderWithEvents } from '../../__helpers__/setUpTest';

View File

@@ -1,8 +1,8 @@
import { screen, waitFor } from '@testing-library/react';
import { DateIntervalDropdownItems } from '../../../src/utils/dates/DateIntervalDropdownItems';
import { DropdownBtn } from '../../../src/utils/DropdownBtn';
import type { DateInterval } from '../../../src/utils/helpers/dateIntervals';
import { DATE_INTERVALS, rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals';
import { DropdownBtn } from '../../../src/utils/DropdownBtn';
import { renderWithEvents } from '../../__helpers__/setUpTest';
describe('<DateIntervalDropdownItems />', () => {

View File

@@ -1,7 +1,7 @@
import { screen, waitFor } from '@testing-library/react';
import { DateIntervalSelector } from '../../../src/utils/dates/DateIntervalSelector';
import type { DateInterval } from '../../../src/utils/helpers/dateIntervals';
import { rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals';
import { DateIntervalSelector } from '../../../src/utils/dates/DateIntervalSelector';
import { renderWithEvents } from '../../__helpers__/setUpTest';
describe('<DateIntervalSelector />', () => {

View File

@@ -1,4 +1,5 @@
import { endOfDay, format, formatISO, startOfDay, subDays } from 'date-fns';
import { now, parseDate } from '../../../src/utils/helpers/date';
import type {
DateInterval } from '../../../src/utils/helpers/dateIntervals';
import {
@@ -9,7 +10,6 @@ import {
rangeOrIntervalToString,
toDateRange,
} from '../../../src/utils/helpers/dateIntervals';
import { parseDate, now } from '../../../src/utils/helpers/date';
describe('date-types', () => {
const daysBack = (days: number) => subDays(now(), days);

View File

@@ -1,6 +1,6 @@
import L from 'leaflet';
import marker2x from 'leaflet/dist/images/marker-icon-2x.png';
import marker from 'leaflet/dist/images/marker-icon.png';
import marker2x from 'leaflet/dist/images/marker-icon-2x.png';
import markerShadow from 'leaflet/dist/images/marker-shadow.png';
import { fixLeafletIcons } from '../../../src/utils/helpers/leaflet';

View File

@@ -1,6 +1,6 @@
import { render } from '@testing-library/react';
import { TableOrderIcon } from '../../../src/utils/table/TableOrderIcon';
import type { OrderDir } from '../../../src/utils/helpers/ordering';
import { TableOrderIcon } from '../../../src/utils/table/TableOrderIcon';
describe('<TableOrderIcon />', () => {
const setUp = (field: string, currentDir?: OrderDir, className?: string) => render(

View File

@@ -1,12 +1,12 @@
import { screen } from '@testing-library/react';
import { formatISO } from 'date-fns';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import { formatISO } from 'date-fns';
import { DomainVisits as createDomainVisits } from '../../src/visits/DomainVisits';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { DomainVisits } from '../../src/visits/reducers/domainVisits';
import type { Settings } from '../../src/settings/reducers/settings';
import { DomainVisits as createDomainVisits } from '../../src/visits/DomainVisits';
import type { DomainVisits } from '../../src/visits/reducers/domainVisits';
import type { Visit } from '../../src/visits/types';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,14 +1,14 @@
import { screen } from '@testing-library/react';
import { formatISO } from 'date-fns';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import { formatISO } from 'date-fns';
import { NonOrphanVisits as createNonOrphanVisits } from '../../src/visits/NonOrphanVisits';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { Visit } from '../../src/visits/types';
import type { Settings } from '../../src/settings/reducers/settings';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import { renderWithEvents } from '../__helpers__/setUpTest';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { Settings } from '../../src/settings/reducers/settings';
import { NonOrphanVisits as createNonOrphanVisits } from '../../src/visits/NonOrphanVisits';
import type { VisitsInfo } from '../../src/visits/reducers/types';
import type { Visit } from '../../src/visits/types';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<NonOrphanVisits />', () => {
const exportVisits = jest.fn();

View File

@@ -1,14 +1,14 @@
import { screen } from '@testing-library/react';
import { formatISO } from 'date-fns';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import { formatISO } from 'date-fns';
import { OrphanVisits as createOrphanVisits } from '../../src/visits/OrphanVisits';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { Visit } from '../../src/visits/types';
import type { Settings } from '../../src/settings/reducers/settings';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import { renderWithEvents } from '../__helpers__/setUpTest';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { Settings } from '../../src/settings/reducers/settings';
import { OrphanVisits as createOrphanVisits } from '../../src/visits/OrphanVisits';
import type { VisitsInfo } from '../../src/visits/reducers/types';
import type { Visit } from '../../src/visits/types';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<OrphanVisits />', () => {
const getOrphanVisits = jest.fn();

View File

@@ -1,16 +1,16 @@
import { screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import { identity } from 'ramda';
import { Mock } from 'ts-mockery';
import { formatISO } from 'date-fns';
import { identity } from 'ramda';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { Settings } from '../../src/settings/reducers/settings';
import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail';
import type { ShortUrlVisits as ShortUrlVisitsState } from '../../src/visits/reducers/shortUrlVisits';
import type { ShortUrlVisitsProps } from '../../src/visits/ShortUrlVisits';
import { ShortUrlVisits as createShortUrlVisits } from '../../src/visits/ShortUrlVisits';
import type { ShortUrlVisits as ShortUrlVisitsState } from '../../src/visits/reducers/shortUrlVisits';
import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import type { Visit } from '../../src/visits/types';
import type { Settings } from '../../src/settings/reducers/settings';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<ShortUrlVisits />', () => {

View File

@@ -1,9 +1,9 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { formatDistance, parseISO } from 'date-fns';
import { ShortUrlVisitsHeader } from '../../src/visits/ShortUrlVisitsHeader';
import { Mock } from 'ts-mockery';
import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail';
import type { ShortUrlVisits } from '../../src/visits/reducers/shortUrlVisits';
import { ShortUrlVisitsHeader } from '../../src/visits/ShortUrlVisitsHeader';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<ShortUrlVisitsHeader />', () => {

View File

@@ -2,14 +2,14 @@ import { screen } from '@testing-library/react';
import { formatISO } from 'date-fns';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import type { TagVisitsProps } from '../../src/visits/TagVisits';
import { TagVisits as createTagVisits } from '../../src/visits/TagVisits';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { Settings } from '../../src/settings/reducers/settings';
import type { ColorGenerator } from '../../src/utils/services/ColorGenerator';
import type { TagVisits as TagVisitsStats } from '../../src/visits/reducers/tagVisits';
import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import type { TagVisitsProps } from '../../src/visits/TagVisits';
import { TagVisits as createTagVisits } from '../../src/visits/TagVisits';
import type { Visit } from '../../src/visits/types';
import type { Settings } from '../../src/settings/reducers/settings';
import { renderWithEvents } from '../__helpers__/setUpTest';
jest.mock('react-router-dom', () => ({

View File

@@ -1,8 +1,8 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { TagVisitsHeader } from '../../src/visits/TagVisitsHeader';
import type { TagVisits } from '../../src/visits/reducers/tagVisits';
import type { ColorGenerator } from '../../src/utils/services/ColorGenerator';
import type { TagVisits } from '../../src/visits/reducers/tagVisits';
import { TagVisitsHeader } from '../../src/visits/TagVisitsHeader';
describe('<TagVisitsHeader />', () => {
const tagVisits = Mock.of<TagVisits>({

View File

@@ -1,7 +1,7 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { VisitsHeader } from '../../src/visits/VisitsHeader';
import type { Visit } from '../../src/visits/types';
import { VisitsHeader } from '../../src/visits/VisitsHeader';
describe('<VisitsHeader />', () => {
const visits = [Mock.all<Visit>(), Mock.all<Visit>(), Mock.all<Visit>()];

View File

@@ -1,13 +1,13 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import { Router } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import { VisitsStats } from '../../src/visits/VisitsStats';
import type { Visit } from '../../src/visits/types';
import { Router } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import type { Settings } from '../../src/settings/reducers/settings';
import { renderWithEvents } from '../__helpers__/setUpTest';
import { rangeOf } from '../../src/utils/utils';
import type { VisitsInfo } from '../../src/visits/reducers/types';
import type { Visit } from '../../src/visits/types';
import { VisitsStats } from '../../src/visits/VisitsStats';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<VisitsStats />', () => {
const visits = rangeOf(3, () => Mock.of<Visit>({ date: '2020-01-01' }));

View File

@@ -1,9 +1,9 @@
import { screen, waitFor } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { VisitsTableProps } from '../../src/visits/VisitsTable';
import { VisitsTable } from '../../src/visits/VisitsTable';
import { rangeOf } from '../../src/utils/utils';
import type { NormalizedVisit } from '../../src/visits/types';
import type { VisitsTableProps } from '../../src/visits/VisitsTable';
import { VisitsTable } from '../../src/visits/VisitsTable';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<VisitsTable />', () => {

View File

@@ -1,5 +1,5 @@
import type { ReactNode } from 'react';
import { render, screen } from '@testing-library/react';
import type { ReactNode } from 'react';
import { ChartCard } from '../../../src/visits/charts/ChartCard';
describe('<ChartCard />', () => {

View File

@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import { Mock } from 'ts-mockery';
import type { Chart, ChartDataset } from 'chart.js';
import { Mock } from 'ts-mockery';
import { DoughnutChartLegend } from '../../../src/visits/charts/DoughnutChartLegend';
describe('<DoughnutChartLegend />', () => {

View File

@@ -1,9 +1,9 @@
import type { ReactNode } from 'react';
import { screen } from '@testing-library/react';
import { range } from 'ramda';
import type { ReactNode } from 'react';
import { rangeOf } from '../../../src/utils/utils';
import type { Stats } from '../../../src/visits/types';
import { SortableBarChartCard } from '../../../src/visits/charts/SortableBarChartCard';
import type { Stats } from '../../../src/visits/types';
import { renderWithEvents } from '../../__helpers__/setUpTest';
describe('<SortableBarChartCard />', () => {

View File

@@ -1,6 +1,6 @@
import { screen } from '@testing-library/react';
import type { OrphanVisitType, VisitsFilter } from '../../../src/visits/types';
import { VisitsFilterDropdown } from '../../../src/visits/helpers/VisitsFilterDropdown';
import type { OrphanVisitType, VisitsFilter } from '../../../src/visits/types';
import { renderWithEvents } from '../../__helpers__/setUpTest';
describe('<VisitsFilterDropdown />', () => {

View File

@@ -1,21 +1,21 @@
import { Mock } from 'ts-mockery';
import { addDays, formatISO, subDays } from 'date-fns';
import { Mock } from 'ts-mockery';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkVisits } from '../../../src/api/types';
import type { ShlinkState } from '../../../src/container/types';
import type { ShortUrl } from '../../../src/short-urls/data';
import { formatIsoDate } from '../../../src/utils/helpers/date';
import type { DateInterval } from '../../../src/utils/helpers/dateIntervals';
import { rangeOf } from '../../../src/utils/utils';
import type {
DomainVisits } from '../../../src/visits/reducers/domainVisits';
import {
getDomainVisits as getDomainVisitsCreator,
DEFAULT_DOMAIN,
domainVisitsReducerCreator,
getDomainVisits as getDomainVisitsCreator,
} from '../../../src/visits/reducers/domainVisits';
import { rangeOf } from '../../../src/utils/utils';
import type { Visit } from '../../../src/visits/types';
import type { ShlinkVisits } from '../../../src/api/types';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkState } from '../../../src/container/types';
import { formatIsoDate } from '../../../src/utils/helpers/date';
import type { DateInterval } from '../../../src/utils/helpers/dateIntervals';
import type { ShortUrl } from '../../../src/short-urls/data';
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
import type { Visit } from '../../../src/visits/types';
describe('domainVisitsReducer', () => {
const now = new Date();

View File

@@ -1,18 +1,18 @@
import { Mock } from 'ts-mockery';
import { addDays, formatISO, subDays } from 'date-fns';
import { Mock } from 'ts-mockery';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkVisits } from '../../../src/api/types';
import type { ShlinkState } from '../../../src/container/types';
import { formatIsoDate } from '../../../src/utils/helpers/date';
import type { DateInterval } from '../../../src/utils/helpers/dateIntervals';
import { rangeOf } from '../../../src/utils/utils';
import {
getNonOrphanVisits as getNonOrphanVisitsCreator,
nonOrphanVisitsReducerCreator,
} from '../../../src/visits/reducers/nonOrphanVisits';
import { rangeOf } from '../../../src/utils/utils';
import type { Visit } from '../../../src/visits/types';
import type { ShlinkVisits } from '../../../src/api/types';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkState } from '../../../src/container/types';
import { formatIsoDate } from '../../../src/utils/helpers/date';
import type { DateInterval } from '../../../src/utils/helpers/dateIntervals';
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
import type { VisitsInfo } from '../../../src/visits/reducers/types';
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
import type { Visit } from '../../../src/visits/types';
describe('nonOrphanVisitsReducer', () => {
const now = new Date();

View File

@@ -1,18 +1,18 @@
import { Mock } from 'ts-mockery';
import { addDays, formatISO, subDays } from 'date-fns';
import { Mock } from 'ts-mockery';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkVisits } from '../../../src/api/types';
import type { ShlinkState } from '../../../src/container/types';
import { formatIsoDate } from '../../../src/utils/helpers/date';
import type { DateInterval } from '../../../src/utils/helpers/dateIntervals';
import { rangeOf } from '../../../src/utils/utils';
import {
getOrphanVisits as getOrphanVisitsCreator,
orphanVisitsReducerCreator,
} from '../../../src/visits/reducers/orphanVisits';
import { rangeOf } from '../../../src/utils/utils';
import type { Visit } from '../../../src/visits/types';
import type { ShlinkVisits } from '../../../src/api/types';
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { ShlinkState } from '../../../src/container/types';
import { formatIsoDate } from '../../../src/utils/helpers/date';
import type { DateInterval } from '../../../src/utils/helpers/dateIntervals';
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
import type { VisitsInfo } from '../../../src/visits/reducers/types';
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
import type { Visit } from '../../../src/visits/types';
describe('orphanVisitsReducer', () => {
const now = new Date();

Some files were not shown because too many files have changed in this diff Show More