chore(editor): move legacy doc collection to test workspace (#9507)

This commit is contained in:
Saul-Mirone
2025-01-03 09:40:33 +00:00
parent cfd64f1fa5
commit 51b109ee53
26 changed files with 128 additions and 193 deletions

View File

@@ -6,20 +6,21 @@ import 'fake-indexeddb/auto';
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
import { assertExists } from '@blocksuite/affine/global/utils';
import type { Doc } from '@blocksuite/affine/store';
import { DocCollection, Schema } from '@blocksuite/affine/store';
import { Schema } from '@blocksuite/store';
import { TestWorkspace } from '@blocksuite/store/test';
import { renderHook } from '@testing-library/react';
import { useAtomValue } from 'jotai';
import { beforeEach, describe, expect, test, vi } from 'vitest';
import { useBlockSuitePagePreview } from '../use-block-suite-page-preview';
let docCollection: DocCollection;
let docCollection: TestWorkspace;
const schema = new Schema();
schema.register(AffineSchemas);
beforeEach(async () => {
vi.useFakeTimers({ toFake: ['requestIdleCallback'] });
docCollection = new DocCollection({ id: 'test', schema });
docCollection = new TestWorkspace({ id: 'test', schema });
docCollection.meta.initialize();
const initPage = async (page: Doc) => {
page.load();