23
blocksuite/framework/std/src/__tests__/test-spec.ts
Normal file
23
blocksuite/framework/std/src/__tests__/test-spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import './test-block.js';
|
||||
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
import { BlockViewExtension } from '../extension/index.js';
|
||||
import type { HeadingBlockModel } from './test-schema.js';
|
||||
|
||||
export const testSpecs: ExtensionType[] = [
|
||||
BlockViewExtension('test:page', literal`test-root-block`),
|
||||
|
||||
BlockViewExtension('test:note', literal`test-note-block`),
|
||||
|
||||
BlockViewExtension('test:heading', model => {
|
||||
const h = (model as HeadingBlockModel).props.type$.value;
|
||||
|
||||
if (h === 'h1') {
|
||||
return literal`test-h1-block`;
|
||||
}
|
||||
|
||||
return literal`test-h2-block`;
|
||||
}),
|
||||
];
|
||||
Reference in New Issue
Block a user