@@ -12,26 +12,18 @@ test.describe('Search Pages', () => {
1212 const firstResult = page . locator ( '[data-result-index="0"]' ) . first ( )
1313 await expect ( firstResult ) . toBeVisible ( )
1414
15- // First result is selected by default, Enter navigates to it
16- // URL is /vue not /package/vue (cleaner URLs)
17- await page . keyboard . press ( 'Enter' )
18- await expect ( page ) . toHaveURL ( / \/ v u e / )
19-
20- await page . goBack ( )
21- // Wait for search page to be ready
22- await expect ( page ) . toHaveURL ( / \/ s e a r c h / )
23- await expect ( page . locator ( 'text=/found \\d+/i' ) ) . toBeVisible ( )
24- // Search input is autofocused on mount
25- await expect ( searchInput ) . toBeFocused ( )
26-
2715 // ArrowDown changes visual selection but keeps focus in input
2816 await page . keyboard . press ( 'ArrowDown' )
2917 await expect ( searchInput ) . toBeFocused ( )
3018
31- // Enter navigates to the now-selected second result
19+ // ArrowUp goes back to first result
20+ await page . keyboard . press ( 'ArrowUp' )
21+ await expect ( searchInput ) . toBeFocused ( )
22+
23+ // First result is selected, Enter navigates to it
24+ // URL is /vue not /package/vue (cleaner URLs)
3225 await page . keyboard . press ( 'Enter' )
33- // Second result could be vue-router, vuex, etc - just check we navigated away
34- await expect ( page ) . not . toHaveURL ( / \/ s e a r c h / )
26+ await expect ( page ) . toHaveURL ( / \/ v u e / )
3527 } )
3628
3729 test ( '/search?q=vue → "/" focuses the search input from results' , async ( { page, goto } ) => {
0 commit comments