Debian Codegraph @

www/tests/e2e/debug-search.ts

raw symbols SCIP
1 import { test, expect } from './_fixtures';
2 test('debug search indicator', async ({ page }) => {
3 await page.goto('/patterns/forms/active-search');
4 await page.waitForTimeout(3000);
5
6 const spinner = page.locator('#search-spinner');
7 const exists = await spinner.count();
8 console.log('SPINNER_EXISTS:', exists);
9
10 if (exists) {
11 const classes = await spinner.getAttribute('class');
12 console.log('SPINNER_CLASSES:', classes);
13 const styles = await spinner.evaluate(el => {
14 const cs = getComputedStyle(el);
15 return { opacity: cs.opacity, display: cs.display, visibility: cs.visibility, width: cs.width, height: cs.height };
16 });
17 console.log('SPINNER_STYLES:', JSON.stringify(styles));
18 }
19
20 // Type to trigger a search
21 const input = page.locator('#demo-content input[type="search"]');
22 await input.fill('V');
23
24 // Check spinner immediately while request is in flight
25 await page.waitForTimeout(50);
26 if (exists) {
27 const classes2 = await spinner.getAttribute('class');
28 console.log('SPINNER_DURING_REQUEST:', classes2);
29 const styles2 = await spinner.evaluate(el => getComputedStyle(el).opacity);
30 console.log('SPINNER_OPACITY_DURING:', styles2);
31 }
32 });