import React from 'react'; import { Image } from 'react-native'; import { render } from 'react-native-testing-library'; import { SwiperFlatList } from './SwiperFlatList'; type Item = { id: number; thumbnail: { uri: string }; }; const logo = { uri: 'https://...' }; const items: Item[] = [ { id: 1, thumbnail: logo }, { id: 2, thumbnail: logo }, ]; describe('swiper flatlist', () => { it('renders correctly', () => { const { toJSON } = render( renderItem={({ item }) => } data={items} />, ); expect(toJSON()).toMatchSnapshot(); }); it('renders empty data correctly', () => { const { toJSON } = render( renderItem={({ item }) => } data={[]} />, ); expect(toJSON()).toMatchSnapshot(); }); it('renders children', () => { const { toJSON } = render( , ); expect(toJSON()).toMatchSnapshot(); }); });