/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict-local * @format */ 'use strict'; import type {SectionBase} from 'react-native'; import nullthrows from 'nullthrows'; const VirtualizedSectionList = require('../VirtualizedSectionList').default; const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); describe('VirtualizedSectionList', () => { it('renders simple list', async () => { let component; await ReactTestRenderer.act(() => { component = ReactTestRenderer.create( } getItem={(data, key) => data[key]} getItemCount={data => data.length} />, ); }); expect(component).toMatchSnapshot(); }); it('renders empty list', async () => { let component; await ReactTestRenderer.act(() => { component = ReactTestRenderer.create( >} renderItem={({item}) => } getItem={(data, key) => data[key]} getItemCount={data => data.length} />, ); }); expect(component).toMatchSnapshot(); }); it('renders empty list with empty component', async () => { let component; await ReactTestRenderer.act(() => { component = ReactTestRenderer.create( >} ListEmptyComponent={() => } ListFooterComponent={() =>