Skip to content
Agentmart
Submit a tool

Cursor rules · Automattic/wp-calypso

1 Cursor rule file from Automattic/wp-calypso: dashboard-testing.

Template by Automattic

IndexedGPL-2.0★ 12,646
Write a review

Chalk Labs

Need help deploying Cursor rules · Automattic/wp-calypso?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

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.

We use your email only for this newsletter. Privacy

About

The .cursor/rules folder of Automattic/wp-calypso (12,646 stars): 1 rule files, 42 lines in all (dashboard-testing).

Use cases: testing

No 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
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Automattic

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get Cursor rules · Automattic/wp-calypso running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying Cursor rules · Automattic/wp-calypso?

CallGet help
Cite this page

Cursor rules · Automattic/wp-calypso. Agent Mart. https://agentmart.dev/templates/automattic-wp-calypso-cursor-rules (last updated 2026-10-24)