mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-07-25 13:11:52 +00:00
Fix incorrect types between testing library and vitest
This commit is contained in:
@@ -16,8 +16,6 @@ describe('<DomainSelector />', () => {
|
||||
<DomainSelector value={value} domainsList={domainsList} listDomains={vi.fn()} onChange={vi.fn()} />,
|
||||
);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it.each([
|
||||
['', 'Domain', 'domains-dropdown__toggle-btn'],
|
||||
['my-domain.com', 'Domain: my-domain.com', 'domains-dropdown__toggle-btn--active'],
|
||||
|
||||
@@ -20,8 +20,6 @@ describe('<ManageDomains />', () => {
|
||||
/>,
|
||||
);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it('shows loading message while domains are loading', () => {
|
||||
setUp(fromPartial({ loading: true, filteredDomains: [] }));
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@ describe('<DomainDropdown />', () => {
|
||||
</MemoryRouter>,
|
||||
);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it('renders expected menu items', () => {
|
||||
setUp();
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ describe('<DomainStatusIcon />', () => {
|
||||
<DomainStatusIcon status={status} matchMedia={matchMedia} />,
|
||||
);
|
||||
|
||||
beforeEach(vi.clearAllMocks);
|
||||
|
||||
it.each([
|
||||
['validating' as DomainStatus],
|
||||
['invalid' as DomainStatus],
|
||||
|
||||
@@ -17,8 +17,6 @@ describe('<EditDomainRedirectsModal />', () => {
|
||||
<EditDomainRedirectsModal domain={domain} isOpen toggle={toggle} editDomainRedirects={editDomainRedirects} />,
|
||||
);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it('renders domain in header', () => {
|
||||
setUp();
|
||||
expect(screen.getByRole('heading')).toHaveTextContent('Edit redirects for foo.com');
|
||||
|
||||
@@ -4,8 +4,6 @@ import type { ShlinkDomainRedirects } from '../../../src/api/types';
|
||||
import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects';
|
||||
|
||||
describe('domainRedirectsReducer', () => {
|
||||
beforeEach(vi.clearAllMocks);
|
||||
|
||||
describe('editDomainRedirects', () => {
|
||||
const domain = 'example.com';
|
||||
const redirects = fromPartial<ShlinkDomainRedirects>({});
|
||||
|
||||
@@ -30,8 +30,6 @@ describe('domainsListReducer', () => {
|
||||
editDomainRedirectsThunk,
|
||||
);
|
||||
|
||||
beforeEach(vi.clearAllMocks);
|
||||
|
||||
describe('reducer', () => {
|
||||
it('returns loading on LIST_DOMAINS_START', () => {
|
||||
expect(reducer(undefined, listDomainsAction.pending(''))).toEqual(
|
||||
|
||||
Reference in New Issue
Block a user