@@ -88,24 +88,19 @@ test.describe('Search Pages', () => {
8888 test ( '/ (homepage) → search, keeps focus on search input' , async ( { page, goto } ) => {
8989 await goto ( '/' , { waitUntil : 'hydration' } )
9090
91- const homeSearchInput = page . locator ( '#home- search' )
92- await homeSearchInput . click ( )
91+ const searchInput = page . locator ( '#search-box ' )
92+ await searchInput . click ( )
9393 await page . keyboard . type ( 'vue' )
94+ await page . keyboard . press ( 'Enter' )
9495
95- // Wait for navigation to /search (debounce is 250ms)
9696 await expect ( page ) . toHaveURL ( / \/ s e a r c h / , { timeout : 10000 } )
9797
9898 await expect ( page . locator ( '[data-result-index="0"]' ) . first ( ) ) . toBeVisible ( {
9999 timeout : 15000 ,
100100 } )
101101
102- // Home search input should be gone (we're on /search now)
103- await expect ( homeSearchInput ) . not . toBeVisible ( )
104-
105- // Header search input should now exist and be focused
106- const headerSearchInput = page . locator ( '#header-search' )
107- await expect ( headerSearchInput ) . toBeVisible ( )
108- await expect ( headerSearchInput ) . toBeFocused ( )
102+ await expect ( searchInput ) . toBeVisible ( )
103+ await expect ( searchInput ) . toBeFocused ( )
109104 } )
110105
111106 test ( '/settings → search, keeps focus on search input' , async ( { page, goto } ) => {
@@ -116,14 +111,15 @@ test.describe('Search Pages', () => {
116111
117112 await searchInput . click ( )
118113 await searchInput . fill ( 'vue' )
114+ await page . keyboard . press ( 'Enter' )
119115
120116 await expect ( page ) . toHaveURL ( / \/ s e a r c h / , { timeout : 10000 } )
121117
122118 await expect ( page . locator ( '[data-result-index="0"]' ) . first ( ) ) . toBeVisible ( {
123119 timeout : 15000 ,
124120 } )
125121
126- const headerSearchInput = page . locator ( '#header- search' )
122+ const headerSearchInput = page . locator ( '#search-box ' )
127123 await expect ( headerSearchInput ) . toBeFocused ( )
128124 } )
129125} )
@@ -167,15 +163,15 @@ test.describe('Keyboard Shortcuts', () => {
167163 test ( '"c" does not navigate when search input is focused' , async ( { page, goto } ) => {
168164 await goto ( '/settings' , { waitUntil : 'hydration' } )
169165
170- const searchInput = page . locator ( '#header- search' )
166+ const searchInput = page . locator ( '#search-box ' )
171167 await searchInput . focus ( )
172168 await expect ( searchInput ) . toBeFocused ( )
173169
174170 await page . keyboard . press ( 'c' )
175171
176- // Should still be on settings, not navigated to compare
172+ // // Should still be on settings, not navigated to compare
177173 await expect ( page ) . toHaveURL ( / \/ s e t t i n g s / )
178- // The 'c' should have been typed into the input
174+ // // The 'c' should have been typed into the input
179175 await expect ( searchInput ) . toHaveValue ( 'c' )
180176 } )
181177
@@ -208,7 +204,7 @@ test.describe('Keyboard Shortcuts', () => {
208204 test ( '"," does not navigate when any modifier key is pressed' , async ( { page, goto } ) => {
209205 await goto ( '/settings' , { waitUntil : 'hydration' } )
210206
211- const searchInput = page . locator ( '#header- search' )
207+ const searchInput = page . locator ( '#search-box ' )
212208 await searchInput . focus ( )
213209 await expect ( searchInput ) . toBeFocused ( )
214210
@@ -227,7 +223,7 @@ test.describe('Keyboard Shortcuts', () => {
227223 test ( '"," does not navigate when search input is focused' , async ( { page, goto } ) => {
228224 await goto ( '/compare' , { waitUntil : 'hydration' } )
229225
230- const searchInput = page . locator ( '#header- search' )
226+ const searchInput = page . locator ( '#search-box ' )
231227 await searchInput . focus ( )
232228 await expect ( searchInput ) . toBeFocused ( )
233229
0 commit comments