/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/Libraries/Image/__tests__/ImageBackground-test.js
50 строк
1 KB
Tim Yung
RN: Delete `@oncall` Annotations (#51416)
18 май 2025, 02:18
18 май 2025, 02:18
84de8a0
Код
Авторство
О чём код?
/** * 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'; const render = require('../../../jest/renderer'); const ImageBackground = require('../ImageBackground').default; const React = require('react'); describe('ImageBackground', () => { it('should render as <ImageBackground> when mocked', async () => { const instance = await render.create( <ImageBackground style={{width: 150, height: 50}} source={{uri: 'foo-bar.jpg'}} />, ); expect(instance).toMatchSnapshot(); }); it('should render as <RCTImageView> when not mocked', async () => { jest.dontMock('../ImageBackground'); const instance = await render.create( <ImageBackground style={{width: 150, height: 50}} source={{uri: 'foo-bar.jpg'}} />, ); expect(instance).toMatchSnapshot(); }); it('should be set importantForAccessibility in <View> and <Image>', async () => { const instance = await render.create( <ImageBackground importantForAccessibility={'no'} style={{width: 150, height: 50}} source={{uri: 'foo-bar.jpg'}} />, ); expect(instance).toMatchSnapshot(); }); });