mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
## Features - https://github.com/toeverything/BlockSuite/pull/7330 @CatsJuice - https://github.com/toeverything/BlockSuite/pull/7348 @zzj3720 ## Bugfix - https://github.com/toeverything/BlockSuite/pull/7338 @akumatus - https://github.com/toeverything/BlockSuite/pull/7353 @Saul-Mirone - https://github.com/toeverything/BlockSuite/pull/7351 @lawvs - https://github.com/toeverything/BlockSuite/pull/7357 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7355 @akumatus ## Misc - https://github.com/toeverything/BlockSuite/pull/7352 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7349 @pengx17
43 lines
812 B
TypeScript
43 lines
812 B
TypeScript
import { vi } from 'vitest';
|
|
|
|
vi.mock('lottie-web', () => ({
|
|
default: {},
|
|
}));
|
|
|
|
vi.mock('@blocksuite/presets', () => ({
|
|
AffineEditorContainer: vi.fn(),
|
|
BiDirectionalLinkPanel: vi.fn(),
|
|
DocMetaTags: vi.fn(),
|
|
DocTitle: vi.fn(),
|
|
EdgelessEditor: vi.fn(),
|
|
PageEditor: vi.fn(),
|
|
}));
|
|
|
|
vi.mock('@blocksuite/presets/ai', () => ({
|
|
AIProvider: {
|
|
slots: new Proxy(
|
|
{},
|
|
{
|
|
get: () => ({
|
|
on: vi.fn(),
|
|
}),
|
|
}
|
|
),
|
|
provide: vi.fn(),
|
|
},
|
|
AIEdgelessRootBlockSpec: {},
|
|
AICodeBlockSpec: {},
|
|
AIImageBlockSpec: {},
|
|
AIParagraphBlockSpec: {},
|
|
AIPageRootBlockSpec: {},
|
|
}));
|
|
|
|
if (typeof window !== 'undefined' && HTMLCanvasElement) {
|
|
// @ts-expect-error
|
|
HTMLCanvasElement.prototype.getContext = () => {
|
|
return {
|
|
fillRect: vi.fn(),
|
|
};
|
|
};
|
|
}
|