mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-20 05:26:20 +00:00
Fix incorrect types between testing library and vitest
This commit is contained in:
@@ -7,8 +7,6 @@ describe('<AppUpdateBanner />', () => {
|
||||
const forceUpdate = vi.fn();
|
||||
const setUp = () => renderWithEvents(<AppUpdateBanner isOpen toggle={toggle} forceUpdate={forceUpdate} />);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it('renders initial state', () => {
|
||||
setUp();
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ describe('<ErrorHandler />', () => {
|
||||
beforeEach(() => {
|
||||
vi.spyOn(console, 'error').mockImplementation(() => {}); // Silence react errors
|
||||
});
|
||||
afterEach(vi.resetAllMocks);
|
||||
|
||||
it('renders children when no error has occurred', () => {
|
||||
render(<ErrorHandler children={<span>Foo</span>} />);
|
||||
|
||||
@@ -44,8 +44,6 @@ describe('<MenuLayout />', () => {
|
||||
(useParams as any).mockReturnValue({ serverId: 'abc123' });
|
||||
});
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it('shows loading indicator while loading server', () => {
|
||||
setUp(null);
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ describe('HttpClient', () => {
|
||||
const fetch = vi.fn();
|
||||
const httpClient = new HttpClient(fetch);
|
||||
|
||||
beforeEach(vi.clearAllMocks);
|
||||
|
||||
describe('fetchJson', () => {
|
||||
it('throws json on success', async () => {
|
||||
const theError = { error: true, foo: 'bar' };
|
||||
|
||||
@@ -7,7 +7,6 @@ describe('ReportExporter', () => {
|
||||
const jsonToCsv = vi.fn();
|
||||
let exporter: ReportExporter;
|
||||
|
||||
beforeEach(vi.clearAllMocks);
|
||||
beforeEach(() => {
|
||||
(global as any).Blob = class Blob {};
|
||||
(global as any).URL = { createObjectURL: () => '' };
|
||||
|
||||
Reference in New Issue
Block a user