2023-04-15 01:07:41 +03:00
|
|
|
import { vi } from 'vitest';
|
|
|
|
|
|
|
|
vi.mock('lottie-web', () => ({
|
|
|
|
default: {},
|
|
|
|
}));
|
|
|
|
|
2023-12-06 13:15:03 +03:00
|
|
|
vi.mock('@blocksuite/presets', () => ({
|
2023-12-15 07:57:52 +03:00
|
|
|
AffineEditorContainer: vi.fn(),
|
2024-03-09 18:01:16 +03:00
|
|
|
BiDirectionalLinkPanel: vi.fn(),
|
|
|
|
DocMetaTags: vi.fn(),
|
|
|
|
DocTitle: vi.fn(),
|
|
|
|
EdgelessEditor: vi.fn(),
|
|
|
|
PageEditor: vi.fn(),
|
2024-06-18 07:29:55 +03:00
|
|
|
}));
|
|
|
|
|
|
|
|
vi.mock('@blocksuite/presets/ai', () => ({
|
2024-05-31 13:28:37 +03:00
|
|
|
AIProvider: {
|
|
|
|
slots: new Proxy(
|
|
|
|
{},
|
|
|
|
{
|
|
|
|
get: () => ({
|
|
|
|
on: vi.fn(),
|
|
|
|
}),
|
|
|
|
}
|
|
|
|
),
|
|
|
|
provide: vi.fn(),
|
|
|
|
},
|
|
|
|
AIEdgelessRootBlockSpec: {},
|
2024-06-07 06:14:46 +03:00
|
|
|
AICodeBlockSpec: {},
|
|
|
|
AIImageBlockSpec: {},
|
2024-05-31 13:28:37 +03:00
|
|
|
AIParagraphBlockSpec: {},
|
|
|
|
AIPageRootBlockSpec: {},
|
2023-04-15 01:07:41 +03:00
|
|
|
}));
|
|
|
|
|
|
|
|
if (typeof window !== 'undefined' && HTMLCanvasElement) {
|
|
|
|
// @ts-expect-error
|
|
|
|
HTMLCanvasElement.prototype.getContext = () => {
|
|
|
|
return {
|
|
|
|
fillRect: vi.fn(),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|