Skip to content

Stop testing skills from prompting unit tests for static styling - #182

Draft
georgewrmarshall wants to merge 5 commits into
mainfrom
cursor/skip-static-style-tests-2300
Draft

georgewrmarshall wants to merge 5 commits into
mainfrom
cursor/skip-static-style-tests-2300

Conversation

@georgewrmarshall

Copy link
Copy Markdown
Contributor

Description

Agents working on designer PRs keep adding unit tests for static styling changes. Those tests check padding values, fixed truncation props, or Tailwind margins. They don't guard behavior, and they break whenever a design token changes. Examples: metamask-mobile#36801, #36852, #36855.

The skills are the cause. The mobile unit.md says "EVERY component MUST test… all code paths" and tells agents to add testIDs whenever they update code. The extension coding guidelines say "ALWAYS write tests for new code." Neither layer policy says to skip static presentation.

Changes:

  • Layer policies (testing-layers.md, extension-testing-layers.md): new "Not worth covering: static presentation" section. Spacing, color, typography, and fixed layout props are GAP / ACCEPT. The section also covers:
    • No testID added only to read style or className.
    • Presentation that depends on state is still tested, by asserting what the user sees.
    • A coverage delta is not the reason to add or skip a test.
  • Mobile unit.md:
    • New "Do Not Test Static Presentation" section, with anti-pattern examples taken from the PRs above.
    • The mandatory coverage list now applies only once a unit test is justified.
    • Narrower testID rule.
    • Checklist and common-mistakes entries.
  • Extension unit.md: the same skip section, plus no snapshots added or refreshed for class-name-only diffs.
  • Coding guidelines (extension and mobile): test requirements now cover behavior, not styling.

The generated perps-review-pr criteria are not hand-edited. Its line about asserting "size or color" claims should be revisited upstream.

Type of Change

  • New skill
  • Skill improvement/update
  • Bug fix
  • Documentation update
  • Other (please describe):

Skill Details (if adding a new skill)

Provider Name: N/A
Skill Name: N/A
Brief Description: N/A

Checklist

  • I have read the CONTRIBUTING.md guidelines
  • My skill follows the SKILL_TEMPLATE.md format
  • I have tested this skill with an AI agent
  • My skill does not contain any secrets, private keys, or sensitive data
  • I have added appropriate documentation
  • My changes don't break existing skills

Testing

  • node --test test/*.test.mjs: 72/72 pass.
  • yarn lint:changelog: passes.
  • node .github/scripts/lint-skill-entry.mjs: 1 error, the typescript/tsc-blindspots description length. It is also on main and is unrelated to this change.
  • I read through the changed files to check that the layer policies and unit references no longer contradict each other.

Additional Context

Guiding rule: add or update a test only when it would fail if caller-visible behavior regressed. Coverage is a hint toward uncovered branches, not the gate.

Open in Web Open in Cursor 

cursoragent and others added 5 commits September 25, 2026 19:16
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants