2023-04-15 01:07:41 +03:00
|
|
|
import { vi } from 'vitest';
|
|
|
|
|
|
|
|
vi.mock('lottie-web', () => ({
|
|
|
|
default: {},
|
|
|
|
}));
|
|
|
|
|
2024-09-20 13:55:47 +03:00
|
|
|
vi.mock('@blocksuite/affine/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-07-24 12:46:36 +03:00
|
|
|
AIChatBlockSchema: {
|
|
|
|
version: 1,
|
|
|
|
model: {
|
|
|
|
version: 1,
|
|
|
|
flavour: 'affine:embed-ai-chat',
|
|
|
|
role: 'content',
|
|
|
|
children: [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
AIChatBlockSpec: {},
|
2024-06-18 07:29:55 +03:00
|
|
|
}));
|
|
|
|
|
2023-04-15 01:07:41 +03:00
|
|
|
if (typeof window !== 'undefined' && HTMLCanvasElement) {
|
|
|
|
// @ts-expect-error
|
|
|
|
HTMLCanvasElement.prototype.getContext = () => {
|
|
|
|
return {
|
|
|
|
fillRect: vi.fn(),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|