fix(test): make Next Image mock alt prop optional in app-footer test#936
fix(test): make Next Image mock alt prop optional in app-footer test#936vdimarco wants to merge 1 commit into
Conversation
- Fix ESLint jsx-a11y/alt-text warning - Ensure Image mock provides alt attribute (empty string fallback) - All tests passing
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughThe test file's mocked next/image component was updated to make the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
Summary
Problem
ESLint was reporting a warning:
Changes
altprop in type definitionalt={props.alt || ''}to the img element to satisfy accessibility requirementsTesting
Verification
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com
📎 Task: https://www.terragonlabs.com/task/4d3ce2b1-0def-4eaa-8114-64a559aecd2f
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.
Greptile Overview
Greptile Summary
Fixed ESLint
jsx-a11y/alt-textwarning in theapp-footer.test.tsxtest file by updating the Next Image mock.Changes:
altprop optional in the mock's type definition (alt?: string)alt={props.alt || ''}to the renderedimgelement to ensure the alt attribute is always presentImpact:
This is a test-only change that eliminates ESLint warnings without affecting runtime behavior. The mock now correctly mirrors Next.js Image component behavior where alt can be optional but the underlying img element always receives an alt attribute.
Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant Test as Test Suite participant Mock as Next Image Mock participant ESLint as ESLint Checker Note over Test,ESLint: Before Fix Test->>Mock: Render Image (no alt specified) Mock->>Mock: Spread props to img Mock-->>Test: Renders img without alt ESLint->>Mock: Check img element ESLint-->>Test: ❌ Warning: missing alt prop Note over Test,ESLint: After Fix Test->>Mock: Render Image (no alt specified) Mock->>Mock: Check props.alt Mock->>Mock: Use props.alt || '' fallback Mock-->>Test: Renders img with alt="" ESLint->>Mock: Check img element ESLint-->>Test: ✅ No warning