/** * 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 * @oncall react_native */ import 'react-native/Libraries/Core/InitializeCore'; import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {View} from 'react-native'; describe('width and height style', () => { it('handles correct percentage-based dimensions', () => { const root = Fantom.createRoot(); Fantom.runTask(() => { root.render( , ); }); expect( root.getRenderedOutput({includeLayoutMetrics: true}).toJSX(), ).toEqual( , ); }); it('handles numeric values passed in as strings', () => { const root = Fantom.createRoot(); Fantom.runTask(() => { root.render( , ); }); expect( root.getRenderedOutput({includeLayoutMetrics: true}).toJSX(), ).toEqual( , ); }); it('handles invalid values, falling back to default', () => { const root = Fantom.createRoot(); Fantom.runTask(() => { root.render( , ); }); expect( root.getRenderedOutput({includeLayoutMetrics: true}).toJSX(), ).toEqual( , ); }); }); describe('margin style', () => { it('handles correct percentage-based values', () => { const root = Fantom.createRoot(); Fantom.runTask(() => { root.render( , ); }); expect( root.getRenderedOutput({includeLayoutMetrics: true}).toJSX(), ).toEqual( , ); }); it('handles numeric values passed in as strings', () => { const root = Fantom.createRoot(); Fantom.runTask(() => { root.render( , ); }); expect( root.getRenderedOutput({includeLayoutMetrics: true}).toJSX(), ).toEqual( , ); }); });