Skip to content

Commit 5bad107

Browse files
committed
playwright: verify that the search results page is rendered correctly
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 911e2c8 commit 5bad107

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/git-scm.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,22 @@ test('search', async ({ page }) => {
117117
await expect(searchResults.getByRole("link")).not.toHaveCount(0)
118118
await expect(searchResults.getByRole("link").nth(0)).toHaveText('git-commit')
119119

120+
// Expect the search page to show up
121+
await searchBox.press('Enter')
122+
await expect(page).toHaveURL(/\/search/)
123+
const filters = await page.getByRole('group', { name: 'Filters' })
124+
await expect(filters).toBeVisible()
125+
await expect(filters.filter({ hasText: 'Category' })).toBeVisible()
126+
127+
await expect(page.getByText(/results for commit/)).toContainText(/^\d+ results for commit$/)
128+
129+
const searchLinks = await page
130+
.getByRole('listItem')
131+
.filter({ has: page.getByRole('link', { name: 'commit' }) })
132+
await expect(searchLinks).not.toHaveCount(0)
133+
134+
await expect(page.getByRole('button', { name: 'Load more results' })).toBeVisible()
135+
120136
// On localized pages, the search results should be localized as well
121137
await page.goto(`${url}docs/git-commit/fr`)
122138
await searchBox.fill('add')

0 commit comments

Comments
 (0)