# Instructions

- Following Playwright test failed.
- Explain why, be concise, respect Playwright best practices.
- Provide a snippet of code with the fix, if possible.

# Test info

- Name: tests/ui/county-filters.spec.ts >> blocks county filter: GEOID option values list the county's blocks
- Location: tests/ui/county-filters.spec.ts:40:7

# Error details

```
TimeoutError: page.waitForSelector: Timeout 15000ms exceeded.
Call log:
  - waiting for locator('.block-result, .block-error') to be visible

```

# Page snapshot

```yaml
- generic [ref=e1]:
  - link "← Back to Home" [ref=e2] [cursor=pointer]:
    - /url: /
  - banner [ref=e3]:
    - heading "Census Blocks" [level=1] [ref=e4]
    - paragraph [ref=e5]: Browse census blocks with voter registration data
  - generic [ref=e6]:
    - generic [ref=e7]:
      - generic [ref=e8]: Not signed in
      - generic [ref=e10]:
        - link "Log in" [ref=e11] [cursor=pointer]:
          - /url: /outpost.goauthentik.io/start?rd=http%3A%2F%2Fpreview-us-elect-info.electinfo.svc.cluster.local%2Fblocks%2F
        - link "Create an account" [ref=e12] [cursor=pointer]:
          - /url: /signin/register?rd=http%3A%2F%2Fpreview-us-elect-info.electinfo.svc.cluster.local%2Fblocks%2F
    - toolbar "Member tools" [ref=e13]:
      - button "All cycles (Sign in to use the cycle facet)" [disabled] [ref=e14] [cursor=pointer]:
        - generic [ref=e18]: All cycles
      - button "Graph (Sign in to use Graph)" [disabled] [ref=e21] [cursor=pointer]:
        - generic [ref=e30]: Graph
  - generic [ref=e33]:
    - button "Map" [ref=e34] [cursor=pointer]
    - button "List" [active] [ref=e35] [cursor=pointer]
  - main [ref=e36]:
    - generic [ref=e38]:
      - generic [ref=e39]:
        - generic [ref=e40]: "State:"
        - combobox "State:" [ref=e41] [cursor=pointer]:
          - option "Select a state..."
          - option "Alabama"
          - option "Alaska"
          - option "Arizona"
          - option "Arkansas"
          - option "California"
          - option "Colorado"
          - option "Connecticut"
          - option "Delaware"
          - option "District of Columbia"
          - option "Florida"
          - option "Georgia"
          - option "Hawaii"
          - option "Idaho"
          - option "Illinois"
          - option "Indiana"
          - option "Iowa"
          - option "Kansas"
          - option "Kentucky"
          - option "Louisiana"
          - option "Maine"
          - option "Maryland"
          - option "Massachusetts"
          - option "Michigan"
          - option "Minnesota"
          - option "Mississippi"
          - option "Missouri"
          - option "Montana"
          - option "Nebraska"
          - option "Nevada"
          - option "New Hampshire"
          - option "New Jersey"
          - option "New Mexico"
          - option "New York"
          - option "North Carolina"
          - option "North Dakota"
          - option "Ohio"
          - option "Oklahoma"
          - option "Oregon"
          - option "Pennsylvania"
          - option "Puerto Rico"
          - option "Rhode Island"
          - option "South Carolina"
          - option "South Dakota"
          - option "Tennessee"
          - option "Texas" [selected]
          - option "Utah"
          - option "Vermont"
          - option "Virginia"
          - option "Washington"
          - option "West Virginia"
          - option "Wisconsin"
          - option "Wyoming"
        - generic [ref=e42]: "County:"
        - combobox "County:" [ref=e43] [cursor=pointer]:
          - option "All Counties (254)"
          - option "Anderson County"
          - option "Andrews County"
          - option "Angelina County"
          - option "Aransas County"
          - option "Archer County"
          - option "Armstrong County"
          - option "Atascosa County"
          - option "Austin County"
          - option "Bailey County"
          - option "Bandera County"
          - option "Bastrop County"
          - option "Baylor County"
          - option "Bee County"
          - option "Bell County"
          - option "Bexar County"
          - option "Blanco County"
          - option "Borden County"
          - option "Bosque County"
          - option "Bowie County"
          - option "Brazoria County"
          - option "Brazos County"
          - option "Brewster County"
          - option "Briscoe County"
          - option "Brooks County"
          - option "Brown County"
          - option "Burleson County"
          - option "Burnet County"
          - option "Caldwell County"
          - option "Calhoun County"
          - option "Callahan County"
          - option "Cameron County"
          - option "Camp County"
          - option "Carson County"
          - option "Cass County"
          - option "Castro County"
          - option "Chambers County"
          - option "Cherokee County"
          - option "Childress County"
          - option "Clay County"
          - option "Cochran County"
          - option "Coke County"
          - option "Coleman County"
          - option "Collin County"
          - option "Collingsworth County"
          - option "Colorado County"
          - option "Comal County"
          - option "Comanche County"
          - option "Concho County"
          - option "Cooke County"
          - option "Coryell County"
          - option "Cottle County"
          - option "Crane County"
          - option "Crockett County"
          - option "Crosby County"
          - option "Culberson County"
          - option "Dallam County"
          - option "Dallas County"
          - option "Dawson County"
          - option "DeWitt County"
          - option "Deaf Smith County"
          - option "Delta County"
          - option "Denton County"
          - option "Dickens County"
          - option "Dimmit County"
          - option "Donley County"
          - option "Duval County"
          - option "Eastland County"
          - option "Ector County"
          - option "Edwards County"
          - option "El Paso County"
          - option "Ellis County"
          - option "Erath County"
          - option "Falls County"
          - option "Fannin County"
          - option "Fayette County"
          - option "Fisher County"
          - option "Floyd County"
          - option "Foard County"
          - option "Fort Bend County"
          - option "Franklin County"
          - option "Freestone County"
          - option "Frio County"
          - option "Gaines County"
          - option "Galveston County"
          - option "Garza County"
          - option "Gillespie County"
          - option "Glasscock County"
          - option "Goliad County"
          - option "Gonzales County"
          - option "Gray County"
          - option "Grayson County"
          - option "Gregg County"
          - option "Grimes County"
          - option "Guadalupe County"
          - option "Hale County"
          - option "Hall County"
          - option "Hamilton County"
          - option "Hansford County"
          - option "Hardeman County"
          - option "Hardin County"
          - option "Harris County"
          - option "Harrison County"
          - option "Hartley County"
          - option "Haskell County"
          - option "Hays County"
          - option "Hemphill County"
          - option "Henderson County"
          - option "Hidalgo County"
          - option "Hill County"
          - option "Hockley County"
          - option "Hood County"
          - option "Hopkins County"
          - option "Houston County"
          - option "Howard County"
          - option "Hudspeth County"
          - option "Hunt County"
          - option "Hutchinson County"
          - option "Irion County"
          - option "Jack County"
          - option "Jackson County"
          - option "Jasper County"
          - option "Jeff Davis County"
          - option "Jefferson County"
          - option "Jim Hogg County"
          - option "Jim Wells County"
          - option "Johnson County"
          - option "Jones County"
          - option "Karnes County"
          - option "Kaufman County"
          - option "Kendall County"
          - option "Kenedy County"
          - option "Kent County"
          - option "Kerr County"
          - option "Kimble County"
          - option "King County"
          - option "Kinney County"
          - option "Kleberg County"
          - option "Knox County"
          - option "La Salle County"
          - option "Lamar County"
          - option "Lamb County"
          - option "Lampasas County"
          - option "Lavaca County"
          - option "Lee County"
          - option "Leon County"
          - option "Liberty County"
          - option "Limestone County"
          - option "Lipscomb County"
          - option "Live Oak County"
          - option "Llano County"
          - option "Loving County"
          - option "Lubbock County"
          - option "Lynn County"
          - option "Madison County"
          - option "Marion County"
          - option "Martin County"
          - option "Mason County"
          - option "Matagorda County"
          - option "Maverick County"
          - option "McCulloch County"
          - option "McLennan County"
          - option "McMullen County"
          - option "Medina County"
          - option "Menard County"
          - option "Midland County"
          - option "Milam County"
          - option "Mills County"
          - option "Mitchell County"
          - option "Montague County"
          - option "Montgomery County"
          - option "Moore County"
          - option "Morris County"
          - option "Motley County"
          - option "Nacogdoches County"
          - option "Navarro County"
          - option "Newton County"
          - option "Nolan County"
          - option "Nueces County"
          - option "Ochiltree County"
          - option "Oldham County"
          - option "Orange County"
          - option "Palo Pinto County"
          - option "Panola County"
          - option "Parker County"
          - option "Parmer County"
          - option "Pecos County"
          - option "Polk County"
          - option "Potter County"
          - option "Presidio County"
          - option "Rains County"
          - option "Randall County"
          - option "Reagan County"
          - option "Real County"
          - option "Red River County"
          - option "Reeves County"
          - option "Refugio County"
          - option "Roberts County"
          - option "Robertson County"
          - option "Rockwall County"
          - option "Runnels County"
          - option "Rusk County"
          - option "Sabine County"
          - option "San Augustine County"
          - option "San Jacinto County"
          - option "San Patricio County"
          - option "San Saba County"
          - option "Schleicher County"
          - option "Scurry County"
          - option "Shackelford County"
          - option "Shelby County"
          - option "Sherman County"
          - option "Smith County"
          - option "Somervell County"
          - option "Starr County"
          - option "Stephens County"
          - option "Sterling County"
          - option "Stonewall County"
          - option "Sutton County"
          - option "Swisher County"
          - option "Tarrant County"
          - option "Taylor County"
          - option "Terrell County"
          - option "Terry County"
          - option "Throckmorton County"
          - option "Titus County"
          - option "Tom Green County"
          - option "Travis County" [selected]
          - option "Trinity County"
          - option "Tyler County"
          - option "Upshur County"
          - option "Upton County"
          - option "Uvalde County"
          - option "Val Verde County"
          - option "Van Zandt County"
          - option "Victoria County"
          - option "Walker County"
          - option "Waller County"
          - option "Ward County"
          - option "Washington County"
          - option "Webb County"
          - option "Wharton County"
          - option "Wheeler County"
          - option "Wichita County"
          - option "Wilbarger County"
          - option "Willacy County"
          - option "Williamson County"
          - option "Wilson County"
          - option "Winkler County"
          - option "Wise County"
          - option "Wood County"
          - option "Yoakum County"
          - option "Young County"
          - option "Zapata County"
          - option "Zavala County"
        - generic [ref=e44]:
          - textbox "Search by GEOID..." [ref=e45]
          - button "Search" [ref=e46] [cursor=pointer]
      - generic [ref=e47]:
        - generic [ref=e48]:
          - heading "Census Blocks" [level=3] [ref=e49]
          - button "Clear Filters" [ref=e50] [cursor=pointer]
        - generic [ref=e51]: Loading
```

# Test source

```ts
  1  | import { test, expect, Page } from '@playwright/test';
  2  | import { skipIfPremiumGated } from './helpers';
  3  | 
  4  | /*
  5  |  * County dropdowns on the tract, block and precinct indexes (sites#162).
  6  |  *
  7  |  * Tract.county_fips, Block.geoid_county and Precinct.county_fips hold the
  8  |  * 5-digit county GEOID. After the graph rebuild County.id became a UUID, and
  9  |  * the dropdowns, which used it as the option value, matched nothing: the tracts
  10 |  * filter timed out and blocks/precincts silently listed no counties or no results
  11 |  * (preview run 858793). Each option value must be a GEOID, and picking a county
  12 |  * must list that county's entities.
  13 |  */
  14 | 
  15 | const DATA_LOAD_TIMEOUT = 15000;
  16 | const TRAVIS = '48453'; // Travis County, TX: tracts, blocks and precincts all present
  17 | 
  18 | const KINDS = [
  19 |   { kind: 'tract', path: '/tracts/' },
  20 |   { kind: 'block', path: '/blocks/' },
  21 |   { kind: 'precinct', path: '/precincts/' },
  22 | ] as const;
  23 | 
  24 | async function openListView(page: Page, kind: string, path: string) {
  25 |   const res = await page.goto(path);
  26 |   expect(res?.status(), `${path} should answer 200`).toBe(200);
  27 |   // The list view (and its *-index.js) loads when the toggle is activated
  28 |   await page.locator('.toggle-btn[data-view="list"]').click();
  29 |   await page.waitForFunction(
  30 |     sel => {
  31 |       const s = document.querySelector(sel) as HTMLSelectElement | null;
  32 |       return !!s && s.options.length > 1;
  33 |     },
  34 |     `#${kind}-state-select`,
  35 |     { timeout: 45000 },
  36 |   );
  37 | }
  38 | 
  39 | for (const { kind, path } of KINDS) {
  40 |   test(`${kind}s county filter: GEOID option values list the county's ${kind}s`, async ({ page, request }) => {
  41 |     test.setTimeout(120000);
  42 |     await skipIfPremiumGated(request, path);
  43 |     await openListView(page, kind, path);
  44 | 
  45 |     await page.locator(`#${kind}-state-select`).selectOption('TX');
  46 |     const county = page.locator(`#${kind}-county-select`);
  47 |     await expect(county, `${path} county dropdown should enable after picking TX`).toBeEnabled({ timeout: DATA_LOAD_TIMEOUT });
  48 |     await page.waitForFunction(
  49 |       sel => {
  50 |         const s = document.querySelector(sel) as HTMLSelectElement | null;
  51 |         return !!s && s.options.length > 1;
  52 |       },
  53 |       `#${kind}-county-select`,
  54 |       { timeout: DATA_LOAD_TIMEOUT },
  55 |     );
  56 | 
  57 |     // Every county option (after "All Counties") is a 5-digit GEOID, not a graph UUID
  58 |     const values = (await county.locator('option').evaluateAll(opts => opts.map(o => (o as HTMLOptionElement).value)))
  59 |       .filter(Boolean);
  60 |     const bad = values.filter(v => !/^\d{5}$/.test(v));
  61 |     expect(bad, `${path} county option values must be 5-digit GEOIDs, got e.g. ${bad.slice(0, 3).join(', ')}`).toEqual([]);
  62 |     expect(values, `${path} should offer Travis County (${TRAVIS})`).toContain(TRAVIS);
  63 | 
  64 |     await county.selectOption(TRAVIS);
> 65 |     await page.waitForSelector(`.${kind}-result, .${kind}-error`, { timeout: DATA_LOAD_TIMEOUT });
     |                ^ TimeoutError: page.waitForSelector: Timeout 15000ms exceeded.
  66 |     const errors = page.locator(`.${kind}-error`);
  67 |     const errorText = (await errors.count()) > 0 ? await errors.first().textContent() : null;
  68 |     expect(errorText, `${path} county ${TRAVIS} should not show an error`).toBeNull();
  69 |     const count = await page.locator(`.${kind}-result`).count();
  70 |     expect(count, `${path} county ${TRAVIS} should list ${kind}s`).toBeGreaterThan(0);
  71 |   });
  72 | }
  73 | 
```