From 02dfbeaaeb01494dcc966427037ca5b68cfe8820 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Sun, 16 Jun 2024 12:15:49 -0700 Subject: [PATCH] RN: Delete Shallow Renderer Cases in `Modal-test.js` (#44970) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44970 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: D58643058 fbshipit-source-id: 75c95b3ef8f9c481b50d90bf195ba3bd90196f0b --- .../Libraries/Image/__tests__/Image-test.js | 14 +---------- .../__snapshots__/Image-test.js.snap | 24 ++----------------- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/packages/react-native/Libraries/Image/__tests__/Image-test.js b/packages/react-native/Libraries/Image/__tests__/Image-test.js index 6cdedf05178..1ac3b131a49 100644 --- a/packages/react-native/Libraries/Image/__tests__/Image-test.js +++ b/packages/react-native/Libraries/Image/__tests__/Image-test.js @@ -22,24 +22,12 @@ const Image = require('../Image'); const ImageInjection = require('../ImageInjection'); const React = require('react'); -describe('', () => { +describe('Image', () => { it('should render as when mocked', () => { const instance = render.create(); expect(instance).toMatchSnapshot(); }); - it('should shallow render as when mocked', () => { - const output = render.shallow(); - expect(output).toMatchSnapshot(); - }); - - it('should shallow render as when not mocked', () => { - jest.dontMock('../Image'); - - const output = render.shallow(); - expect(output).toMatchSnapshot(); - }); - it('should render as when not mocked', () => { jest.dontMock('../Image'); diff --git a/packages/react-native/Libraries/Image/__tests__/__snapshots__/Image-test.js.snap b/packages/react-native/Libraries/Image/__tests__/__snapshots__/Image-test.js.snap index ebf417842d2..7be68b00ebc 100644 --- a/packages/react-native/Libraries/Image/__tests__/__snapshots__/Image-test.js.snap +++ b/packages/react-native/Libraries/Image/__tests__/__snapshots__/Image-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[` should render as when mocked 1`] = ` +exports[`Image should render as when mocked 1`] = ` should render as when mocked 1`] = ` /> `; -exports[` should render as when not mocked 1`] = ` +exports[`Image should render as when not mocked 1`] = ` should render as when not mocked 1`] = ` } /> `; - -exports[` should shallow render as when not mocked 1`] = ` - -`; - -exports[` should shallow render as when mocked 1`] = ` - -`;