# 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: e2e-application-gaps.spec.ts >> GAP-S2-SEX: dataset marks sex R; female disclosure should populate sex
- Location: test/process-test/e2e-application-gaps.spec.ts:19:5

# Error details

```
Error: expect(received).toBeTruthy()

Received: undefined
```

# Test source

```ts
  1  | import { expect, test } from "@playwright/test";
  2  | import { createCase, sendChat, sendMany, STEP_SCRIPT, TO_STEP_4 } from "./helpers";
  3  | 
  4  | /**
  5  |  * Dataset/process expected behavior vs CURRENT chat+gates.
  6  |  * test.fail() = expected application gaps. Suite stays green until product is fixed
  7  |  * (then these fail as unexpected-pass and should be converted to normal tests).
  8  |  */
  9  | 
  10 | test("GAP-S4-LUNG: process HTML lists lung in disease interview; none of those should clear lung", async ({
  11 |   request,
  12 | }) => {
  13 |   test.fail(true, "R_DISEASE omits lung; none of those does not set lung=no");
  14 |   const created = await createCase(request);
  15 |   const c = await sendMany(request, created.caseId, [...TO_STEP_4, "none of those"]);
  16 |   expect(c.profile.disease_screens as Record<string, string>).toMatchObject({ lung: "no" });
  17 | });
  18 | 
  19 | test("GAP-S2-SEX: dataset marks sex R; female disclosure should populate sex", async ({ request }) => {
  20 |   test.fail(true, "heuristic extract does not set sex");
  21 |   const created = await createCase(request);
  22 |   await sendMany(request, created.caseId, ["My name is Jane Doe", "Texas", STEP_SCRIPT.intent]);
  23 |   const c = await sendChat(request, created.caseId, "I am a 40 year old woman");
  24 |   expect(c.profile.age).toBe(40);
> 25 |   expect(c.profile.sex).toBeTruthy();
     |                         ^ Error: expect(received).toBeTruthy()
  26 | });
  27 | 
  28 | test("GAP-S1-PHRASE: I want to protect my mortgage, just on me should lock intent", async ({ request }) => {
  29 |   test.fail(true, "intent regex requires 'mortgage protection', not 'protect my mortgage'");
  30 |   const created = await createCase(request);
  31 |   await sendMany(request, created.caseId, ["My name is John Smith", "Texas"]);
  32 |   const c = await sendChat(request, created.caseId, "I want to protect my mortgage, just on me");
  33 |   expect(c.profile.intent).toBe("mortgage_protection");
  34 |   expect(c.profile.coverage_on_whom).toBe("primary");
  35 | });
  36 | 
  37 | test("GAP-S6-DIALYSIS: chat I'm on dialysis should graded (stub scans attributes only)", async ({
  38 |   request,
  39 | }) => {
  40 |   test.fail(true, "stubDecision looks for 'dialysis' in attributes, chat only sets disclosed");
  41 |   const created = await createCase(request);
  42 |   const c = await sendMany(request, created.caseId, [
  43 |     STEP_SCRIPT.name,
  44 |     STEP_SCRIPT.state,
  45 |     STEP_SCRIPT.intent,
  46 |     STEP_SCRIPT.age,
  47 |     STEP_SCRIPT.loan,
  48 |     STEP_SCRIPT.build,
  49 |     "I'm on dialysis",
  50 |     "Rest of my health is good",
  51 |     STEP_SCRIPT.income,
  52 |   ]);
  53 |   expect((c.profile.decision_result as { offer_family?: string })?.offer_family).toBe("graded");
  54 | });
  55 | 
```