diff --git a/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeElement-itest.js b/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeElement-itest.js index 8eaf2559a3373e..4c076862e2a47e 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeElement-itest.js +++ b/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeElement-itest.js @@ -22,6 +22,7 @@ import ensureInstance from '../../../../utilities/ensureInstance'; import HTMLCollection from '../../oldstylecollections/HTMLCollection'; import NodeList from '../../oldstylecollections/NodeList'; import ReactNativeElement from '../ReactNativeElement'; +import ReadOnlyElement from '../ReadOnlyElement'; import ReadOnlyNode from '../ReadOnlyNode'; import * as Fantom from '@react-native/fantom'; import * as React from 'react'; @@ -51,6 +52,24 @@ describe('ReactNativeElement', () => { }); describe('extends `ReadOnlyNode`', () => { + it('should be an instance of `ReadOnlyNode`', () => { + let lastNode; + + // Initial render with 3 children + const root = Fantom.createRoot(); + Fantom.runTask(() => { + root.render( + { + lastNode = node; + }} + />, + ); + }); + + expect(lastNode).toBeInstanceOf(ReadOnlyNode); + }); + describe('nodeType', () => { it('returns ReadOnlyNode.ELEMENT_NODE', () => { let lastParentNode; @@ -773,6 +792,24 @@ describe('ReactNativeElement', () => { }); describe('extends `ReadOnlyElement`', () => { + it('should be an instance of `ReadOnlyElement`', () => { + let lastNode; + + // Initial render with 3 children + const root = Fantom.createRoot(); + Fantom.runTask(() => { + root.render( + { + lastNode = node; + }} + />, + ); + }); + + expect(lastNode).toBeInstanceOf(ReadOnlyElement); + }); + describe('children / childElementCount', () => { it('return updated element children information', () => { let lastParentElement; @@ -1287,7 +1324,26 @@ describe('ReactNativeElement', () => { }); }); - describe('implements specific `ReactNativeElement` methods', () => { + describe('extends `ReactNativeElement`', () => { + it('should be an instance of `ReactNativeElement`', () => { + let lastNode; + + // Initial render with 3 children + const root = Fantom.createRoot(); + Fantom.runTask(() => { + root.render( + { + lastNode = node; + }} + />, + ); + }); + + const node = ensureReactNativeElement(lastNode); + expect(node).toBeInstanceOf(ReactNativeElement); + }); + describe('offsetWidth / offsetHeight', () => { it('return the rounded width and height, or 0 when disconnected', () => { let lastElement;