mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(editor): improve api for store, and add docs (#10941)
This commit is contained in:
@@ -14,7 +14,9 @@ let model: SurfaceBlockModel;
|
||||
|
||||
beforeEach(async () => {
|
||||
const cleanup = await setupEditor('edgeless');
|
||||
const models = doc.getBlockByFlavour('affine:surface') as SurfaceBlockModel[];
|
||||
const models = doc.getModelsByFlavour(
|
||||
'affine:surface'
|
||||
) as SurfaceBlockModel[];
|
||||
|
||||
model = models[0];
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ const snapshotTest = async (snapshotUrl: string, elementsCount: number) => {
|
||||
editor.doc = newDoc;
|
||||
await wait();
|
||||
|
||||
const surface = newDoc.getBlockByFlavour(
|
||||
const surface = newDoc.getModelsByFlavour(
|
||||
'affine:surface'
|
||||
)[0] as SurfaceBlockModel;
|
||||
const surfaceElements = [...surface['_elementModels']].map(
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { Store } from '@blocksuite/store';
|
||||
import type { TestAffineEditorContainer } from '../../index.js';
|
||||
|
||||
export function getSurface(doc: Store, editor: TestAffineEditorContainer) {
|
||||
const surfaceModel = doc.getBlockByFlavour('affine:surface');
|
||||
const surfaceModel = doc.getModelsByFlavour('affine:surface');
|
||||
|
||||
return editor.host!.view.getBlock(
|
||||
surfaceModel[0]!.id
|
||||
|
||||
Reference in New Issue
Block a user