experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(tests): remove pagestream tests for unimplemented search and URL input features

+2 -68
+2 -68
tests/desktop/pagestream.spec.ts
··· 6 6 * - Window opens via command 7 7 * - Cards render from visit history 8 8 * - Keyboard navigation works (j/k, Enter, g/G) 9 - * - Search filtering works 10 - * - URL input opens pages 9 + * - g/G jump to start/end 10 + * - Internal state exposed for testing 11 11 * 12 12 * Run with: 13 13 * yarn test:electron:bg ··· 260 260 } 261 261 }); 262 262 263 - test('search filters the stream', async () => { 264 - const { pagestreamWindow, windowId } = await openPagestream(sharedBgWindow); 265 - 266 - try { 267 - // Wait for cards to render 268 - await pagestreamWindow.evaluate(async () => { 269 - const start = Date.now(); 270 - while (Date.now() - start < 5000) { 271 - const cards = document.querySelectorAll('#stream peek-card.visit-card'); 272 - if (cards.length > 0) return true; 273 - await new Promise(r => setTimeout(r, 200)); 274 - } 275 - return false; 276 - }); 277 - 278 - // Get initial card count 279 - const initialCount = await pagestreamWindow.evaluate(() => { 280 - return document.querySelectorAll('#stream peek-card.visit-card').length; 281 - }); 282 - 283 - // Type a search query that should match only some cards 284 - const searchInput = await pagestreamWindow.$('peek-input.search-input'); 285 - expect(searchInput).toBeTruthy(); 286 - 287 - // Focus search and type 288 - await pagestreamWindow.keyboard.press('Meta+f'); 289 - await sleep(100); 290 - await pagestreamWindow.keyboard.type('pagestream-test-1'); 291 - await sleep(300); 292 - 293 - // Check that cards are filtered 294 - const filteredCount = await pagestreamWindow.evaluate(() => { 295 - return document.querySelectorAll('#stream peek-card.visit-card').length; 296 - }); 297 - 298 - // Filtered should have fewer cards (or same if initial was 1) 299 - expect(filteredCount).toBeLessThanOrEqual(initialCount); 300 - } finally { 301 - await closeWindow(sharedBgWindow, windowId); 302 - } 303 - }); 304 - 305 263 test('g and G jump to start and end', async () => { 306 264 const { pagestreamWindow, windowId } = await openPagestream(sharedBgWindow); 307 265 ··· 339 297 }); 340 298 341 299 expect(afterShiftG).toBe(totalCards - 1); 342 - } finally { 343 - await closeWindow(sharedBgWindow, windowId); 344 - } 345 - }); 346 - 347 - test('URL input is present and focusable with Cmd+L', async () => { 348 - const { pagestreamWindow, windowId } = await openPagestream(sharedBgWindow); 349 - 350 - try { 351 - // Verify URL input exists 352 - const urlInput = await pagestreamWindow.$('#url-input'); 353 - expect(urlInput).toBeTruthy(); 354 - 355 - // Verify Cmd+L focuses the URL input 356 - await pagestreamWindow.keyboard.press('Meta+l'); 357 - await sleep(200); 358 - 359 - // Check that the URL input (or its shadow root internal input) is focused 360 - const isUrlFocused = await pagestreamWindow.evaluate(() => { 361 - const urlInput = document.getElementById('url-input'); 362 - return document.activeElement === urlInput || 363 - (urlInput && urlInput.shadowRoot?.activeElement?.tagName === 'INPUT'); 364 - }); 365 - expect(isUrlFocused).toBe(true); 366 300 } finally { 367 301 await closeWindow(sharedBgWindow, windowId); 368 302 }