migrate ProgressBarAndroid from Jest to Fantom (#56302)

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

Changelog: [Internal]

migrate `ProgressBarAndroid` from Jest to Fantom

Note: AndroidProgressBar does not expose props in the Fantom rendered output, so the test only verifies that the component renders. The old Jest snapshot verified JS-level props via the shallow renderer, but those aren't available through Fantom's native rendering pipeline for this component.

Reviewed By: sammy-SC

Differential Revision: D98998943

fbshipit-source-id: 6c570eaed1639e18cb54e29920c22aa9b9397615
This commit is contained in:
Emily Brown authored and meta-codesync[bot] committed 2026-04-02 05:43:58 -07:00
1 parent 0e65df9152
commit 8915341694
3 files changed
+31 -48

No files matched your search

@@ -0,0 +1,31 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
import * as Fantom from '@react-native/fantom';
import * as React from 'react';
import {ProgressBarAndroid} from 'react-native';
describe('<ProgressBarAndroid>', () => {
it('should render as expected', () => {
const root = Fantom.createRoot();
Fantom.runTask(() => {
root.render(
<ProgressBarAndroid styleAttr="Horizontal" indeterminate={true} />,
);
});
expect(root.getRenderedOutput().toJSX()).toEqual(<rn-androidProgressBar />);
});
});
@@ -1,31 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools');
/* $FlowFixMe[cannot-resolve-module] (>=0.99.0 site=react_native_ios_fb) This
* comment suppresses an error found when Flow v0.99 was deployed. To see the
* error, delete this comment and run Flow. */
// $FlowFixMe[missing-platform-support]
const ProgressBarAndroid = require('../ProgressBarAndroid.android').default;
const React = require('react');
describe('<ProgressBarAndroid />', () => {
it('should render as expected', async () => {
await ReactNativeTestTools.expectRendersMatchingSnapshot(
'ProgressBarAndroid',
() => <ProgressBarAndroid styleAttr="Horizontal" indeterminate={true} />,
() => {
jest.dontMock('../ProgressBarAndroid');
},
);
});
});
@@ -1,17 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<ProgressBarAndroid /> should render as expected: should deep render when mocked (please verify output manually) 1`] = `
<AndroidProgressBar
animating={true}
indeterminate={true}
styleAttr="Horizontal"
/>
`;
exports[`<ProgressBarAndroid /> should render as expected: should deep render when not mocked (please verify output manually) 1`] = `
<AndroidProgressBar
animating={true}
indeterminate={true}
styleAttr="Horizontal"
/>
`;