import React from 'react'; import { render } from '@testing-library/react-native'; import { ThemeProvider } from '@/theme/ThemeContext'; jest.mock('react-native-svg', () => { const { View } = require('react-native'); return { __esModule: true, default: View, // Svg Svg: View, Circle: View, G: View, Text: View, Rect: View, Line: View, Path: View, }; }); // GaugeArc uses Animated.createAnimatedComponent(Circle), so we need // the reanimated mock (already in jest.setup.ts) and SVG mock above. import { GaugeArc } from '@/components/GaugeArc'; const renderWithTheme = (ui: React.ReactElement) => render({ui}); describe('GaugeArc', () => { it('renders without crashing', () => { const { toJSON } = renderWithTheme( , ); expect(toJSON()).not.toBeNull(); }); it('renders with min and max values', () => { const { toJSON } = renderWithTheme( , ); expect(toJSON()).not.toBeNull(); }); it('renders with colorTo gradient', () => { const { toJSON } = renderWithTheme( , ); expect(toJSON()).not.toBeNull(); }); it('renders with custom size', () => { const { toJSON } = renderWithTheme( , ); expect(toJSON()).not.toBeNull(); }); });