mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 05:47:09 +08:00
feat: init @toeverything/hooks package (#1788)
This commit is contained in:
@@ -37,7 +37,6 @@ import {
|
||||
currentWorkspaceAtom,
|
||||
useCurrentWorkspace,
|
||||
} from '../current/use-current-workspace';
|
||||
import { useBlockSuiteWorkspaceName } from '../use-blocksuite-workspace-name';
|
||||
import { usePageMeta, usePageMetaHelper } from '../use-page-meta';
|
||||
import {
|
||||
REDIRECT_TIMEOUT,
|
||||
@@ -302,21 +301,6 @@ describe('useSyncRouterWithCurrentWorkspaceAndPage', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('useBlockSuiteWorkspaceName', () => {
|
||||
test('basic', async () => {
|
||||
blockSuiteWorkspace.meta.setName('test 1');
|
||||
const workspaceNameHook = renderHook(() =>
|
||||
useBlockSuiteWorkspaceName(blockSuiteWorkspace)
|
||||
);
|
||||
expect(workspaceNameHook.result.current[0]).toBe('test 1');
|
||||
blockSuiteWorkspace.meta.setName('test 2');
|
||||
workspaceNameHook.rerender();
|
||||
expect(workspaceNameHook.result.current[0]).toBe('test 2');
|
||||
workspaceNameHook.result.current[1]('test 3');
|
||||
expect(blockSuiteWorkspace.meta.name).toBe('test 3');
|
||||
});
|
||||
});
|
||||
|
||||
describe('useRecentlyViewed', () => {
|
||||
test('basic', async () => {
|
||||
const { ProviderWrapper, store } = await getJotaiContext();
|
||||
|
||||
Reference in New Issue
Block a user