mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
64e6721b23
commit
00253a2efe
+14
-7
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user