# 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/sld-profile.spec.ts >> /districts/ak-sd-00a/: area, interactive map and related districts
- Location: tests/ui/sld-profile.spec.ts:22:7

# Error details

```
Error: apiRequestContext.get: connect ECONNREFUSED 10.1.105.22:80
Call log:
  - → GET http://10.1.105.22/districts/ak-sd-00a/
    - user-agent: Playwright/1.64.1 (x64; ubuntu 22.04) node/20.9 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br

```

# Test source

```ts
  1  | import { test, expect } from '@playwright/test';
  2  | 
  3  | /*
  4  |  * State Senate / State House district pages (sites#471), against an installed target whose serving graph has state
  5  |  * legislative Districts (preview today; production after the SLD graph release, until then these pages 404 there and
  6  |  * the test says so). The renderer (us-pages) mounts the map and related-district panel; /js/sld-profile-index.js fills
  7  |  * them from the state's TIGER layers.
  8  |  */
  9  | 
  10 | const CASES: Array<{ path: string; title: string; blocks: Record<string, RegExp> }> = [
  11 |   { path: '/districts/mn-sd-001/', title: 'Minnesota State Senate District 1',
  12 |     blocks: { contains: /State House District 1A[\s\S]*State House District 1B/, neighbours: /State Senate District 2/ } },
  13 |   { path: '/districts/mn-hd-01a/', title: 'Minnesota State House District 1A',
  14 |     blocks: { within: /^Within\s*State Senate District 1$/, neighbours: /State House District 1B/ } },
  15 |   { path: '/districts/az-sd-005/', title: 'Arizona State Senate District 5',
  16 |     blocks: { same: /State House District 5/ } },
  17 |   { path: '/districts/ak-sd-00a/', title: 'Alaska State Senate District A',
  18 |     blocks: { contains: /State House District 1[\s\S]*State House District 2/ } },
  19 | ];
  20 | 
  21 | for (const c of CASES) {
  22 |   test(`${c.path}: area, interactive map and related districts`, async ({ page, request }) => {
  23 |     test.setTimeout(90000);
> 24 |     const head = await request.get(c.path);
     |                                ^ Error: apiRequestContext.get: connect ECONNREFUSED 10.1.105.22:80
  25 |     expect(head.status(), `${c.path} should answer 200 on a graph with state legislative Districts`).toBe(200);
  26 |     const errors: string[] = [];
  27 |     page.on('pageerror', e => errors.push(e.message));
  28 |     await page.goto(c.path);
  29 |     await expect(page.locator('h1')).toHaveText(c.title);
  30 |     await expect(page.locator('#overview')).toContainText('Land Area');
  31 |     await expect(page.locator('#sld-map[data-loaded="true"] .leaflet-container')).toBeVisible({ timeout: 45000 });
  32 |     expect(await page.locator('#sld-map path[data-href]').count()).toBeGreaterThan(0);
  33 |     await expect(page.locator('#sld-related[data-loaded="true"]')).toBeAttached({ timeout: 45000 });
  34 |     for (const [id, pattern] of Object.entries(c.blocks)) {
  35 |       await expect(page.locator(`#sld-related [data-related="${id}"]`)).toHaveText(pattern);
  36 |     }
  37 |     const href = await page.locator('#sld-related [data-related="neighbours"] a, #sld-related [data-related="within"] a, #sld-related [data-related="same"] a').first().getAttribute('href');
  38 |     expect(href).toMatch(/^\/districts\/[a-z]{2}-(sd|hd)-[0-9a-z-]+\/$/);
  39 |     expect((await request.get(href!)).status(), `${href} should answer 200`).toBe(200);
  40 |     expect(errors).toEqual([]);
  41 |   });
  42 | }
  43 | 
  44 | test('Nebraska explains its one-house legislature', async ({ page, request }) => {
  45 |   const res = await request.get('/districts/ne-sd-010/');
  46 |   expect(res.status()).toBe(200);
  47 |   await page.goto('/districts/ne-sd-010/');
  48 |   await expect(page.locator('#sld-related')).toContainText('unicameral', { timeout: 45000 });
  49 | });
  50 | 
```