mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 15:16:28 +08:00
Merge pull request #822 from toeverything/fix/lost-entrance-of-quick-search
fix: retrieve lost entrance of quick search
This commit is contained in:
@@ -7,7 +7,7 @@ export const NotfoundPage = () => {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<PageContainer>
|
||||
<NotFoundTitle>
|
||||
<NotFoundTitle data-testid="notFound">
|
||||
{t('404 - Page Not Found')}
|
||||
<p>
|
||||
<Button
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { PropsWithChildren, ReactNode } from 'react';
|
||||
import Header from './Header';
|
||||
import QuickSearchButton from './QuickSearchButton';
|
||||
import { StyledPageListTittleWrapper } from './styles';
|
||||
// import QuickSearchButton from './QuickSearchButton';
|
||||
|
||||
@@ -12,7 +13,7 @@ export const PageListHeader = ({ icon, children }: PageListHeaderProps) => {
|
||||
<StyledPageListTittleWrapper>
|
||||
{icon}
|
||||
{children}
|
||||
{/* <QuickSearchButton style={{ marginLeft: '5px' }} /> */}
|
||||
<QuickSearchButton />
|
||||
</StyledPageListTittleWrapper>
|
||||
</Header>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { FC, SVGProps } from 'react';
|
||||
import { AllPagesIcon, FavouritesIcon, TrashIcon } from '@blocksuite/icons';
|
||||
import {
|
||||
AllPagesIcon,
|
||||
FavouritesIcon,
|
||||
TrashIcon,
|
||||
SettingsIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
|
||||
export const useSwitchToConfig = (
|
||||
@@ -23,6 +28,13 @@ export const useSwitchToConfig = (
|
||||
: '',
|
||||
icon: FavouritesIcon,
|
||||
},
|
||||
{
|
||||
title: t('Settings'),
|
||||
href: currentWorkspaceId
|
||||
? `/workspace/${currentWorkspaceId}/setting`
|
||||
: '',
|
||||
icon: SettingsIcon,
|
||||
},
|
||||
{
|
||||
title: t('Trash'),
|
||||
href: currentWorkspaceId ? `/workspace/${currentWorkspaceId}/trash` : '',
|
||||
|
||||
@@ -8,8 +8,7 @@ loadPage();
|
||||
test.describe('exception page', () => {
|
||||
test('visit 404 page', async ({ page }) => {
|
||||
await page.goto('http://localhost:8080/404');
|
||||
await page.waitForTimeout(1000);
|
||||
const notFoundTip = page.getByText('404 - Page Not Found');
|
||||
expect(await notFoundTip.isVisible()).toBe(true);
|
||||
const notFoundTip = page.locator('[data-testid=notFound]');
|
||||
await expect(notFoundTip).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@ const openQuickSearchByShortcut = async (page: Page) =>
|
||||
await withCtrlOrMeta(page, () => page.keyboard.press('k', { delay: 50 }));
|
||||
|
||||
async function assertTitleTexts(page: Page, texts: string) {
|
||||
await page.title();
|
||||
const actual = await page.evaluate(() => {
|
||||
const titleElement = <HTMLTextAreaElement>(
|
||||
document.querySelector('.affine-default-page-block-title')
|
||||
@@ -58,7 +59,7 @@ test.describe('Add new page in quick search', () => {
|
||||
await openQuickSearchByShortcut(page);
|
||||
const addNewPage = page.locator('[data-testid=quickSearch-addNewPage]');
|
||||
await addNewPage.click();
|
||||
await page.waitForTimeout(200);
|
||||
await page.waitForTimeout(300);
|
||||
await assertTitleTexts(page, '');
|
||||
});
|
||||
|
||||
@@ -68,7 +69,7 @@ test.describe('Add new page in quick search', () => {
|
||||
await page.keyboard.insertText('test123456');
|
||||
const addNewPage = page.locator('[data-testid=quickSearch-addNewPage]');
|
||||
await addNewPage.click();
|
||||
await page.waitForTimeout(200);
|
||||
await page.waitForTimeout(300);
|
||||
await assertTitleTexts(page, 'test123456');
|
||||
});
|
||||
});
|
||||
@@ -80,9 +81,11 @@ test.describe('Search and select', () => {
|
||||
await page.keyboard.insertText('test123456');
|
||||
const addNewPage = page.locator('[data-testid=quickSearch-addNewPage]');
|
||||
await addNewPage.click();
|
||||
await page.waitForTimeout(200);
|
||||
await page.waitForTimeout(300);
|
||||
await assertTitleTexts(page, 'test123456');
|
||||
await page.waitForTimeout(100);
|
||||
await openQuickSearchByShortcut(page);
|
||||
await page.keyboard.insertText('test123456');
|
||||
await page.keyboard.type('test123456');
|
||||
await assertResultList(page, ['test123456']);
|
||||
await page.keyboard.press('Enter', { delay: 50 });
|
||||
await assertTitleTexts(page, 'test123456');
|
||||
|
||||
Reference in New Issue
Block a user