test: cover memory presentation components#1875
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a Vitest + React Testing Library suite for memory presentation components and sets ChangesMemory Presentation UI Tests & a11y
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/src/components/intelligence/__tests__/MemoryPresentation.test.tsx (1)
131-133: ⚡ Quick winPrefer selection assertions over CSS-class checks.
This couples the test to
is-activestyling rather than user-observable behavior. Assert selection via accessible state (aria-selected/aria-pressed) or another visible signal to make refactors less brittle.As per coding guidelines, "Use behavior-driven testing over implementation details in Vitest unit tests, with helpers from
app/src/test/."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/components/intelligence/__tests__/MemoryPresentation.test.tsx` around lines 131 - 133, Replace the brittle CSS-class assertion that checks selectedRow.closest('button') for class "is-active" with a behavior-driven accessibility assertion: locate the interactive element (the same selectedRow and its closest('button')) and assert its accessible selection state (e.g., aria-pressed or aria-selected) using toHaveAttribute('aria-pressed','true') or toHaveAttribute('aria-selected','true'), or use getByRole(...) and assert the pressed/selected state; use the project test helpers for accessibility if available to keep the test tied to user-visible behavior rather than styling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/src/components/intelligence/__tests__/MemoryPresentation.test.tsx`:
- Around line 131-133: Replace the brittle CSS-class assertion that checks
selectedRow.closest('button') for class "is-active" with a behavior-driven
accessibility assertion: locate the interactive element (the same selectedRow
and its closest('button')) and assert its accessible selection state (e.g.,
aria-pressed or aria-selected) using toHaveAttribute('aria-pressed','true') or
toHaveAttribute('aria-selected','true'), or use getByRole(...) and assert the
pressed/selected state; use the project test helpers for accessibility if
available to keep the test tied to user-visible behavior rather than styling.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 72abe81c-40da-4d0a-accb-32ab8f1f0f66
📒 Files selected for processing (1)
app/src/components/intelligence/__tests__/MemoryPresentation.test.tsx
|
Addressed the CodeRabbit nit: MemoryResultList rows now expose the selected state via �ria-pressed, and the test asserts that accessible state instead of the styling class. |
|
Updated after CI on the latest base: empty-state assertions now accept the current Memory copy while still checking the same behavior. Local focused test, eslint, and prettier check pass. |
Summary
Refs #1870
Verification
Notes
Summary by CodeRabbit
Tests
Accessibility