diff --git a/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorCodeFrame-test.js b/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorCodeFrame-test.js
index 0d27cc4f5e3..7fd6c0872fb 100644
--- a/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorCodeFrame-test.js
+++ b/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorCodeFrame-test.js
@@ -15,17 +15,34 @@ const render = require('../../../../jest/renderer');
const LogBoxInspectorCodeFrame = require('../LogBoxInspectorCodeFrame').default;
const React = require('react');
+// Mock child components because we are interested in snapshotting the behavior
+// of `LogBoxInspectorCodeFrame`, not its children.
+jest.mock('../../../Components/ScrollView/ScrollView', () => ({
+ __esModule: true,
+ default: 'ScrollView',
+}));
+jest.mock('../AnsiHighlight', () => ({
+ __esModule: true,
+ default: 'Ansi',
+}));
+jest.mock('../LogBoxButton', () => ({
+ __esModule: true,
+ default: 'LogBoxButton',
+}));
+jest.mock('../LogBoxInspectorSection', () => ({
+ __esModule: true,
+ default: 'LogBoxInspectorSection',
+}));
+
describe('LogBoxInspectorCodeFrame', () => {
it('should render null for no code frame', () => {
- const output = render.shallowRender(
- ,
- );
+ const output = render.create();
expect(output).toMatchSnapshot();
});
it('should render a code frame', () => {
- const output = render.shallowRender(
+ const output = render.create(
{
});
it('should render a code frame without a location', () => {
- const output = render.shallowRender(
+ const output = render.create(