Fix React DOM warnings and improve pre-push hook
Some checks failed
CI/CD Pipeline (Simple) / test-and-build (push) Has been cancelled
CI/CD Pipeline (Simple) / production (push) Has been cancelled

- Fix fill and priority boolean attributes in Hero component
- Improve next/image mock in Jest setup to handle boolean props correctly
- Enhance pre-push hook with better Docker detection and error handling
- Make Docker build test non-blocking (warnings instead of errors)
- Add executable permissions for secret check script
- Prevent React DOM warnings in tests
This commit is contained in:
2025-09-12 23:34:11 +02:00
parent 83705af7f6
commit 7f6694622c
3 changed files with 24 additions and 11 deletions

View File

@@ -25,8 +25,14 @@ jest.mock('next/link', () => {
// Mock next/image
jest.mock('next/image', () => {
const ImageComponent = ({ src, alt, ...props }: Record<string, unknown>) =>
React.createElement('img', { src, alt, ...props });
const ImageComponent = ({ src, alt, fill, priority, ...props }: Record<string, unknown>) => {
// Convert boolean props to strings for DOM compatibility
const domProps: Record<string, unknown> = { src, alt };
if (fill) domProps.style = { width: '100%', height: '100%', objectFit: 'cover' };
if (priority) domProps.loading = 'eager';
return React.createElement('img', { ...domProps, ...props });
};
ImageComponent.displayName = 'Image';
return ImageComponent;
});