Skip to content

feat(cursor): Update react tests cursor rule with information from the dev docs #93472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 12, 2025

Conversation

malwilley
Copy link
Member

Cursor has not been very good at writing frontend tests in this codebase (often mocking way too much and not using correct conventions). I'm hoping by converting some of the info we have on develop.sentry.dev over to cursor rules we can get better quality tests out of it.

@malwilley malwilley requested a review from a team June 12, 2025 19:48
Comment on lines 39 to 40
screen.getByRole('button', { name: /save/i })
screen.getByRole('textbox', { name: /search/i })
Copy link
Member

Choose a reason for hiding this comment

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

Can we not give examples with regex, prefer the whole labels instead?

Comment on lines 45 to 46
screen.getByLabelText(/email address/i)
screen.getByPlaceholderText(/enter search term/i)
Copy link
Member

Choose a reason for hiding this comment

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

same here, otherwise we're going to end up with a lot of regex searching

Copy link
Member

Choose a reason for hiding this comment

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

We can tell it "if the string is dynamic, you can use regex"

Copy link
Member Author

Choose a reason for hiding this comment

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

I just went ahead and removed any references to the regex, I haven't seen any issues with it so far so probably not necessary

@dashed
Copy link
Member

dashed commented Jun 12, 2025

Thanks!

@malwilley malwilley merged commit cbbdf2c into master Jun 12, 2025
31 checks passed
@malwilley malwilley deleted the malwilley/feat/cursor-rule-tsx-tests branch June 12, 2025 20:45
billyvg pushed a commit that referenced this pull request Jun 18, 2025
…e dev docs (#93472)

Cursor has not been very good at writing frontend tests in this codebase
(often mocking way too much and not using correct conventions). I'm
hoping by converting some of the info we have on develop.sentry.dev over
to cursor rules we can get better quality tests out of it.
andrewshie-sentry pushed a commit that referenced this pull request Jun 19, 2025
…e dev docs (#93472)

Cursor has not been very good at writing frontend tests in this codebase
(often mocking way too much and not using correct conventions). I'm
hoping by converting some of the info we have on develop.sentry.dev over
to cursor rules we can get better quality tests out of it.
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.

3 participants