File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff 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 ( / \/ s e a r c h / )
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 ( / r e s u l t s f o r c o m m i t / ) ) . toContainText ( / ^ \d + r e s u l t s f o r c o m m i t $ / )
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' )
You can’t perform that action at this time.
0 commit comments