RN: Delete Shallow Renderer Cases in ImageBackground-test.js (#44980)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44980

These Jest unit test cases were making assertions about shallow rendering, but that shallow rendering is now deprecated.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643065

fbshipit-source-id: 34a31989f298535546a64c3ccd2888d648c1cdf1
This commit is contained in:
Tim Yung
2024-06-16 12:15:49 -07:00
committed by Facebook GitHub Bot
parent 19dc990aa1
commit 1c706cd03f
2 changed files with 4 additions and 58 deletions
@@ -15,7 +15,7 @@ const render = require('../../../jest/renderer');
const ImageBackground = require('../ImageBackground');
const React = require('react');
describe('<ImageBackground />', () => {
describe('ImageBackground', () => {
it('should render as <ImageBackground> when mocked', () => {
const instance = render.create(
<ImageBackground
@@ -26,28 +26,6 @@ describe('<ImageBackground />', () => {
expect(instance).toMatchSnapshot();
});
it('should shallow render as <ImageBackground> when mocked', () => {
const output = render.shallow(
<ImageBackground
style={{width: 150, height: 50}}
source={{uri: 'foo-bar.jpg'}}
/>,
);
expect(output).toMatchSnapshot();
});
it('should shallow render as <ForwardRef(ImageBackground)> when not mocked', () => {
jest.dontMock('../ImageBackground');
const output = render.shallow(
<ImageBackground
style={{width: 150, height: 50}}
source={{uri: 'foo-bar.jpg'}}
/>,
);
expect(output).toMatchSnapshot();
});
it('should render as <RCTImageView> when not mocked', () => {
jest.dontMock('../ImageBackground');
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<ImageBackground /> should be set importantForAccessibility in <View> and <Image> 1`] = `
exports[`ImageBackground should be set importantForAccessibility in <View> and <Image> 1`] = `
<View
accessibilityIgnoresInvertColors={true}
importantForAccessibility="no"
@@ -38,7 +38,7 @@ exports[`<ImageBackground /> should be set importantForAccessibility in <View> a
</View>
`;
exports[`<ImageBackground /> should render as <ImageBackground> when mocked 1`] = `
exports[`ImageBackground should render as <ImageBackground> when mocked 1`] = `
<View
accessibilityIgnoresInvertColors={true}
style={
@@ -74,7 +74,7 @@ exports[`<ImageBackground /> should render as <ImageBackground> when mocked 1`]
</View>
`;
exports[`<ImageBackground /> should render as <RCTImageView> when not mocked 1`] = `
exports[`ImageBackground should render as <RCTImageView> when not mocked 1`] = `
<View
accessibilityIgnoresInvertColors={true}
style={
@@ -109,35 +109,3 @@ exports[`<ImageBackground /> should render as <RCTImageView> when not mocked 1`]
/>
</View>
`;
exports[`<ImageBackground /> should shallow render as <ForwardRef(ImageBackground)> when not mocked 1`] = `
<ImageBackground
source={
Object {
"uri": "foo-bar.jpg",
}
}
style={
Object {
"height": 50,
"width": 150,
}
}
/>
`;
exports[`<ImageBackground /> should shallow render as <ImageBackground> when mocked 1`] = `
<ImageBackground
source={
Object {
"uri": "foo-bar.jpg",
}
}
style={
Object {
"height": 50,
"width": 150,
}
}
/>
`;