mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
feat: add preloading template
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import 'fake-indexeddb/auto';
|
||||
|
||||
import { initPage } from '@affine/env/blocksuite';
|
||||
import { initEmptyPage } from '@affine/env/blocksuite';
|
||||
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
|
||||
import { Workspace } from '@blocksuite/store';
|
||||
import { renderHook } from '@testing-library/react';
|
||||
@@ -20,9 +20,9 @@ beforeEach(() => {
|
||||
})
|
||||
.register(AffineSchemas)
|
||||
.register(__unstableSchemas);
|
||||
initPage(blockSuiteWorkspace.createPage({ id: 'page0' }));
|
||||
initPage(blockSuiteWorkspace.createPage({ id: 'page1' }));
|
||||
initPage(blockSuiteWorkspace.createPage({ id: 'page2' }));
|
||||
initEmptyPage(blockSuiteWorkspace.createPage({ id: 'page0' }));
|
||||
initEmptyPage(blockSuiteWorkspace.createPage({ id: 'page1' }));
|
||||
initEmptyPage(blockSuiteWorkspace.createPage({ id: 'page2' }));
|
||||
});
|
||||
|
||||
describe('useBlockSuiteWorkspaceHelper', () => {
|
||||
@@ -50,7 +50,7 @@ describe('useBlockSuiteWorkspaceHelper', () => {
|
||||
);
|
||||
await helperHook.result.current.markMilestone('test');
|
||||
expect(blockSuiteWorkspace.meta.pageMetas.length).toBe(3);
|
||||
initPage(helperHook.result.current.createPage('page4'));
|
||||
initEmptyPage(helperHook.result.current.createPage('page4'));
|
||||
expect(blockSuiteWorkspace.meta.pageMetas.length).toBe(4);
|
||||
expect(await helperHook.result.current.listMilestone()).toHaveProperty(
|
||||
'test'
|
||||
|
||||
@@ -16,8 +16,6 @@ declare module '@blocksuite/store' {
|
||||
updatedDate?: number;
|
||||
mode?: 'page' | 'edgeless';
|
||||
jumpOnce?: boolean;
|
||||
// whether to create the page with the default template
|
||||
init?: boolean;
|
||||
// todo: support `number` in the future
|
||||
isPublic?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user