Add aliases for shlink-web-component and shlink-frontend-kit packages

This commit is contained in:
Alejandro Celaya
2023-08-04 22:59:33 +02:00
parent 9f2b0f7c6b
commit 93048e3327
93 changed files with 215 additions and 143 deletions

View File

@@ -1,5 +1,5 @@
import { useToggle } from '@shlinkio/shlink-frontend-kit';
import type { FC, ReactElement } from 'react';
import { useToggle } from '../../shlink-frontend-kit/src';
interface RenderModalArgs {
isOpen: boolean;

View File

@@ -1,6 +1,6 @@
import type { ShlinkDomain, ShlinkVisits, ShlinkVisitsOverview } from '@shlinkio/shlink-web-component/api-contract';
import { ErrorTypeV2, ErrorTypeV3 } from '@shlinkio/shlink-web-component/api-contract';
import { fromPartial } from '@total-typescript/shoehorn';
import type { ShlinkDomain, ShlinkVisits, ShlinkVisitsOverview } from '../../../shlink-web-component/src/api-contract';
import { ErrorTypeV2, ErrorTypeV3 } from '../../../shlink-web-component/src/api-contract';
import type { ShortUrl, ShortUrlsOrder } from '../../../shlink-web-component/src/short-urls/data';
import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
import type { HttpClient } from '../../../src/common/services/HttpClient';

View File

@@ -55,28 +55,4 @@ describe('<ShlinkWebComponentContainer />', () => {
expect(screen.queryByText('ServerError')).not.toBeInTheDocument();
expect(screen.getByText('ShlinkWebComponent')).toBeInTheDocument();
});
// FIXME Move this case to ShlinkWebComponent test
// it.each([
// ['3.0.0' as SemVer, '/overview', 'OverviewRoute'],
// ['3.0.0' as SemVer, '/list-short-urls/1', 'ShortUrlsList'],
// ['3.0.0' as SemVer, '/create-short-url', 'CreateShortUrl'],
// ['3.0.0' as SemVer, '/short-code/abc123/visits/foo', 'ShortUrlVisits'],
// ['3.0.0' as SemVer, '/short-code/abc123/edit', 'EditShortUrl'],
// ['3.0.0' as SemVer, '/tag/foo/visits/foo', 'TagVisits'],
// ['3.0.0' as SemVer, '/orphan-visits/foo', 'OrphanVisits'],
// ['3.0.0' as SemVer, '/manage-tags', 'TagsList'],
// ['3.0.0' as SemVer, '/not-found', 'Oops! We could not find requested route.'],
// ['3.0.0' as SemVer, '/domain/domain.com/visits/foo', 'Oops! We could not find requested route.'],
// ['3.1.0' as SemVer, '/domain/domain.com/visits/foo', 'DomainVisits'],
// ['2.10.0' as SemVer, '/non-orphan-visits/foo', 'Oops! We could not find requested route.'],
// ['3.0.0' as SemVer, '/non-orphan-visits/foo', 'NonOrphanVisits'],
// ['2.8.0' as SemVer, '/manage-domains', 'ManageDomains'],
// ])(
// 'renders expected component based on location and server version',
// (version, currentPath, expectedContent) => {
// setUp(fromPartial({ version }), currentPath);
// expect(screen.getByText(expectedContent)).toBeInTheDocument();
// },
// );
});

View File

@@ -1,6 +1,6 @@
import type { RealTimeUpdatesSettings as RealTimeUpdatesSettingsOptions } from '@shlinkio/shlink-web-component';
import { screen } from '@testing-library/react';
import { fromPartial } from '@total-typescript/shoehorn';
import type { RealTimeUpdatesSettings as RealTimeUpdatesSettingsOptions } from '../../shlink-web-component/src';
import { RealTimeUpdatesSettings } from '../../src/settings/RealTimeUpdatesSettings';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,6 +1,6 @@
import type { ShortUrlCreationSettings as ShortUrlsSettings } from '@shlinkio/shlink-web-component';
import { screen } from '@testing-library/react';
import { fromPartial } from '@total-typescript/shoehorn';
import type { ShortUrlCreationSettings as ShortUrlsSettings } from '../../shlink-web-component/src';
import { ShortUrlCreationSettings } from '../../src/settings/ShortUrlCreationSettings';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,6 +1,6 @@
import type { ShortUrlsListSettings as ShortUrlsSettings } from '@shlinkio/shlink-web-component';
import { screen } from '@testing-library/react';
import { fromPartial } from '@total-typescript/shoehorn';
import type { ShortUrlsListSettings as ShortUrlsSettings } from '../../shlink-web-component/src';
import type { ShortUrlsOrder } from '../../shlink-web-component/src/short-urls/data';
import { ShortUrlsListSettings } from '../../src/settings/ShortUrlsListSettings';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,7 +1,7 @@
import type { TagsSettings as TagsSettingsOptions } from '@shlinkio/shlink-web-component';
import { screen } from '@testing-library/react';
import { fromPartial } from '@total-typescript/shoehorn';
import type { TagsSettings as TagsSettingsOptions } from '../../shlink-web-component/src';
import type { TagsOrder } from '../../shlink-web-component/src/tags/data/TagsListChildrenProps';
import type { TagsOrder } from '../../src/settings/TagsSettings';
import { TagsSettings } from '../../src/settings/TagsSettings';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,6 +1,6 @@
import type { UiSettings } from '@shlinkio/shlink-web-component';
import { screen } from '@testing-library/react';
import { fromPartial } from '@total-typescript/shoehorn';
import type { UiSettings } from '../../shlink-web-component/src';
import { UserInterfaceSettings } from '../../src/settings/UserInterfaceSettings';
import type { Theme } from '../../src/utils/theme';
import { renderWithEvents } from '../__helpers__/setUpTest';

View File

@@ -1,6 +1,6 @@
import type { Settings } from '@shlinkio/shlink-web-component';
import { screen } from '@testing-library/react';
import { fromPartial } from '@total-typescript/shoehorn';
import type { Settings } from '../../shlink-web-component/src';
import { VisitsSettings } from '../../src/settings/VisitsSettings';
import { renderWithEvents } from '../__helpers__/setUpTest';