experiments in a post-browser web
10
fork

Configure Feed

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

test: migrate peeks/slides/websearch off api.extensions.list to v3 strict registry

+19 -16
+13 -10
tests/desktop-serial/websearch-cmd.spec.ts
··· 126 126 // stub fires → load extension → verify → replay → execute 127 127 // The websearch extension must NOT be pre-loaded. 128 128 129 - // Verify websearch is NOT loaded yet (it's lazy, not eager) 129 + // Verify websearch is NOT loaded yet (it's lazy, not eager). 130 + // In v3 there's no "running" status on the registry — registered ≠ loaded. 131 + // The real signal for "loaded" is a live websearch tile window. 130 132 const isLoaded = await sharedBgWindow.evaluate(async () => { 131 - const result = await (window as any).app.extensions.list(); 132 - if (!result.success) return false; 133 - return result.data.some( 134 - (e: { id: string; status: string }) => e.id === 'websearch' && e.status === 'running' 133 + const result = await (window as any).app.window.list({ includeInternal: true }); 134 + if (!result?.success || !Array.isArray(result.windows)) return false; 135 + return result.windows.some( 136 + (w: { url?: string }) => (w.url || '').includes('peek://websearch/'), 135 137 ); 136 138 }); 137 139 // If it's already loaded (e.g., test order changed), skip gracefully ··· 181 183 expect(result.completed).toBe(true); 182 184 expect(result.finalState).not.toBe('ERROR'); 183 185 184 - // Verify the extension is now loaded after the lazy load 186 + // Verify the extension is now loaded after the lazy load: 187 + // a live websearch tile window should exist. 185 188 const nowLoaded = await sharedBgWindow.evaluate(async () => { 186 - const result = await (window as any).app.extensions.list(); 187 - if (!result.success) return false; 188 - return result.data.some( 189 - (e: { id: string; status: string }) => e.id === 'websearch' && e.status === 'running' 189 + const result = await (window as any).app.window.list({ includeInternal: true }); 190 + if (!result?.success || !Array.isArray(result.windows)) return false; 191 + return result.windows.some( 192 + (w: { url?: string }) => (w.url || '').includes('peek://websearch/'), 190 193 ); 191 194 }); 192 195 expect(nowLoaded).toBe(true);
+3 -3
tests/desktop/peeks.spec.ts
··· 24 24 }); 25 25 expect(addResult.success).toBe(true); 26 26 27 - // Verify peeks extension is loaded (hybrid mode: may be iframe or separate window) 27 + // Verify peeks feature is registered (v3 strict registry) 28 28 const runningExts = await bgWindow.evaluate(async () => { 29 - return await (window as any).app.extensions.list(); 29 + return await (window as any).app.features.list('builtin'); 30 30 }); 31 - const peeksRunning = runningExts.data?.some((ext: any) => ext.id === 'peeks'); 31 + const peeksRunning = runningExts.entries?.some((ext: any) => ext.id === 'peeks'); 32 32 expect(peeksRunning).toBe(true); 33 33 34 34 // Open a peek window for the address we created
+3 -3
tests/desktop/slides.spec.ts
··· 32 32 expect(result.success).toBe(true); 33 33 } 34 34 35 - // Verify slides extension is loaded (hybrid mode: may be iframe or separate window) 35 + // Verify slides feature is registered (v3 strict registry) 36 36 const runningExts = await bgWindow.evaluate(async () => { 37 - return await (window as any).app.extensions.list(); 37 + return await (window as any).app.features.list('builtin'); 38 38 }); 39 - const slidesRunning = runningExts.data?.some((ext: any) => ext.id === 'slides'); 39 + const slidesRunning = runningExts.entries?.some((ext: any) => ext.id === 'slides'); 40 40 expect(slidesRunning).toBe(true); 41 41 42 42 // Query addresses to verify they were added