RN: Migrate LogBoxInspectorContainer-test.js from Shallow Renderer (#44985)

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

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58641095

fbshipit-source-id: 90563955876a148a2b867e0ec5128bdd8786f274
This commit is contained in:
Tim Yung
2024-06-16 10:30:39 -07:00
committed by Facebook GitHub Bot
parent 64e6721b23
commit 00253a2efe
@@ -18,9 +18,16 @@ const {
} = require('../LogBoxNotificationContainer');
const React = require('react');
// Mock `LogBoxLogNotification` because we are interested in snapshotting the
// behavior of `LogBoxNotificationContainer`, not `LogBoxLogNotification`.
jest.mock('../UI/LogBoxNotification', () => ({
__esModule: true,
default: 'LogBoxLogNotification',
}));
describe('LogBoxNotificationContainer', () => {
it('should render null with no logs', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer selectedLogIndex={-1} logs={[]} />,
);
@@ -28,7 +35,7 @@ describe('LogBoxNotificationContainer', () => {
});
it('should render null with no selected log and disabled', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
isDisabled
selectedLogIndex={-1}
@@ -52,7 +59,7 @@ describe('LogBoxNotificationContainer', () => {
});
it('should render the latest warning notification', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
selectedLogIndex={-1}
logs={[
@@ -86,7 +93,7 @@ describe('LogBoxNotificationContainer', () => {
});
it('should render the latest error notification', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
selectedLogIndex={-1}
logs={[
@@ -120,7 +127,7 @@ describe('LogBoxNotificationContainer', () => {
});
it('should render both an error and warning notification', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
selectedLogIndex={-1}
logs={[
@@ -154,7 +161,7 @@ describe('LogBoxNotificationContainer', () => {
});
it('should render selected fatal error even when disabled', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
isDisabled
selectedLogIndex={0}
@@ -178,7 +185,7 @@ describe('LogBoxNotificationContainer', () => {
});
it('should render selected syntax error even when disabled', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
isDisabled
selectedLogIndex={0}