diff --git a/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js b/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js new file mode 100644 index 00000000000..d59f2348286 --- /dev/null +++ b/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js @@ -0,0 +1,41 @@ +/** + * 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 + */ + +import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment'; +import type {HostInstance} from 'react-native'; + +import * as Fantom from '@react-native/fantom'; +import * as React from 'react'; +import {createRef} from 'react'; +import {Modal} from 'react-native'; +import ensureInstance from 'react-native/src/private/__tests__/utilities/ensureInstance'; +import ReactNativeElement from 'react-native/src/private/webapis/dom/nodes/ReactNativeElement'; + +describe('', () => { + describe('ref', () => { + describe('exampleMethod()', () => { + // more describe('') or tests with it('') + }); + // ... more methods + describe('instance', () => { + it('uses the "RN:ModalHostView" tag name', () => { + const elementRef = createRef(); + const root = Fantom.createRoot(); + Fantom.runTask(() => { + root.render(); + }); + + expect(elementRef.current).toBeInstanceOf(ReactNativeElement); + const element = ensureInstance(elementRef.current, ReactNativeElement); + expect(element.tagName).toBe('RN:ModalHostView'); + }); + }); + }); +});