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

@@ -1,4 +1,8 @@
import { DocCollection, IdGeneratorType, Schema } from '@blocksuite/store';
import { Schema } from '@blocksuite/store';
import {
createAutoIncrementIdGenerator,
TestWorkspace,
} from '@blocksuite/store/test';
import { describe, expect, test } from 'vitest';
import { effects } from '../effects.js';
@@ -14,7 +18,7 @@ import { testSpecs } from './test-spec.js';
effects();
function createTestOptions() {
const idGenerator = IdGeneratorType.AutoIncrement;
const idGenerator = createAutoIncrementIdGenerator();
const schema = new Schema();
schema.register([RootBlockSchema, NoteBlockSchema, HeadingBlockSchema]);
return { id: 'test-collection', idGenerator, schema };
@@ -26,7 +30,7 @@ function wait(time: number) {
describe('editor host', () => {
test('editor host should rerender model when view changes', async () => {
const collection = new DocCollection(createTestOptions());
const collection = new TestWorkspace(createTestOptions());
collection.meta.initialize();
const doc = collection.createDoc({ id: 'home' });