import React from 'react'; import { render } from '@testing-library/react-native'; import { SparklineChart } from '@/components/SparklineChart'; import { ThemeProvider } from '@/theme/ThemeContext'; const renderWithTheme = (ui: React.ReactElement) => render({ui}); describe('SparklineChart', () => { it('renders without crashing with data points', () => { const { toJSON } = renderWithTheme( , ); expect(toJSON()).not.toBeNull(); }); it('renders with empty data array', () => { const { toJSON } = renderWithTheme(); expect(toJSON()).not.toBeNull(); }); it('renders with single data point', () => { const { toJSON } = renderWithTheme(); expect(toJSON()).not.toBeNull(); }); it('renders with custom color', () => { const { toJSON } = renderWithTheme( , ); expect(toJSON()).not.toBeNull(); }); it('renders with custom height', () => { const { toJSON } = renderWithTheme( , ); expect(toJSON()).not.toBeNull(); }); it('has an image accessibility role', () => { const { getByRole } = renderWithTheme( , ); expect(getByRole('image')).toBeTruthy(); }); it('renders with all identical values', () => { const { toJSON } = renderWithTheme( , ); expect(toJSON()).not.toBeNull(); }); });