From 3b8c4db8fb9ed5a12e6e712ea488ade998c9a451 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Tue, 7 Feb 2023 13:21:42 +0800 Subject: [PATCH] test: add test case for 404 search --- tests/quick-search.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/quick-search.spec.ts b/tests/quick-search.spec.ts index 4526a7e447..999057c8b0 100644 --- a/tests/quick-search.spec.ts +++ b/tests/quick-search.spec.ts @@ -94,3 +94,15 @@ test.describe('Search and select', () => { await assertTitleTexts(page, 'test123456', true); }); }); +test.describe('Disable search on 404 page', () => { + test('Navigate to the 404 page and try to open quick search', async ({ + page, + }) => { + await page.goto('http://localhost:8080/404'); + const notFoundTip = page.locator('[data-testid=notFound]'); + await expect(notFoundTip).toBeVisible(); + await openQuickSearchByShortcut(page); + const quickSearch = page.locator('[data-testid=quickSearch]'); + await expect(quickSearch).toBeVisible({ visible: false }); + }); +});