Skip to content

docs(agents): Call render() directly instead of renderFoo() helpers in tests - #132215

Merged
ryan953 merged 2 commits into
masterfrom
ryan953/ref-agents-no-render-helpers
Nov 23, 2026
Merged

ryan953 merged 2 commits into
masterfrom
ryan953/ref-agents-no-render-helpers

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Agents keep writing local renderFoo() helpers that wrap render() in frontend tests. A helper hides what each test renders and which render() options it passes.

The react-testing skill already discouraged these helpers, but its recommended fix was a wrapper component. This makes calling render(<Component />, options) directly in each test the default, and says that repeating the JSX in each test is fine. When there are many props, tests put the common ones in an object and spread them: render(<Widget {...commonProps} />).

It also adds a one-line note to static/AGENTS.md under React Testing, so agents that never load the skill still see the rule.

via @ryan953.

--

View Session [Sentry]

…n tests

Co-Authored-By: Ryan Albrecht <187460+ryan953@users.noreply.github.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 23, 2026
Co-Authored-By: Ryan Albrecht <187460+ryan953@users.noreply.github.com>
@ryan953
ryan953 marked this pull request as ready for review November 23, 2026 19:00
@ryan953
ryan953 requested a review from a team as a code owner November 23, 2026 19:00
@sentry-junior
sentry-junior Bot requested a review from ryan953 November 23, 2026 19:00
@ryan953
ryan953 requested a review from a team November 23, 2026 19:01
@ryan953
ryan953 enabled auto-merge (squash) November 23, 2026 19:01

@malwilley malwilley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do hope this helps, I've been annoyed by this as well

@ryan953
ryan953 merged commit c93a2d0 into master Nov 23, 2026
72 checks passed
@ryan953
ryan953 deleted the ryan953/ref-agents-no-render-helpers branch November 23, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants