diff --git a/src/__tests__/react-native-api.test.tsx b/src/__tests__/react-native-api.test.tsx index 65f30c9f4..0989953a7 100644 --- a/src/__tests__/react-native-api.test.tsx +++ b/src/__tests__/react-native-api.test.tsx @@ -1,5 +1,12 @@ import * as React from 'react'; -import { View, Text, TextInput, Switch } from 'react-native'; +import { + View, + Text, + TextInput, + Switch, + ScrollView, + FlatList, +} from 'react-native'; import { render } from '..'; /** @@ -124,3 +131,81 @@ test('React Native API assumption: renders single host element', () => /> `); }); + +test('ScrollView renders correctly', () => { + const screen = render( + + + + ); + + expect(screen.toJSON()).toMatchInlineSnapshot(` + + + + + + `); +}); + +test('FlatList renders correctly', () => { + const screen = render( + {item}} + /> + ); + + expect(screen.toJSON()).toMatchInlineSnapshot(` + + + + + 1 + + + + + 2 + + + + + `); +}); diff --git a/src/__tests__/render.test.tsx b/src/__tests__/render.test.tsx index 8c7f102df..1546b42b9 100644 --- a/src/__tests__/render.test.tsx +++ b/src/__tests__/render.test.tsx @@ -1,6 +1,6 @@ /* eslint-disable no-console */ import * as React from 'react'; -import { View, Text, TextInput, Pressable, FlatList } from 'react-native'; +import { View, Text, TextInput, Pressable } from 'react-native'; import { getConfig, resetToDefaults } from '../config'; import { render, screen, fireEvent, RenderAPI } from '..'; @@ -254,15 +254,3 @@ test('render calls detects host component names', () => { render(); expect(getConfig().hostComponentNames).not.toBeUndefined(); }); - -test('render FlatList', () => { - const screen = render( - {item}} - /> - ); - - expect(screen.getByTestId('flatList')).toBeTruthy(); -});