Files
fusion/packages
gsxdsm 85ca9fe461 fix(tests): agent-detail mobile padding — jsdom cannot compute an unparsed shorthand (#2910)
## The last failure in `app:backfill 1/4`

```
AgentDetailView mobile scroll regression (FN-4231)
  > adds mobile row gaps to the overview hero for long health and skills metadata (FN-7958)
AssertionError: expected '0' to be 'var(--space-md)'
```

**Not a style regression — the CSS is unchanged.**

jsdom does not substitute `var()`, and what it does *instead* changed at
the **27 → 29** bump (`4819c2634`): a directly-declared **longhand**
still echoes its raw text, while a **shorthand** fails to parse and
computes to the initial value. Same cause as the TaskCard failures fixed
in #2782.

**The asymmetry is visible three lines above the failure** — `rowGap`
and `columnGap` assert the same kind of token and still pass, because
they are declared as longhands. Only `padding` broke, which is why this
read as a one-property regression rather than a jsdom behaviour change.

## `paddingTop` does not rescue it

That was my first attempt, and it still returns `'0'` — measured, not
assumed. jsdom cannot derive a longhand from a shorthand it failed to
parse, so **computed style cannot answer this at all**.

## The fix

Assert the **declared rule**, which is the pattern this file already
uses for its desktop counterpart:

```ts
expect(loadAllAppCssBaseOnly()).toContain("padding: var(--space-md) calc(...);");
```

One difference that matters: the **full** sheet is needed rather than
the base-only one. This padding is a mobile override inside `@media
(max-width: 480px)` (`AgentDetailView.css:2129-2131`), and
`loadAllAppCssBaseOnly` strips at-rules by design — so the obvious copy
of the neighbouring assertion would have silently matched nothing.

## Evidence

| | result |
|---|---|
| the file | **7/7** (was 1 failed) |
| mutation: mobile card padding `md → xl` | **1 failed** |

The mutation is the important one here: a regex that merely found the
`@media` block would pass regardless. It tracks the actual declaration.

`pnpm lint` clean. Test-only; `AgentDetailView.css` restored clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 18:09:20 -07:00
..
2026-07-26 18:11:47 -07:00