mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-21 05:56:20 +00:00
Extract shlink-web-component outside of src folder
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShortUrl, ShortUrlsOrder } from '../../../shlink-web-component/short-urls/data';
|
||||
import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkDomain, ShlinkVisits, ShlinkVisitsOverview } from '../../../src/api/types';
|
||||
import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors';
|
||||
import type { HttpClient } from '../../../src/common/services/HttpClient';
|
||||
import type { ShortUrl, ShortUrlsOrder } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import type { OptionalString } from '../../../src/utils/utils';
|
||||
|
||||
describe('ShlinkApiClient', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ExportableShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import type { NormalizedVisit } from '../../../shlink-web-component/visits/types';
|
||||
import { ReportExporter } from '../../../src/common/services/ReportExporter';
|
||||
import type { ExportableShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import type { NormalizedVisit } from '../../../src/shlink-web-component/visits/types';
|
||||
import { windowMock } from '../../__mocks__/Window.mock';
|
||||
|
||||
describe('ReportExporter', () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { Domain } from '../../shlink-web-component/domains/data';
|
||||
import { DomainRow } from '../../shlink-web-component/domains/DomainRow';
|
||||
import type { ShlinkDomainRedirects } from '../../src/api/types';
|
||||
import type { Domain } from '../../src/shlink-web-component/domains/data';
|
||||
import { DomainRow } from '../../src/shlink-web-component/domains/DomainRow';
|
||||
|
||||
describe('<DomainRow />', () => {
|
||||
const redirectsCombinations = [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { DomainSelector } from '../../src/shlink-web-component/domains/DomainSelector';
|
||||
import type { DomainsList } from '../../src/shlink-web-component/domains/reducers/domainsList';
|
||||
import { DomainSelector } from '../../shlink-web-component/domains/DomainSelector';
|
||||
import type { DomainsList } from '../../shlink-web-component/domains/reducers/domainsList';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<DomainSelector />', () => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { ManageDomains } from '../../shlink-web-component/domains/ManageDomains';
|
||||
import type { DomainsList } from '../../shlink-web-component/domains/reducers/domainsList';
|
||||
import type { ShlinkDomain } from '../../src/api/types';
|
||||
import type { ProblemDetailsError } from '../../src/api/types/errors';
|
||||
import { ManageDomains } from '../../src/shlink-web-component/domains/ManageDomains';
|
||||
import type { DomainsList } from '../../src/shlink-web-component/domains/reducers/domainsList';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<ManageDomains />', () => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { screen, waitForElementToBeRemoved } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { Domain } from '../../../shlink-web-component/domains/data';
|
||||
import { DomainDropdown } from '../../../shlink-web-component/domains/helpers/DomainDropdown';
|
||||
import type { SelectedServer } from '../../../src/servers/data';
|
||||
import type { Domain } from '../../../src/shlink-web-component/domains/data';
|
||||
import { DomainDropdown } from '../../../src/shlink-web-component/domains/helpers/DomainDropdown';
|
||||
import type { SemVer } from '../../../src/utils/helpers/version';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { DomainStatus } from '../../../src/shlink-web-component/domains/data';
|
||||
import { DomainStatusIcon } from '../../../src/shlink-web-component/domains/helpers/DomainStatusIcon';
|
||||
import type { DomainStatus } from '../../../shlink-web-component/domains/data';
|
||||
import { DomainStatusIcon } from '../../../shlink-web-component/domains/helpers/DomainStatusIcon';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<DomainStatusIcon />', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fireEvent, screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { EditDomainRedirectsModal } from '../../../shlink-web-component/domains/helpers/EditDomainRedirectsModal';
|
||||
import type { ShlinkDomain } from '../../../src/api/types';
|
||||
import { EditDomainRedirectsModal } from '../../../src/shlink-web-component/domains/helpers/EditDomainRedirectsModal';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<EditDomainRedirectsModal />', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { editDomainRedirects } from '../../../shlink-web-component/domains/reducers/domainRedirects';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkDomainRedirects } from '../../../src/api/types';
|
||||
import { editDomainRedirects } from '../../../src/shlink-web-component/domains/reducers/domainRedirects';
|
||||
|
||||
describe('domainRedirectsReducer', () => {
|
||||
describe('editDomainRedirects', () => {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
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/shlink-web-component/domains/data';
|
||||
import type { EditDomainRedirects } from '../../../src/shlink-web-component/domains/reducers/domainRedirects';
|
||||
import { editDomainRedirects } from '../../../src/shlink-web-component/domains/reducers/domainRedirects';
|
||||
import type { Domain } from '../../../shlink-web-component/domains/data';
|
||||
import type { EditDomainRedirects } from '../../../shlink-web-component/domains/reducers/domainRedirects';
|
||||
import { editDomainRedirects } from '../../../shlink-web-component/domains/reducers/domainRedirects';
|
||||
import {
|
||||
domainsListReducerCreator,
|
||||
replaceRedirectsOnDomain,
|
||||
replaceStatusOnDomain,
|
||||
} from '../../../src/shlink-web-component/domains/reducers/domainsList';
|
||||
} from '../../../shlink-web-component/domains/reducers/domainsList';
|
||||
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';
|
||||
|
||||
describe('domainsListReducer', () => {
|
||||
const dispatch = vi.fn();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { EventSourcePolyfill } from 'event-source-polyfill';
|
||||
import { identity } from 'ramda';
|
||||
import { bindToMercureTopic } from '../../../src/shlink-web-component/mercure/helpers';
|
||||
import type { MercureInfo } from '../../../src/shlink-web-component/mercure/reducers/mercureInfo';
|
||||
import { bindToMercureTopic } from '../../../shlink-web-component/mercure/helpers';
|
||||
import type { MercureInfo } from '../../../shlink-web-component/mercure/reducers/mercureInfo';
|
||||
|
||||
vi.mock('event-source-polyfill');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { mercureInfoReducerCreator } from '../../../shlink-web-component/mercure/reducers/mercureInfo';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { GetState } from '../../../src/container/types';
|
||||
import { mercureInfoReducerCreator } from '../../../src/shlink-web-component/mercure/reducers/mercureInfo';
|
||||
|
||||
describe('mercureInfoReducer', () => {
|
||||
const mercureInfo = {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { MercureInfo } from '../../src/shlink-web-component/mercure/reducers/mercureInfo';
|
||||
import { Overview as overviewCreator } from '../../src/shlink-web-component/overview/Overview';
|
||||
import type { MercureInfo } from '../../shlink-web-component/mercure/reducers/mercureInfo';
|
||||
import { Overview as overviewCreator } from '../../shlink-web-component/overview/Overview';
|
||||
import { prettify } from '../../src/utils/helpers/numbers';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { HighlightCardProps } from '../../../src/shlink-web-component/overview/helpers/HighlightCard';
|
||||
import { HighlightCard } from '../../../src/shlink-web-component/overview/helpers/HighlightCard';
|
||||
import type { HighlightCardProps } from '../../../shlink-web-component/overview/helpers/HighlightCard';
|
||||
import { HighlightCard } from '../../../shlink-web-component/overview/helpers/HighlightCard';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<HighlightCard />', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import type { VisitsHighlightCardProps } from '../../../src/shlink-web-component/overview/helpers/VisitsHighlightCard';
|
||||
import { VisitsHighlightCard } from '../../../src/shlink-web-component/overview/helpers/VisitsHighlightCard';
|
||||
import type { VisitsHighlightCardProps } from '../../../shlink-web-component/overview/helpers/VisitsHighlightCard';
|
||||
import { VisitsHighlightCard } from '../../../shlink-web-component/overview/helpers/VisitsHighlightCard';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<VisitsHighlightCard />', () => {
|
||||
|
||||
@@ -2,14 +2,13 @@ import { fromPartial } from '@total-typescript/shoehorn';
|
||||
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 { NonReachableServer, NotFoundServer, RegularServer } from '../../../src/servers/data';
|
||||
import {
|
||||
MAX_FALLBACK_VERSION,
|
||||
MIN_FALLBACK_VERSION,
|
||||
resetSelectedServer,
|
||||
selectedServerReducerCreator,
|
||||
selectServer as selectServerCreator,
|
||||
selectServerListener,
|
||||
} from '../../../src/servers/reducers/selectedServer';
|
||||
|
||||
describe('selectedServerReducer', () => {
|
||||
@@ -85,34 +84,4 @@ describe('selectedServerReducer', () => {
|
||||
expect(dispatch).toHaveBeenLastCalledWith(expect.objectContaining({ payload: expectedSelectedServer }));
|
||||
});
|
||||
});
|
||||
|
||||
describe('selectServerListener', () => {
|
||||
const getState = vi.fn(() => ({}));
|
||||
const loadMercureInfo = vi.fn();
|
||||
const { middleware } = selectServerListener(selectServer, loadMercureInfo);
|
||||
|
||||
it.each([
|
||||
[fromPartial<ReachableServer>({ version: '1.2.3' }), 1],
|
||||
[fromPartial<NotFoundServer>({ serverNotFound: true }), 0],
|
||||
[fromPartial<NonReachableServer>({ serverNotReachable: true }), 0],
|
||||
])('dispatches loadMercureInfo when provided server is reachable', (payload, expectedCalls) => {
|
||||
middleware({ dispatch, getState })(vi.fn())({
|
||||
payload,
|
||||
type: selectServer.fulfilled.toString(),
|
||||
});
|
||||
|
||||
expect(dispatch).toHaveBeenCalledTimes(expectedCalls);
|
||||
expect(loadMercureInfo).toHaveBeenCalledTimes(expectedCalls);
|
||||
});
|
||||
|
||||
it('does not dispatch loadMercureInfo when action is not of the proper type', () => {
|
||||
middleware({ dispatch, getState })(vi.fn())({
|
||||
payload: fromPartial<ReachableServer>({ version: '1.2.3' }),
|
||||
type: 'something_else',
|
||||
});
|
||||
|
||||
expect(dispatch).not.toHaveBeenCalled();
|
||||
expect(loadMercureInfo).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShortUrlsOrder } from '../../shlink-web-component/short-urls/data';
|
||||
import type { ShortUrlsListSettings as ShortUrlsSettings } from '../../src/settings/reducers/settings';
|
||||
import { ShortUrlsListSettings } from '../../src/settings/ShortUrlsListSettings';
|
||||
import type { ShortUrlsOrder } from '../../src/shlink-web-component/short-urls/data';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<ShortUrlsListSettings />', () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { TagsOrder } from '../../shlink-web-component/tags/data/TagsListChildrenProps';
|
||||
import type { TagsSettings as TagsSettingsOptions } from '../../src/settings/reducers/settings';
|
||||
import { TagsSettings } from '../../src/settings/TagsSettings';
|
||||
import type { TagsOrder } from '../../src/shlink-web-component/tags/data/TagsListChildrenProps';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<TagsSettings />', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { CreateShortUrl as createShortUrlsCreator } from '../../src/shlink-web-component/short-urls/CreateShortUrl';
|
||||
import type { ShortUrlCreation } from '../../src/shlink-web-component/short-urls/reducers/shortUrlCreation';
|
||||
import { CreateShortUrl as createShortUrlsCreator } from '../../shlink-web-component/short-urls/CreateShortUrl';
|
||||
import type { ShortUrlCreation } from '../../shlink-web-component/short-urls/reducers/shortUrlCreation';
|
||||
|
||||
describe('<CreateShortUrl />', () => {
|
||||
const ShortUrlForm = () => <span>ShortUrlForm</span>;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { EditShortUrl as createEditShortUrl } from '../../src/shlink-web-component/short-urls/EditShortUrl';
|
||||
import type { ShortUrlDetail } from '../../src/shlink-web-component/short-urls/reducers/shortUrlDetail';
|
||||
import type { ShortUrlEdition } from '../../src/shlink-web-component/short-urls/reducers/shortUrlEdition';
|
||||
import { EditShortUrl as createEditShortUrl } from '../../shlink-web-component/short-urls/EditShortUrl';
|
||||
import type { ShortUrlDetail } from '../../shlink-web-component/short-urls/reducers/shortUrlDetail';
|
||||
import type { ShortUrlEdition } from '../../shlink-web-component/short-urls/reducers/shortUrlEdition';
|
||||
|
||||
describe('<EditShortUrl />', () => {
|
||||
const shortUrlCreation = { validateUrls: true };
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { Paginator } from '../../shlink-web-component/short-urls/Paginator';
|
||||
import type { ShlinkPaginator } from '../../src/api/types';
|
||||
import { Paginator } from '../../src/shlink-web-component/short-urls/Paginator';
|
||||
import { ELLIPSIS } from '../../src/utils/helpers/pagination';
|
||||
|
||||
describe('<Paginator />', () => {
|
||||
|
||||
@@ -2,9 +2,9 @@ import { screen } from '@testing-library/react';
|
||||
import type { UserEvent } from '@testing-library/user-event/setup/setup';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { formatISO } from 'date-fns';
|
||||
import type { Mode } from '../../shlink-web-component/short-urls/ShortUrlForm';
|
||||
import { ShortUrlForm as createShortUrlForm } from '../../shlink-web-component/short-urls/ShortUrlForm';
|
||||
import type { ReachableServer, SelectedServer } from '../../src/servers/data';
|
||||
import type { Mode } from '../../src/shlink-web-component/short-urls/ShortUrlForm';
|
||||
import { ShortUrlForm as createShortUrlForm } from '../../src/shlink-web-component/short-urls/ShortUrlForm';
|
||||
import { parseDate } from '../../src/utils/helpers/date';
|
||||
import type { OptionalString } from '../../src/utils/utils';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
@@ -2,8 +2,8 @@ import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { endOfDay, formatISO, startOfDay } from 'date-fns';
|
||||
import { MemoryRouter, useLocation, useNavigate } from 'react-router-dom';
|
||||
import { ShortUrlsFilteringBar as filteringBarCreator } from '../../shlink-web-component/short-urls/ShortUrlsFilteringBar';
|
||||
import type { ReachableServer, SelectedServer } from '../../src/servers/data';
|
||||
import { ShortUrlsFilteringBar as filteringBarCreator } from '../../src/shlink-web-component/short-urls/ShortUrlsFilteringBar';
|
||||
import { formatDate } from '../../src/utils/helpers/date';
|
||||
import type { DateRange } from '../../src/utils/helpers/dateIntervals';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { MemoryRouter, useNavigate } from 'react-router-dom';
|
||||
import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import type { ShortUrlsOrder } from '../../shlink-web-component/short-urls/data';
|
||||
import type { ShortUrlsList as ShortUrlsListModel } from '../../shlink-web-component/short-urls/reducers/shortUrlsList';
|
||||
import { ShortUrlsList as createShortUrlsList } from '../../shlink-web-component/short-urls/ShortUrlsList';
|
||||
import type { ShortUrlsTableType } from '../../shlink-web-component/short-urls/ShortUrlsTable';
|
||||
import type { Settings } from '../../src/settings/reducers/settings';
|
||||
import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import type { ShortUrlsOrder } from '../../src/shlink-web-component/short-urls/data';
|
||||
import type { ShortUrlsList as ShortUrlsListModel } from '../../src/shlink-web-component/short-urls/reducers/shortUrlsList';
|
||||
import { ShortUrlsList as createShortUrlsList } from '../../src/shlink-web-component/short-urls/ShortUrlsList';
|
||||
import type { ShortUrlsTableType } from '../../src/shlink-web-component/short-urls/ShortUrlsTable';
|
||||
import type { SemVer } from '../../src/utils/helpers/version';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { fireEvent, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShortUrlsOrderableFields } from '../../shlink-web-component/short-urls/data';
|
||||
import { SHORT_URLS_ORDERABLE_FIELDS } from '../../shlink-web-component/short-urls/data';
|
||||
import type { ShortUrlsList } from '../../shlink-web-component/short-urls/reducers/shortUrlsList';
|
||||
import { ShortUrlsTable as shortUrlsTableCreator } from '../../shlink-web-component/short-urls/ShortUrlsTable';
|
||||
import type { SelectedServer } from '../../src/servers/data';
|
||||
import type { ShortUrlsOrderableFields } from '../../src/shlink-web-component/short-urls/data';
|
||||
import { SHORT_URLS_ORDERABLE_FIELDS } from '../../src/shlink-web-component/short-urls/data';
|
||||
import type { ShortUrlsList } from '../../src/shlink-web-component/short-urls/reducers/shortUrlsList';
|
||||
import { ShortUrlsTable as shortUrlsTableCreator } from '../../src/shlink-web-component/short-urls/ShortUrlsTable';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<ShortUrlsTable />', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { UseExistingIfFoundInfoIcon } from '../../src/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon';
|
||||
import { UseExistingIfFoundInfoIcon } from '../../shlink-web-component/short-urls/UseExistingIfFoundInfoIcon';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<UseExistingIfFoundInfoIcon />', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { CreateShortUrlResult as createResult } from '../../../src/shlink-web-component/short-urls/helpers/CreateShortUrlResult';
|
||||
import type { ShortUrlCreation } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation';
|
||||
import { CreateShortUrlResult as createResult } from '../../../shlink-web-component/short-urls/helpers/CreateShortUrlResult';
|
||||
import type { ShortUrlCreation } from '../../../shlink-web-component/short-urls/reducers/shortUrlCreation';
|
||||
import type { TimeoutToggle } from '../../../src/utils/helpers/hooks';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import { DeleteShortUrlModal } from '../../../shlink-web-component/short-urls/helpers/DeleteShortUrlModal';
|
||||
import type { ShortUrlDeletion } from '../../../shlink-web-component/short-urls/reducers/shortUrlDeletion';
|
||||
import type { InvalidShortUrlDeletion } from '../../../src/api/types/errors';
|
||||
import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { DeleteShortUrlModal } from '../../../src/shlink-web-component/short-urls/helpers/DeleteShortUrlModal';
|
||||
import type { ShortUrlDeletion } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDeletion';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
import { TestModalWrapper } from '../../__helpers__/TestModalWrapper';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../shlink-web-component/short-urls/helpers/ExportShortUrlsBtn';
|
||||
import type { ReportExporter } from '../../../src/common/services/ReportExporter';
|
||||
import type { NotFoundServer, SelectedServer } from '../../../src/servers/data';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<ExportShortUrlsBtn />', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { fireEvent, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { QrCodeModal as createQrCodeModal } from '../../../src/shlink-web-component/short-urls/helpers/QrCodeModal';
|
||||
import { QrCodeModal as createQrCodeModal } from '../../../shlink-web-component/short-urls/helpers/QrCodeModal';
|
||||
import type { SemVer } from '../../../src/utils/helpers/version';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import type { LinkSuffix } from '../../../shlink-web-component/short-urls/helpers/ShortUrlDetailLink';
|
||||
import { ShortUrlDetailLink } from '../../../shlink-web-component/short-urls/helpers/ShortUrlDetailLink';
|
||||
import type { NotFoundServer, ReachableServer } from '../../../src/servers/data';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import type { LinkSuffix } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink';
|
||||
import { ShortUrlDetailLink } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink';
|
||||
|
||||
describe('<ShortUrlDetailLink />', () => {
|
||||
it.each([
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { ShortUrlFormCheckboxGroup } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup';
|
||||
import { ShortUrlFormCheckboxGroup } from '../../../shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup';
|
||||
|
||||
describe('<ShortUrlFormCheckboxGroup />', () => {
|
||||
it.each([
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShortUrl, ShortUrlMeta } from '../../../shlink-web-component/short-urls/data';
|
||||
import { ShortUrlStatus } from '../../../shlink-web-component/short-urls/helpers/ShortUrlStatus';
|
||||
import type { ShlinkVisitsSummary } from '../../../src/api/types';
|
||||
import type { ShortUrl, ShortUrlMeta } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { ShortUrlStatus } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlStatus';
|
||||
|
||||
describe('<ShortUrlStatus />', () => {
|
||||
const setUp = (shortUrl: ShortUrl) => ({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { ShortUrlVisitsCount } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import { ShortUrlVisitsCount } from '../../../shlink-web-component/short-urls/helpers/ShortUrlVisitsCount';
|
||||
|
||||
describe('<ShortUrlVisitsCount />', () => {
|
||||
const setUp = (visitsCount: number, shortUrl: ShortUrl) => ({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { ShortUrlsFilterDropdown } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown';
|
||||
import { ShortUrlsFilterDropdown } from '../../../shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<ShortUrlsFilterDropdown />', () => {
|
||||
|
||||
@@ -3,10 +3,10 @@ import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { addDays, formatISO, subDays } from 'date-fns';
|
||||
import { last } from 'ramda';
|
||||
import { MemoryRouter, useLocation } from 'react-router-dom';
|
||||
import type { ShortUrl, ShortUrlMeta } from '../../../shlink-web-component/short-urls/data';
|
||||
import { ShortUrlsRow as createShortUrlsRow } from '../../../shlink-web-component/short-urls/helpers/ShortUrlsRow';
|
||||
import type { ReachableServer } from '../../../src/servers/data';
|
||||
import type { Settings } from '../../../src/settings/reducers/settings';
|
||||
import type { ShortUrl, ShortUrlMeta } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { ShortUrlsRow as createShortUrlsRow } from '../../../src/shlink-web-component/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';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../shlink-web-component/short-urls/helpers/ShortUrlsRowMenu';
|
||||
import type { ReachableServer } from '../../../src/servers/data';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<ShortUrlsRowMenu />', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { Tags } from '../../../src/shlink-web-component/short-urls/helpers/Tags';
|
||||
import { Tags } from '../../../shlink-web-component/short-urls/helpers/Tags';
|
||||
import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock';
|
||||
|
||||
describe('<Tags />', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { shortUrlDataFromShortUrl, urlDecodeShortCode, urlEncodeShortCode } from '../../../src/shlink-web-component/short-urls/helpers';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import { shortUrlDataFromShortUrl, urlDecodeShortCode, urlEncodeShortCode } from '../../../shlink-web-component/short-urls/helpers';
|
||||
|
||||
describe('helpers', () => {
|
||||
describe('shortUrlDataFromShortUrl', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { QrErrorCorrectionDropdown } from '../../../../src/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown';
|
||||
import { QrErrorCorrectionDropdown } from '../../../../shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown';
|
||||
import type { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes';
|
||||
import { renderWithEvents } from '../../../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { QrFormatDropdown } from '../../../../src/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown';
|
||||
import { QrFormatDropdown } from '../../../../shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown';
|
||||
import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes';
|
||||
import { renderWithEvents } from '../../../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import {
|
||||
createShortUrl as createShortUrlCreator,
|
||||
shortUrlCreationReducerCreator,
|
||||
} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation';
|
||||
} from '../../../shlink-web-component/short-urls/reducers/shortUrlCreation';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
|
||||
describe('shortUrlCreationReducer', () => {
|
||||
const shortUrl = fromPartial<ShortUrl>({});
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ProblemDetailsError } from '../../../src/api/types/errors';
|
||||
import {
|
||||
deleteShortUrl as deleteShortUrlCreator,
|
||||
shortUrlDeletionReducerCreator,
|
||||
} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDeletion';
|
||||
} from '../../../shlink-web-component/short-urls/reducers/shortUrlDeletion';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ProblemDetailsError } from '../../../src/api/types/errors';
|
||||
|
||||
describe('shortUrlDeletionReducer', () => {
|
||||
const deleteShortUrlCall = vi.fn();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import { shortUrlDetailReducerCreator } from '../../../shlink-web-component/short-urls/reducers/shortUrlDetail';
|
||||
import type { ShortUrlsList } from '../../../shlink-web-component/short-urls/reducers/shortUrlsList';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { shortUrlDetailReducerCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDetail';
|
||||
import type { ShortUrlsList } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlsList';
|
||||
|
||||
describe('shortUrlDetailReducer', () => {
|
||||
const getShortUrlCall = vi.fn();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import type { SelectedServer } from '../../../src/servers/data';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import {
|
||||
editShortUrl as editShortUrlCreator,
|
||||
shortUrlEditionReducerCreator,
|
||||
} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlEdition';
|
||||
} from '../../../shlink-web-component/short-urls/reducers/shortUrlEdition';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import type { SelectedServer } from '../../../src/servers/data';
|
||||
|
||||
describe('shortUrlEditionReducer', () => {
|
||||
const longUrl = 'https://shlink.io';
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkShortUrlsResponse } from '../../../src/api/types';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { createShortUrl as createShortUrlCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation';
|
||||
import { shortUrlDeleted } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDeletion';
|
||||
import { editShortUrl as editShortUrlCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlEdition';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import { createShortUrl as createShortUrlCreator } from '../../../shlink-web-component/short-urls/reducers/shortUrlCreation';
|
||||
import { shortUrlDeleted } from '../../../shlink-web-component/short-urls/reducers/shortUrlDeletion';
|
||||
import { editShortUrl as editShortUrlCreator } from '../../../shlink-web-component/short-urls/reducers/shortUrlEdition';
|
||||
import {
|
||||
listShortUrls as listShortUrlsCreator,
|
||||
shortUrlsListReducerCreator,
|
||||
} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlsList';
|
||||
import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { CreateVisit } from '../../../src/shlink-web-component/visits/types';
|
||||
} from '../../../shlink-web-component/short-urls/reducers/shortUrlsList';
|
||||
import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { CreateVisit } from '../../../shlink-web-component/visits/types';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkShortUrlsResponse } from '../../../src/api/types';
|
||||
|
||||
describe('shortUrlsListReducer', () => {
|
||||
const shortCode = 'abc123';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { identity } from 'ramda';
|
||||
import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import type { TagsList } from '../../src/shlink-web-component/tags/reducers/tagsList';
|
||||
import type { TagsListProps } from '../../src/shlink-web-component/tags/TagsList';
|
||||
import { TagsList as createTagsList } from '../../src/shlink-web-component/tags/TagsList';
|
||||
import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import type { TagsList } from '../../shlink-web-component/tags/reducers/tagsList';
|
||||
import type { TagsListProps } from '../../shlink-web-component/tags/TagsList';
|
||||
import { TagsList as createTagsList } from '../../shlink-web-component/tags/TagsList';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<TagsList />', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { TagsTable as createTagsTable } from '../../src/shlink-web-component/tags/TagsTable';
|
||||
import { TagsTable as createTagsTable } from '../../shlink-web-component/tags/TagsTable';
|
||||
import { rangeOf } from '../../src/utils/utils';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { TagsTableRow as createTagsTableRow } from '../../src/shlink-web-component/tags/TagsTableRow';
|
||||
import { TagsTableRow as createTagsTableRow } from '../../shlink-web-component/tags/TagsTableRow';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
import { colorGeneratorMock } from '../utils/services/__mocks__/ColorGenerator.mock';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { DeleteTagConfirmModal } from '../../../src/shlink-web-component/tags/helpers/DeleteTagConfirmModal';
|
||||
import type { TagDeletion } from '../../../src/shlink-web-component/tags/reducers/tagDelete';
|
||||
import { DeleteTagConfirmModal } from '../../../shlink-web-component/tags/helpers/DeleteTagConfirmModal';
|
||||
import type { TagDeletion } from '../../../shlink-web-component/tags/reducers/tagDelete';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<DeleteTagConfirmModal />', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { EditTagModal as createEditTagModal } from '../../../src/shlink-web-component/tags/helpers/EditTagModal';
|
||||
import type { TagEdition } from '../../../src/shlink-web-component/tags/reducers/tagEdit';
|
||||
import { EditTagModal as createEditTagModal } from '../../../shlink-web-component/tags/helpers/EditTagModal';
|
||||
import type { TagEdition } from '../../../shlink-web-component/tags/reducers/tagEdit';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<EditTagModal />', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ReactNode } from 'react';
|
||||
import { Tag } from '../../../src/shlink-web-component/tags/helpers/Tag';
|
||||
import { Tag } from '../../../shlink-web-component/tags/helpers/Tag';
|
||||
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
|
||||
import { MAIN_COLOR } from '../../../src/utils/theme';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { TagsSelector as createTagsSelector } from '../../../src/shlink-web-component/tags/helpers/TagsSelector';
|
||||
import type { TagsList } from '../../../src/shlink-web-component/tags/reducers/tagsList';
|
||||
import { TagsSelector as createTagsSelector } from '../../../shlink-web-component/tags/helpers/TagsSelector';
|
||||
import type { TagsList } from '../../../shlink-web-component/tags/reducers/tagsList';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { tagDeleted, tagDeleteReducerCreator } from '../../../shlink-web-component/tags/reducers/tagDelete';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import { tagDeleted, tagDeleteReducerCreator } from '../../../src/shlink-web-component/tags/reducers/tagDelete';
|
||||
|
||||
describe('tagDeleteReducer', () => {
|
||||
const deleteTagsCall = vi.fn();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { editTag as editTagCreator, tagEdited, tagEditReducerCreator } from '../../../shlink-web-component/tags/reducers/tagEdit';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import { editTag as editTagCreator, tagEdited, tagEditReducerCreator } from '../../../src/shlink-web-component/tags/reducers/tagEdit';
|
||||
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
|
||||
|
||||
describe('tagEditReducer', () => {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { createShortUrl as createShortUrlCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation';
|
||||
import { tagDeleted } from '../../../src/shlink-web-component/tags/reducers/tagDelete';
|
||||
import { tagEdited } from '../../../src/shlink-web-component/tags/reducers/tagEdit';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import { createShortUrl as createShortUrlCreator } from '../../../shlink-web-component/short-urls/reducers/shortUrlCreation';
|
||||
import { tagDeleted } from '../../../shlink-web-component/tags/reducers/tagDelete';
|
||||
import { tagEdited } from '../../../shlink-web-component/tags/reducers/tagEdit';
|
||||
import type {
|
||||
TagsList } from '../../../src/shlink-web-component/tags/reducers/tagsList';
|
||||
TagsList } from '../../../shlink-web-component/tags/reducers/tagsList';
|
||||
import {
|
||||
filterTags,
|
||||
listTags as listTagsCreator,
|
||||
tagsListReducerCreator,
|
||||
} from '../../../src/shlink-web-component/tags/reducers/tagsList';
|
||||
import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { CreateVisit } from '../../../src/shlink-web-component/visits/types';
|
||||
} from '../../../shlink-web-component/tags/reducers/tagsList';
|
||||
import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { CreateVisit } from '../../../shlink-web-component/visits/types';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
|
||||
describe('tagsListReducer', () => {
|
||||
const state = (props: Partial<TagsList>) => fromPartial<TagsList>(props);
|
||||
|
||||
@@ -2,9 +2,9 @@ import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { formatISO } from 'date-fns';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import { DomainVisits as createDomainVisits } from '../../src/shlink-web-component/visits/DomainVisits';
|
||||
import type { DomainVisits } from '../../src/shlink-web-component/visits/reducers/domainVisits';
|
||||
import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import { DomainVisits as createDomainVisits } from '../../shlink-web-component/visits/DomainVisits';
|
||||
import type { DomainVisits } from '../../shlink-web-component/visits/reducers/domainVisits';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
vi.mock('react-router-dom', async () => ({
|
||||
|
||||
@@ -2,9 +2,9 @@ import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { formatISO } from 'date-fns';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import { NonOrphanVisits as createNonOrphanVisits } from '../../src/shlink-web-component/visits/NonOrphanVisits';
|
||||
import type { VisitsInfo } from '../../src/shlink-web-component/visits/reducers/types';
|
||||
import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import { NonOrphanVisits as createNonOrphanVisits } from '../../shlink-web-component/visits/NonOrphanVisits';
|
||||
import type { VisitsInfo } from '../../shlink-web-component/visits/reducers/types';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<NonOrphanVisits />', () => {
|
||||
|
||||
@@ -2,9 +2,9 @@ import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { formatISO } from 'date-fns';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import { OrphanVisits as createOrphanVisits } from '../../src/shlink-web-component/visits/OrphanVisits';
|
||||
import type { VisitsInfo } from '../../src/shlink-web-component/visits/reducers/types';
|
||||
import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import { OrphanVisits as createOrphanVisits } from '../../shlink-web-component/visits/OrphanVisits';
|
||||
import type { VisitsInfo } from '../../shlink-web-component/visits/reducers/types';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<OrphanVisits />', () => {
|
||||
|
||||
@@ -3,10 +3,10 @@ import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { formatISO } from 'date-fns';
|
||||
import { identity } from 'ramda';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import type { ShortUrlVisits as ShortUrlVisitsState } from '../../src/shlink-web-component/visits/reducers/shortUrlVisits';
|
||||
import type { ShortUrlVisitsProps } from '../../src/shlink-web-component/visits/ShortUrlVisits';
|
||||
import { ShortUrlVisits as createShortUrlVisits } from '../../src/shlink-web-component/visits/ShortUrlVisits';
|
||||
import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import type { ShortUrlVisits as ShortUrlVisitsState } from '../../shlink-web-component/visits/reducers/shortUrlVisits';
|
||||
import type { ShortUrlVisitsProps } from '../../shlink-web-component/visits/ShortUrlVisits';
|
||||
import { ShortUrlVisits as createShortUrlVisits } from '../../shlink-web-component/visits/ShortUrlVisits';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<ShortUrlVisits />', () => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { formatDistance, parseISO } from 'date-fns';
|
||||
import type { ShortUrlDetail } from '../../src/shlink-web-component/short-urls/reducers/shortUrlDetail';
|
||||
import type { ShortUrlVisits } from '../../src/shlink-web-component/visits/reducers/shortUrlVisits';
|
||||
import { ShortUrlVisitsHeader } from '../../src/shlink-web-component/visits/ShortUrlVisitsHeader';
|
||||
import type { ShortUrlDetail } from '../../shlink-web-component/short-urls/reducers/shortUrlDetail';
|
||||
import type { ShortUrlVisits } from '../../shlink-web-component/visits/reducers/shortUrlVisits';
|
||||
import { ShortUrlVisitsHeader } from '../../shlink-web-component/visits/ShortUrlVisitsHeader';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<ShortUrlVisitsHeader />', () => {
|
||||
|
||||
@@ -2,10 +2,10 @@ import { screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { formatISO } from 'date-fns';
|
||||
import { MemoryRouter } from 'react-router';
|
||||
import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import type { TagVisits as TagVisitsStats } from '../../src/shlink-web-component/visits/reducers/tagVisits';
|
||||
import type { TagVisitsProps } from '../../src/shlink-web-component/visits/TagVisits';
|
||||
import { TagVisits as createTagVisits } from '../../src/shlink-web-component/visits/TagVisits';
|
||||
import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub';
|
||||
import type { TagVisits as TagVisitsStats } from '../../shlink-web-component/visits/reducers/tagVisits';
|
||||
import type { TagVisitsProps } from '../../shlink-web-component/visits/TagVisits';
|
||||
import { TagVisits as createTagVisits } from '../../shlink-web-component/visits/TagVisits';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
vi.mock('react-router-dom', async () => ({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { TagVisits } from '../../src/shlink-web-component/visits/reducers/tagVisits';
|
||||
import { TagVisitsHeader } from '../../src/shlink-web-component/visits/TagVisitsHeader';
|
||||
import type { TagVisits } from '../../shlink-web-component/visits/reducers/tagVisits';
|
||||
import { TagVisitsHeader } from '../../shlink-web-component/visits/TagVisitsHeader';
|
||||
import type { ColorGenerator } from '../../src/utils/services/ColorGenerator';
|
||||
|
||||
describe('<TagVisitsHeader />', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { Visit } from '../../src/shlink-web-component/visits/types';
|
||||
import { VisitsHeader } from '../../src/shlink-web-component/visits/VisitsHeader';
|
||||
import type { Visit } from '../../shlink-web-component/visits/types';
|
||||
import { VisitsHeader } from '../../shlink-web-component/visits/VisitsHeader';
|
||||
|
||||
describe('<VisitsHeader />', () => {
|
||||
const visits: Visit[] = [fromPartial({}), fromPartial({}), fromPartial({})];
|
||||
|
||||
@@ -2,9 +2,9 @@ import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { Router } from 'react-router-dom';
|
||||
import type { VisitsInfo } from '../../src/shlink-web-component/visits/reducers/types';
|
||||
import type { Visit } from '../../src/shlink-web-component/visits/types';
|
||||
import { VisitsStats } from '../../src/shlink-web-component/visits/VisitsStats';
|
||||
import type { VisitsInfo } from '../../shlink-web-component/visits/reducers/types';
|
||||
import type { Visit } from '../../shlink-web-component/visits/types';
|
||||
import { VisitsStats } from '../../shlink-web-component/visits/VisitsStats';
|
||||
import { rangeOf } from '../../src/utils/utils';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { NormalizedVisit } from '../../src/shlink-web-component/visits/types';
|
||||
import type { VisitsTableProps } from '../../src/shlink-web-component/visits/VisitsTable';
|
||||
import { VisitsTable } from '../../src/shlink-web-component/visits/VisitsTable';
|
||||
import type { NormalizedVisit } from '../../shlink-web-component/visits/types';
|
||||
import type { VisitsTableProps } from '../../shlink-web-component/visits/VisitsTable';
|
||||
import { VisitsTable } from '../../shlink-web-component/visits/VisitsTable';
|
||||
import { rangeOf } from '../../src/utils/utils';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { ChartCard } from '../../../src/shlink-web-component/visits/charts/ChartCard';
|
||||
import { ChartCard } from '../../../shlink-web-component/visits/charts/ChartCard';
|
||||
|
||||
describe('<ChartCard />', () => {
|
||||
const setUp = (title: Function | string = '', footer?: ReactNode) => render(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { DoughnutChart } from '../../../src/shlink-web-component/visits/charts/DoughnutChart';
|
||||
import { DoughnutChart } from '../../../shlink-web-component/visits/charts/DoughnutChart';
|
||||
import { setUpCanvas } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<DoughnutChart />', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { Chart, ChartDataset } from 'chart.js';
|
||||
import { DoughnutChartLegend } from '../../../src/shlink-web-component/visits/charts/DoughnutChartLegend';
|
||||
import { DoughnutChartLegend } from '../../../shlink-web-component/visits/charts/DoughnutChartLegend';
|
||||
|
||||
describe('<DoughnutChartLegend />', () => {
|
||||
const labels = ['foo', 'bar', 'baz', 'foo2', 'bar2'];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { HorizontalBarChartProps } from '../../../src/shlink-web-component/visits/charts/HorizontalBarChart';
|
||||
import { HorizontalBarChart } from '../../../src/shlink-web-component/visits/charts/HorizontalBarChart';
|
||||
import type { HorizontalBarChartProps } from '../../../shlink-web-component/visits/charts/HorizontalBarChart';
|
||||
import { HorizontalBarChart } from '../../../shlink-web-component/visits/charts/HorizontalBarChart';
|
||||
import { setUpCanvas } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<HorizontalBarChart />', () => {
|
||||
|
||||
@@ -2,8 +2,8 @@ import { screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { formatISO, subDays, subMonths, subYears } from 'date-fns';
|
||||
import { LineChartCard } from '../../../src/shlink-web-component/visits/charts/LineChartCard';
|
||||
import type { NormalizedVisit } from '../../../src/shlink-web-component/visits/types';
|
||||
import { LineChartCard } from '../../../shlink-web-component/visits/charts/LineChartCard';
|
||||
import type { NormalizedVisit } from '../../../shlink-web-component/visits/types';
|
||||
import { setUpCanvas } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<LineChartCard />', () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { range } from 'ramda';
|
||||
import type { ReactNode } from 'react';
|
||||
import { SortableBarChartCard } from '../../../src/shlink-web-component/visits/charts/SortableBarChartCard';
|
||||
import type { Stats } from '../../../src/shlink-web-component/visits/types';
|
||||
import { SortableBarChartCard } from '../../../shlink-web-component/visits/charts/SortableBarChartCard';
|
||||
import type { Stats } from '../../../shlink-web-component/visits/types';
|
||||
import { rangeOf } from '../../../src/utils/utils';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { MapModal } from '../../../src/shlink-web-component/visits/helpers/MapModal';
|
||||
import type { CityStats } from '../../../src/shlink-web-component/visits/types';
|
||||
import { MapModal } from '../../../shlink-web-component/visits/helpers/MapModal';
|
||||
import type { CityStats } from '../../../shlink-web-component/visits/types';
|
||||
|
||||
describe('<MapModal />', () => {
|
||||
const toggle = vi.fn();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { OpenMapModalBtn } from '../../../src/shlink-web-component/visits/helpers/OpenMapModalBtn';
|
||||
import type { CityStats } from '../../../src/shlink-web-component/visits/types';
|
||||
import { OpenMapModalBtn } from '../../../shlink-web-component/visits/helpers/OpenMapModalBtn';
|
||||
import type { CityStats } from '../../../shlink-web-component/visits/types';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<OpenMapModalBtn />', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { VisitsFilterDropdown } from '../../../src/shlink-web-component/visits/helpers/VisitsFilterDropdown';
|
||||
import type { OrphanVisitType, VisitsFilter } from '../../../src/shlink-web-component/visits/types';
|
||||
import { VisitsFilterDropdown } from '../../../shlink-web-component/visits/helpers/VisitsFilterDropdown';
|
||||
import type { OrphanVisitType, VisitsFilter } from '../../../shlink-web-component/visits/types';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<VisitsFilterDropdown />', () => {
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { addDays, formatISO, subDays } from 'date-fns';
|
||||
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/shlink-web-component/short-urls/data';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import type {
|
||||
DomainVisits, LoadDomainVisits,
|
||||
} from '../../../src/shlink-web-component/visits/reducers/domainVisits';
|
||||
} from '../../../shlink-web-component/visits/reducers/domainVisits';
|
||||
import {
|
||||
DEFAULT_DOMAIN,
|
||||
domainVisitsReducerCreator,
|
||||
getDomainVisits as getDomainVisitsCreator,
|
||||
} from '../../../src/shlink-web-component/visits/reducers/domainVisits';
|
||||
import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../src/shlink-web-component/visits/types';
|
||||
} from '../../../shlink-web-component/visits/reducers/domainVisits';
|
||||
import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../shlink-web-component/visits/types';
|
||||
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';
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { addDays, formatISO, subDays } from 'date-fns';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkVisits } from '../../../src/api/types';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import {
|
||||
getNonOrphanVisits as getNonOrphanVisitsCreator,
|
||||
nonOrphanVisitsReducerCreator,
|
||||
} from '../../../src/shlink-web-component/visits/reducers/nonOrphanVisits';
|
||||
import type { VisitsInfo } from '../../../src/shlink-web-component/visits/reducers/types';
|
||||
import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../src/shlink-web-component/visits/types';
|
||||
} from '../../../shlink-web-component/visits/reducers/nonOrphanVisits';
|
||||
import type { VisitsInfo } from '../../../shlink-web-component/visits/reducers/types';
|
||||
import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../shlink-web-component/visits/types';
|
||||
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';
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { addDays, formatISO, subDays } from 'date-fns';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkVisits } from '../../../src/api/types';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import {
|
||||
getOrphanVisits as getOrphanVisitsCreator,
|
||||
orphanVisitsReducerCreator,
|
||||
} from '../../../src/shlink-web-component/visits/reducers/orphanVisits';
|
||||
import type { VisitsInfo } from '../../../src/shlink-web-component/visits/reducers/types';
|
||||
import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../src/shlink-web-component/visits/types';
|
||||
} from '../../../shlink-web-component/visits/reducers/orphanVisits';
|
||||
import type { VisitsInfo } from '../../../shlink-web-component/visits/reducers/types';
|
||||
import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../shlink-web-component/visits/types';
|
||||
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';
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { addDays, formatISO, subDays } from 'date-fns';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkVisits } from '../../../src/api/types';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import type {
|
||||
ShortUrlVisits } from '../../../src/shlink-web-component/visits/reducers/shortUrlVisits';
|
||||
ShortUrlVisits } from '../../../shlink-web-component/visits/reducers/shortUrlVisits';
|
||||
import {
|
||||
getShortUrlVisits as getShortUrlVisitsCreator,
|
||||
shortUrlVisitsReducerCreator,
|
||||
} from '../../../src/shlink-web-component/visits/reducers/shortUrlVisits';
|
||||
import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../src/shlink-web-component/visits/types';
|
||||
} from '../../../shlink-web-component/visits/reducers/shortUrlVisits';
|
||||
import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../shlink-web-component/visits/types';
|
||||
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';
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { addDays, formatISO, subDays } from 'date-fns';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkVisits } from '../../../src/api/types';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import type {
|
||||
TagVisits } from '../../../src/shlink-web-component/visits/reducers/tagVisits';
|
||||
TagVisits } from '../../../shlink-web-component/visits/reducers/tagVisits';
|
||||
import {
|
||||
getTagVisits as getTagVisitsCreator,
|
||||
tagVisitsReducerCreator,
|
||||
} from '../../../src/shlink-web-component/visits/reducers/tagVisits';
|
||||
import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../src/shlink-web-component/visits/types';
|
||||
} from '../../../shlink-web-component/visits/reducers/tagVisits';
|
||||
import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../shlink-web-component/visits/types';
|
||||
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';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data';
|
||||
import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../src/shlink-web-component/visits/types';
|
||||
import type { ShortUrl } from '../../../shlink-web-component/short-urls/data';
|
||||
import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../shlink-web-component/visits/types';
|
||||
|
||||
describe('visitCreationReducer', () => {
|
||||
describe('createNewVisits', () => {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkVisitsOverview } from '../../../src/api/types';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation';
|
||||
import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation';
|
||||
import type {
|
||||
PartialVisitsSummary,
|
||||
VisitsOverview,
|
||||
} from '../../../src/shlink-web-component/visits/reducers/visitsOverview';
|
||||
} from '../../../shlink-web-component/visits/reducers/visitsOverview';
|
||||
import {
|
||||
loadVisitsOverview as loadVisitsOverviewCreator,
|
||||
visitsOverviewReducerCreator,
|
||||
} from '../../../src/shlink-web-component/visits/reducers/visitsOverview';
|
||||
import type { OrphanVisit } from '../../../src/shlink-web-component/visits/types';
|
||||
} from '../../../shlink-web-component/visits/reducers/visitsOverview';
|
||||
import type { OrphanVisit } from '../../../shlink-web-component/visits/types';
|
||||
import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import type { ShlinkVisitsOverview } from '../../../src/api/types';
|
||||
import type { ShlinkState } from '../../../src/container/types';
|
||||
|
||||
describe('visitsOverviewReducer', () => {
|
||||
const getVisitsOverview = vi.fn();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { normalizeVisits, processStatsFromVisits } from '../../../src/shlink-web-component/visits/services/VisitsParser';
|
||||
import type { OrphanVisit, Visit, VisitsStats } from '../../../src/shlink-web-component/visits/types';
|
||||
import { normalizeVisits, processStatsFromVisits } from '../../../shlink-web-component/visits/services/VisitsParser';
|
||||
import type { OrphanVisit, Visit, VisitsStats } from '../../../shlink-web-component/visits/types';
|
||||
|
||||
describe('VisitsParser', () => {
|
||||
const visits: Visit[] = [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { CreateVisit, OrphanVisit, VisitsParams } from '../../../shlink-web-component/visits/types';
|
||||
import type { GroupedNewVisits } from '../../../shlink-web-component/visits/types/helpers';
|
||||
import { groupNewVisitsByType, toApiParams } from '../../../shlink-web-component/visits/types/helpers';
|
||||
import type { ShlinkVisitsParams } from '../../../src/api/types';
|
||||
import type { CreateVisit, OrphanVisit, VisitsParams } from '../../../src/shlink-web-component/visits/types';
|
||||
import type { GroupedNewVisits } from '../../../src/shlink-web-component/visits/types/helpers';
|
||||
import { groupNewVisitsByType, toApiParams } from '../../../src/shlink-web-component/visits/types/helpers';
|
||||
import { formatIsoDate, parseDate } from '../../../src/utils/helpers/date';
|
||||
|
||||
describe('visitsTypeHelpers', () => {
|
||||
|
||||
Reference in New Issue
Block a user