Move more components to shlink-web-component when applicable

This commit is contained in:
Alejandro Celaya
2023-07-29 10:43:15 +02:00
parent 275745fd3a
commit 8d24116859
94 changed files with 224 additions and 209 deletions

View File

@@ -1,4 +1,4 @@
import { CopyToClipboardIcon } from '../../src/utils/CopyToClipboardIcon';
import { CopyToClipboardIcon } from '../../shlink-web-component/utils/components/CopyToClipboardIcon';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<CopyToClipboardIcon />', () => {

View File

@@ -1,5 +1,5 @@
import { render, screen } from '@testing-library/react';
import { ExportBtn } from '../../src/utils/ExportBtn';
import { ExportBtn } from '../../shlink-web-component/utils/components/ExportBtn';
describe('<ExportBtn />', () => {
const setUp = (amount?: number, loading = false) => render(<ExportBtn amount={amount} loading={loading} />);

View File

@@ -1,7 +1,7 @@
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 type { InfoTooltipProps } from '../../shlink-web-component/utils/components/InfoTooltip';
import { InfoTooltip } from '../../shlink-web-component/utils/components/InfoTooltip';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<InfoTooltip />', () => {

View File

@@ -1,5 +1,5 @@
import { screen } from '@testing-library/react';
import { PaginationDropdown } from '../../src/utils/PaginationDropdown';
import { PaginationDropdown } from '../../shlink-web-component/utils/components/PaginationDropdown';
import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<PaginationDropdown />', () => {

View File

@@ -1,4 +1,4 @@
import { roundTen } from '../../../src/utils/helpers/numbers';
import { roundTen } from '../../../shlink-web-component/utils/helpers/numbers';
describe('numbers', () => {
describe('roundTen', () => {

View File

@@ -1,5 +1,5 @@
import type { QrCodeFormat, QrErrorCorrection } from '../../../src/utils/helpers/qrCodes';
import { buildQrCodeUrl } from '../../../src/utils/helpers/qrCodes';
import type { QrCodeFormat, QrErrorCorrection } from '../../../shlink-web-component/utils/helpers/qrCodes';
import { buildQrCodeUrl } from '../../../shlink-web-component/utils/helpers/qrCodes';
describe('qrCodes', () => {
describe('buildQrCodeUrl', () => {

View File

@@ -1,6 +1,6 @@
import { render } from '@testing-library/react';
import { TableOrderIcon } from '../../../shlink-web-component/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,5 +1,4 @@
import {
capitalize,
nonEmptyValueOrNull,
parseBooleanToString,
parseOptionalBooleanToString,
@@ -45,17 +44,6 @@ describe('utils', () => {
});
});
describe('capitalize', () => {
it.each([
['foo', 'Foo'],
['BAR', 'BAR'],
['bAZ', 'BAZ'],
['with spaces', 'With spaces'],
])('sets first letter in uppercase', (value, expectedResult) => {
expect(capitalize(value)).toEqual(expectedResult);
});
});
describe('parseBooleanToString', () => {
it.each([
[true, 'true'],