Cursor rules · Automattic/wp-calypso
1 Cursor rule file from Automattic/wp-calypso: dashboard-testing.
Template by Automattic
Install
Works with Cursor. Read the repository before you give any tool access to your data.
curl -fsSL https://raw.githubusercontent.com/Automattic/wp-calypso/trunk/.cursor/rules -o rules
Read it and adapt it to your project before use.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
What's in it
Cursor project rules (.cursor/rules/*.mdc): instructions Cursor applies when it edits matching files.
- For
- Cursor
- File
.cursor/rules/dashboard-testing.mdc
First lines (shown under the repo's GPL-2.0 license)
--- description: Rules for writing tests for dashboard screen / components globs: client/dashboard/**/test/** alwaysApply: false --- # Writing tests for dashboard screens / components Tests MUST verify user-visible behavior, not implementation details. Test what a user can see or do, not how the component is built internally. CRITICAL: consult these reference examples: - @client/dashboard/sites/test/index.test.tsx - DataViews assertions - @client/dashboard/sites/overview/test/index.test.tsx - more complex assertions for cards / sections in the screen - @client/dashboard/sites/settings-php/test/index.test.tsx - form submission ## Setup - Put the test file under the `test/` subdirectory, with the same name as the component file but with the `.test.tsx` extension. - Use the component name (surrounded by `<>`) as the top-level `describe()` block. - Use `test()` instead of `it()` for test cases. - Use the custom `render()` function from @client/dashboard/test-utils.tsx — it wraps components with all required providers (QueryClient, Router, Auth, Analytics). - If the component uses `useSuspenseQuery()`, wait for a stable element (e.g., heading) before asserting. ## Assertions - Assert on what the user sees on the screen. - Query by accessible role using e.g. `screen.findByRole()`, `screen.getByRole()`, `screen.queryByRole()`, and `within()`. - Never query by test ID, CSS class, or DOM structure. - If an element isn't reachable by role, fix the component's accessibility instead. - Prefer simple, readable assertions over complex logic. ## Mocking - DO NOT mock React components, hooks, or modules. - DO NOT mock TanStack queries. - Only mock network requests at the boundary using `nock` to intercept REST API calls to `https://public-api.wordpress.com`. ## Test data - Keep test objects minimal — include only properties relevant to the test. - Use `as Type` to cast partial objects instead of filling unused fields.
Signals
- Stars
- 12,646
- Forks
- 2,038
- Open issues
- 2,778
- Last commit (this folder)
- Feb 19, 2026 (8 months ago)
- Last release
- Jun 2, 2021 (5 years ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- GPL-2.0
- Repository
- github.com/Automattic/wp-calypso
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Automattic
- 0.669score
AGENTS.md · Automattic/wp-calypso
Automattic
AGENTS.md from Automattic/wp-calypso: 113 lines covering Confidentiality, Repository layout, Clients, Packages and more.
TemplateAFreshness: A★ 12.6KCodex +5 - 0.641score
staircase-report
AutomatticOfficial
Run the staircase audience-relationship report for a customer.
SkillBFreshness: B★ 2Claude Code +9 - 0.641score
journey-report
AutomatticOfficial
Run the Journey Report — how far into the site a visit gets and where it ends.
SkillBFreshness: B★ 2Claude Code +9 - 0.635score
getting-started
AutomatticOfficial
Walk the user through first-time setup of the agentic-analytics plugin.
SkillBFreshness: B★ 2Claude Code +9 - 0.584score
identify-employees
AutomatticOfficial
Detect whether the configured customer's tracker tags employee/internal pageviews via `extra_data`, and if so, save the filter so reports exclude that traffic.
SkillCFreshness: C★ 2Claude Code +9 - 0.578score
clear-configs
AutomatticOfficial
Remove the local config files written by first-time setup (bucket.json and the agentic-analytics AWS profile).
SkillCFreshness: C★ 2Claude Code +9
Cite this page
Cursor rules · Automattic/wp-calypso. Agent Mart. https://agentmart.dev/templates/automattic-wp-calypso-cursor-rules (last updated 2026-10-24)