/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/react-native/__tests__/intro.test.js
39 строк
1 KB
Simen Bekkhus
chore: update react-native example (#16318)
10 авг 2026, 21:43
Не верифицирован
10 авг 2026, 21:43
cfc27d4
Код
Авторство
О чём код?
// Copyright (c) Meta Platforms, Inc. and affiliates. /** * Sample React Native Snapshot Test */ import {render, screen} from '@testing-library/react-native'; import React from 'react'; import {ActivityIndicator, FlatList, Text, TextInput} from 'react-native'; import Intro from '../Intro'; jest.setTimeout(15_000); it('renders correctly', async () => { await render(<Intro />); expect(screen.toJSON()).toMatchSnapshot(); }); // These serve as integration tests for the jest-react-native preset. it('renders the ActivityIndicator component', async () => { await render(<ActivityIndicator animating={true} size="small" />); expect(screen.toJSON()).toMatchSnapshot(); }); it('renders the TextInput component', async () => { await render(<TextInput autoCorrect={false} value="apple banana kiwi" />); expect(screen.toJSON()).toMatchSnapshot(); }); it('renders the FlatList component', async () => { await render( <FlatList data={['apple', 'banana', 'kiwi']} keyExtractor={item => item} renderItem={({item}) => <Text>{item}</Text>} />, ); expect(screen.toJSON()).toMatchSnapshot(); });