mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-02 05:36:38 +00:00
Add import type whenever possible
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { DropdownBtn, DropdownBtnProps } from '../../src/utils/DropdownBtn';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import type { DropdownBtnProps } from '../../src/utils/DropdownBtn';
|
||||
import { DropdownBtn } from '../../src/utils/DropdownBtn';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<DropdownBtn />', () => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { DropdownBtnMenu, DropdownBtnMenuProps } from '../../src/utils/DropdownBtnMenu';
|
||||
import type { DropdownBtnMenuProps } from '../../src/utils/DropdownBtnMenu';
|
||||
import { DropdownBtnMenu } from '../../src/utils/DropdownBtnMenu';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<DropdownBtnMenu />', () => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { Placement } from '@popperjs/core';
|
||||
import { InfoTooltip, InfoTooltipProps } from '../../src/utils/InfoTooltip';
|
||||
import type { Placement } from '@popperjs/core';
|
||||
import type { InfoTooltipProps } from '../../src/utils/InfoTooltip';
|
||||
import { InfoTooltip } from '../../src/utils/InfoTooltip';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
describe('<InfoTooltip />', () => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { Message, MessageProps } from '../../src/utils/Message';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import type { MessageProps } from '../../src/utils/Message';
|
||||
import { Message } from '../../src/utils/Message';
|
||||
|
||||
describe('<Message />', () => {
|
||||
const setUp = (props: PropsWithChildren<MessageProps> = {}) => render(<Message {...props} />);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { values } from 'ramda';
|
||||
import { OrderingDropdown, OrderingDropdownProps } from '../../src/utils/OrderingDropdown';
|
||||
import { 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 />', () => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { Result, ResultProps, ResultType } from '../../src/utils/Result';
|
||||
import type { ResultProps, ResultType } from '../../src/utils/Result';
|
||||
import { Result } from '../../src/utils/Result';
|
||||
|
||||
describe('<Result />', () => {
|
||||
const setUp = (props: ResultProps) => render(<Result {...props} />);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { parseISO } from 'date-fns';
|
||||
import { DateInput, DateInputProps } from '../../../src/utils/dates/DateInput';
|
||||
import type { DateInputProps } from '../../../src/utils/dates/DateInput';
|
||||
import { DateInput } from '../../../src/utils/dates/DateInput';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<DateInput />', () => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { DateIntervalDropdownItems } from '../../../src/utils/dates/DateIntervalDropdownItems';
|
||||
import { DATE_INTERVALS, DateInterval, rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals';
|
||||
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';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { DateInterval, rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals';
|
||||
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';
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { DateRangeSelector, DateRangeSelectorProps } from '../../../src/utils/dates/DateRangeSelector';
|
||||
import { DateInterval } from '../../../src/utils/helpers/dateIntervals';
|
||||
import type { DateRangeSelectorProps } from '../../../src/utils/dates/DateRangeSelector';
|
||||
import { DateRangeSelector } from '../../../src/utils/dates/DateRangeSelector';
|
||||
import type { DateInterval } from '../../../src/utils/helpers/dateIntervals';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<DateRangeSelector />', () => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import { TimeProps, Time } from '../../../src/utils/dates/Time';
|
||||
import type { TimeProps } from '../../../src/utils/dates/Time';
|
||||
import { Time } from '../../../src/utils/dates/Time';
|
||||
import { parseDate } from '../../../src/utils/helpers/date';
|
||||
|
||||
describe('<Time />', () => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { endOfDay, format, formatISO, startOfDay, subDays } from 'date-fns';
|
||||
import type {
|
||||
DateInterval } from '../../../src/utils/helpers/dateIntervals';
|
||||
import {
|
||||
DateInterval,
|
||||
dateRangeIsEmpty,
|
||||
dateToMatchingInterval,
|
||||
intervalToDateRange,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { determineOrderDir, OrderDir, orderToString, stringToOrder } from '../../../src/utils/helpers/ordering';
|
||||
import type { OrderDir } from '../../../src/utils/helpers/ordering';
|
||||
import { determineOrderDir, orderToString, stringToOrder } from '../../../src/utils/helpers/ordering';
|
||||
|
||||
describe('ordering', () => {
|
||||
describe('determineOrderDir', () => {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { buildQrCodeUrl, QrCodeFormat, QrErrorCorrection } from '../../../src/utils/helpers/qrCodes';
|
||||
import type { QrCodeFormat, QrErrorCorrection } from '../../../src/utils/helpers/qrCodes';
|
||||
import { buildQrCodeUrl } from '../../../src/utils/helpers/qrCodes';
|
||||
|
||||
describe('qrCodes', () => {
|
||||
describe('buildQrCodeUrl', () => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { SemVer, versionMatch, Versions } from '../../../src/utils/helpers/version';
|
||||
import { Empty } from '../../../src/utils/utils';
|
||||
import type { SemVer, Versions } from '../../../src/utils/helpers/version';
|
||||
import { versionMatch } from '../../../src/utils/helpers/version';
|
||||
import type { Empty } from '../../../src/utils/utils';
|
||||
|
||||
describe('version', () => {
|
||||
describe('versionMatch', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
|
||||
import { LocalStorage } from '../../../src/utils/services/LocalStorage';
|
||||
import type { LocalStorage } from '../../../src/utils/services/LocalStorage';
|
||||
import { MAIN_COLOR } from '../../../src/utils/theme';
|
||||
|
||||
describe('ColorGenerator', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { ColorGenerator } from '../../../../src/utils/services/ColorGenerator';
|
||||
import type { ColorGenerator } from '../../../../src/utils/services/ColorGenerator';
|
||||
|
||||
export const colorGeneratorMock = Mock.of<ColorGenerator>({
|
||||
getColorForKey: jest.fn(() => 'red'),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import { TableOrderIcon } from '../../../src/utils/table/TableOrderIcon';
|
||||
import { OrderDir } from '../../../src/utils/helpers/ordering';
|
||||
import type { OrderDir } from '../../../src/utils/helpers/ordering';
|
||||
|
||||
describe('<TableOrderIcon />', () => {
|
||||
const setUp = (field: string, currentDir?: OrderDir, className?: string) => render(
|
||||
|
||||
Reference in New Issue
Block a user