From 19dc990aa198e1dc80f09a0b6de17817af4baa43 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 `Image-test.js` (#44977) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44977 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: D58643060 fbshipit-source-id: a61dfcf6cd778a8556aec874fd5e42f8e11f2be2 --- .../Libraries/Modal/__tests__/Modal-test.js | 22 +------------------ .../__snapshots__/Modal-test.js.snap | 22 ++----------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/packages/react-native/Libraries/Modal/__tests__/Modal-test.js b/packages/react-native/Libraries/Modal/__tests__/Modal-test.js index 9a3dfaf86d3..287c4204087 100644 --- a/packages/react-native/Libraries/Modal/__tests__/Modal-test.js +++ b/packages/react-native/Libraries/Modal/__tests__/Modal-test.js @@ -16,7 +16,7 @@ const View = require('../../Components/View/View'); const Modal = require('../Modal'); const React = require('react'); -describe('', () => { +describe('Modal', () => { it('should render as when mocked', () => { const instance = render.create( @@ -35,26 +35,6 @@ describe('', () => { expect(instance.toJSON()).toBeNull(); }); - it('should shallow render as when mocked', () => { - const output = render.shallow( - - - , - ); - expect(output).toMatchSnapshot(); - }); - - it('should shallow render as when not mocked', () => { - jest.dontMock('../Modal'); - - const output = render.shallow( - - - , - ); - expect(output).toMatchSnapshot(); - }); - it('should render as when not mocked', () => { jest.dontMock('../Modal'); diff --git a/packages/react-native/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap b/packages/react-native/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap index 5c2f5c57f07..a0dea0de88d 100644 --- a/packages/react-native/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap +++ b/packages/react-native/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[` should render as when mocked 1`] = ` +exports[`Modal should render as when mocked 1`] = ` should render as when mocked 1`] = ` `; -exports[` should render as when not mocked 1`] = ` +exports[`Modal should render as when not mocked 1`] = ` should render as when not mocked 1`] = ` `; - -exports[` should shallow render as when mocked 1`] = ` - - - -`; - -exports[` should shallow render as when not mocked 1`] = ` - - - -`;