Skip to content

Commit e87af1a

Browse files
authored
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 Pull Request resolved: #59893
1 parent 9f40f16 commit e87af1a

4 files changed

Lines changed: 470 additions & 353 deletions

File tree

‎packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorHeader-itest.js‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
1212

1313
import LogBoxInspectorHeader from '../LogBoxInspectorHeader';
1414
import * as Fantom from '@react-native/fantom';
15+
import nullthrows from 'nullthrows';
1516
import * as React from 'react';
1617

1718
describe('LogBoxInspectorHeader', () => {
@@ -49,18 +50,29 @@ describe('LogBoxInspectorHeader', () => {
4950

5051
it('should render two buttons for three or more total', () => {
5152
const root = Fantom.createRoot();
53+
const onSelectIndex = jest.fn();
5254
Fantom.runTask(() => {
5355
root.render(
5456
<LogBoxInspectorHeader
55-
onSelectIndex={() => {}}
57+
onSelectIndex={onSelectIndex}
5658
selectedIndex={0}
57-
total={1}
59+
total={3}
5860
level="warn"
5961
/>,
6062
);
6163
});
6264

6365
expect(root.getRenderedOutput().toJSX()).toMatchSnapshot();
66+
67+
Fantom.dispatchNativeEvent(
68+
nullthrows(root.document.getElementById('logbox_header_button_prev')),
69+
'click',
70+
);
71+
Fantom.dispatchNativeEvent(
72+
nullthrows(root.document.getElementById('logbox_header_button_next')),
73+
'click',
74+
);
75+
expect(onSelectIndex.mock.calls).toEqual([[2], [1]]);
6476
});
6577

6678
it('should render syntax error header', () => {

0 commit comments

Comments
 (0)