Use external shlink-web-component and remove local one

This commit is contained in:
Alejandro Celaya
2023-08-14 12:15:57 +02:00
parent 8aa149cac4
commit 6d910519bc
310 changed files with 94 additions and 20244 deletions

View File

@@ -1,9 +1,6 @@
import 'vitest-canvas-mock';
import 'chart.js/auto';
import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers';
import matchers from '@testing-library/jest-dom/matchers';
import { cleanup } from '@testing-library/react';
import ResizeObserver from 'resize-observer-polyfill';
import { afterEach, expect } from 'vitest';
// Workaround for TypeScript error: https://github.com/testing-library/jest-dom/issues/439#issuecomment-1536524120
@@ -14,15 +11,10 @@ declare module 'vitest' {
// Extends Vitest's expect method with methods from react-testing-library
expect.extend(matchers);
// Clear all mocks and cleanup DOM after every test
afterEach(() => {
// Clears all mocks after every test
vi.clearAllMocks();
// Run a cleanup after each test case (e.g. clearing jsdom)
cleanup();
});
(global as any).ResizeObserver = ResizeObserver;
(global as any).scrollTo = () => {};
(global as any).prompt = () => {};
(global as any).matchMedia = (media: string) => ({ matches: false, media });
(global as any).HTMLElement.prototype.scrollIntoView = () => {};