mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat: add novice guide for quick search arrow button (#1493)
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
LocalWorkspace,
|
||||
RemWorkspaceFlavour,
|
||||
} from '../../shared';
|
||||
import { useIsFirstLoad, useOpenTips } from '../affine/use-is-first-load';
|
||||
import {
|
||||
useRecentlyViewed,
|
||||
useSyncRecentViewsWithRouter,
|
||||
@@ -314,3 +315,21 @@ describe('useRecentlyViewed', () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
describe('useIsFirstLoad', () => {
|
||||
test('basic', async () => {
|
||||
const firstLoad = renderHook(() => useIsFirstLoad());
|
||||
const setFirstLoad = firstLoad.result.current[1];
|
||||
expect(firstLoad.result.current[0]).toEqual(true);
|
||||
setFirstLoad(false);
|
||||
firstLoad.rerender();
|
||||
expect(firstLoad.result.current[0]).toEqual(false);
|
||||
});
|
||||
test('useOpenTips', async () => {
|
||||
const openTips = renderHook(() => useOpenTips());
|
||||
const setOpenTips = openTips.result.current[1];
|
||||
expect(openTips.result.current[0]).toEqual(false);
|
||||
setOpenTips(true);
|
||||
openTips.rerender();
|
||||
expect(openTips.result.current[0]).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user