mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
19dc990aa1
commit
1c706cd03f
@@ -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');
|
||||
|
||||
|
||||
+3
-35
@@ -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,
|
||||
}
|
||||
}
|
||||
/>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user