From cdc9597e49cd5d1acd478cdf532dd8b3c9f118d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Tue, 10 Nov 2026 03:39:07 -0800 Subject: [PATCH] Refresh LogBox Fantom snapshots for SafeAreaView (#59893) Summary: Update the inspector, header and footer snapshots to reflect the current safe-area wrappers. The previous baselines describe the old structure, causing the same snapshot mismatches on repeated runs. Correct the three-log header fixture and verify previous/next navigation, rather than duplicating the single-log case. Changelog: [Internal] Update LogBox rendering tests. Reviewed By: cortinico Differential Revision: D130672828 --- .../__tests__/LogBoxInspectorHeader-itest.js | 16 +- .../LogBoxInspector-itest.js.snap | 438 ++++++++++-------- .../LogBoxInspectorFooter-itest.js.snap | 297 +++++++----- .../LogBoxInspectorHeader-itest.js.snap | 72 ++- 4 files changed, 470 insertions(+), 353 deletions(-) diff --git a/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorHeader-itest.js b/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorHeader-itest.js index 17d10850fd2b..7b95ae6b0370 100644 --- a/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorHeader-itest.js +++ b/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorHeader-itest.js @@ -12,6 +12,7 @@ import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment'; import LogBoxInspectorHeader from '../LogBoxInspectorHeader'; import * as Fantom from '@react-native/fantom'; +import nullthrows from 'nullthrows'; import * as React from 'react'; describe('LogBoxInspectorHeader', () => { @@ -49,18 +50,29 @@ describe('LogBoxInspectorHeader', () => { it('should render two buttons for three or more total', () => { const root = Fantom.createRoot(); + const onSelectIndex = jest.fn(); Fantom.runTask(() => { root.render( {}} + onSelectIndex={onSelectIndex} selectedIndex={0} - total={1} + total={3} level="warn" />, ); }); expect(root.getRenderedOutput().toJSX()).toMatchSnapshot(); + + Fantom.dispatchNativeEvent( + nullthrows(root.document.getElementById('logbox_header_button_prev')), + 'click', + ); + Fantom.dispatchNativeEvent( + nullthrows(root.document.getElementById('logbox_header_button_next')), + 'click', + ); + expect(onSelectIndex.mock.calls).toEqual([[2], [1]]); }); it('should render syntax error header', () => { diff --git a/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspector-itest.js.snap b/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspector-itest.js.snap index f1fe5f55a826..a59895fb00fe 100644 --- a/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspector-itest.js.snap +++ b/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspector-itest.js.snap @@ -8,67 +8,69 @@ exports[`LogBoxInspector should render fatal with selectedIndex 2 1`] = ` > - - - - - Log 3 of 3 - - - + + + + > + Log 3 of 3 + + + + - - Dismiss - + + Dismiss + + - - Minimize - + + Minimize + + - - Copy - + + Copy + + @@ -197,67 +214,69 @@ exports[`LogBoxInspector should render warning with selectedIndex 0 1`] = ` > - - - - - Log 1 of 3 - - - + + + + > + Log 1 of 3 + + + + - - Dismiss - + + Dismiss + + - - Minimize - + + Minimize + + - - Copy - + + Copy + + diff --git a/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorFooter-itest.js.snap b/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorFooter-itest.js.snap index e9dfe66c817d..3d47dcfdde25 100644 --- a/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorFooter-itest.js.snap +++ b/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorFooter-itest.js.snap @@ -32,58 +32,73 @@ exports[`LogBoxInspectorFooter should render two buttons for error 1`] = ` flexDirection="row" > - - Dismiss - + + Dismiss + + - - Minimize - + + Minimize + + - - Copy - + + Copy + + `; @@ -94,58 +109,73 @@ exports[`LogBoxInspectorFooter should render two buttons for fatal 1`] = ` flexDirection="row" > - - Dismiss - + + Dismiss + + - - Minimize - + + Minimize + + - - Copy - + + Copy + + `; @@ -156,58 +186,73 @@ exports[`LogBoxInspectorFooter should render two buttons for warning 1`] = ` flexDirection="row" > - - Dismiss - + + Dismiss + + - - Minimize - + + Minimize + + - - Copy - + + Copy + + `; diff --git a/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorHeader-itest.js.snap b/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorHeader-itest.js.snap index b6136c251f63..2f617c689a0d 100644 --- a/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorHeader-itest.js.snap +++ b/packages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorHeader-itest.js.snap @@ -1,10 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`LogBoxInspectorHeader should render both buttons for two total 1`] = ` - - + - + `; exports[`LogBoxInspectorHeader should render no buttons for one total 1`] = ` - - + - + `; exports[`LogBoxInspectorHeader should render syntax error header 1`] = ` - - + Failed to compile - + `; exports[`LogBoxInspectorHeader should render two buttons for three or more total 1`] = ` - - + + > + + - Log 1 of 1 + Log 1 of 3 - + > + + + `;