Skip to content

Commit 7de5fee

Browse files
committed
CR feedback
1 parent 93d3c09 commit 7de5fee

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

.agents/review-checklists/jest/business-logic.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Flag as a high-severity finding when the test would still pass after removing th
1717
### Exceptions / False Positives
1818

1919
- Allow explicit smoke tests when the purpose is only to verify the component/function does not throw on render or initialization.
20-
- Do not flag helper tests that intentionally validate test utilities/builders rather than product behavior, if the subject under test is the utility itself.
2120
- A simple existence assertion can be acceptable when the behavior under review is conditional presence/absence itself (for example, permission-gated rendering).
2221

2322
### Detection heuristic
@@ -53,6 +52,7 @@ expect(data[0].name).toBe('Alpha'); // This tests your test, not your code
5352
// ✅ GOOD — asserts on rendered output from that input
5453
const data = [{ name: 'Alpha', value: 10 }];
5554
render(<Table rows={data} />);
56-
expect(screen.getByText('Alpha')).toBeInTheDocument();
57-
expect(screen.getByText('10')).toBeInTheDocument();
55+
const row = screen.getByRole('row', { name: /alpha\s+10/i });
56+
expect(within(row).getByRole('cell', { name: 'Alpha' })).toBeInTheDocument();
57+
expect(within(row).getByRole('cell', { name: '10' })).toBeInTheDocument();
5858
```

.claude/skills/code-review-jest/skill.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
name: code-review-jest
3-
description: "Trigger when the user requests a review of Jest test files (e.g., `.test.tsx`, `.spec.tsx`). Supports --full flag for complete file/directory review; defaults to staged changes when a path is provided."
3+
description: "Trigger when the user requests a review of Jest test files (e.g., `.test.tsx`, `.test.ts`). Supports --full flag for complete file/directory review; defaults to staged changes when a path is provided."
44
---
55

66
# Jest Test Code Review
77

88
## Intent
9-
Use this skill whenever the user asks to review Jest test code (especially `.test.tsx`, `.spec.tsx`, `.test.ts`, or `.spec.ts` files). Support three review modes:
9+
Use this skill whenever the user asks to review Jest test code (especially `.test.tsx` or `.test.ts` files). Support three review modes:
1010

1111
1. **Pending-change review** – bare invocation with no arguments; inspects staged/working-tree
1212
files slated for commit across all repos.
@@ -36,7 +36,7 @@ Parse the invocation arguments to extract:
3636
running `find server/modules -maxdepth 2 -name ".git" -type d` from the workspace root,
3737
then for each discovered repo (and the top-level root) run `git diff --cached --name-only`
3838
and `git diff --name-only`. Aggregate all results, filtering to test file extensions
39-
(`.test.tsx`, `.spec.tsx`, `.test.ts`, `.spec.ts`).
39+
(`.test.tsx` or `.test.ts`).
4040

4141
- **Path provided (no `--full` flag — default):** Determine the git root via
4242
`git -C <path> rev-parse --show-toplevel`.

0 commit comments

Comments
 (0)