mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-19 04:56:17 +00:00
Migrate more tests to shoehorn
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { parseISO } from 'date-fns';
|
||||
import { Mock } from 'ts-mockery';
|
||||
import type { DateInputProps } from '../../../src/utils/dates/DateInput';
|
||||
import { DateInput } from '../../../src/utils/dates/DateInput';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<DateInput />', () => {
|
||||
const setUp = (props: Partial<DateInputProps> = {}) => renderWithEvents(
|
||||
<DateInput {...Mock.of<DateInputProps>(props)} />,
|
||||
<DateInput {...fromPartial<DateInputProps>(props)} />,
|
||||
);
|
||||
|
||||
it('shows calendar icon when input is not clearable', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { DateRangeSelectorProps } from '../../../src/utils/dates/DateRangeSelector';
|
||||
import { DateRangeSelector } from '../../../src/utils/dates/DateRangeSelector';
|
||||
import type { DateInterval } from '../../../src/utils/helpers/dateIntervals';
|
||||
@@ -10,7 +10,7 @@ describe('<DateRangeSelector />', () => {
|
||||
const setUp = async (props: Partial<DateRangeSelectorProps> = {}) => {
|
||||
const result = renderWithEvents(
|
||||
<DateRangeSelector
|
||||
{...Mock.of<DateRangeSelectorProps>(props)}
|
||||
{...fromPartial<DateRangeSelectorProps>(props)}
|
||||
defaultText="Default text"
|
||||
onDatesChange={onDatesChange}
|
||||
/>,
|
||||
|
||||
Reference in New Issue
Block a user