fix(test): make Next Image mock alt prop optional in app-footer test #936
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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