From 70532de2e70e8ef0ba6deda630c2d7cf12773b1a Mon Sep 17 00:00:00 2001 From: Peter Abbondanzo Date: Mon, 19 Oct 2026 17:06:40 -0700 Subject: [PATCH] Support SelectableParagraph in fantom tester Summary: The fantom test renderer only rendered text children for Paragraph nodes and its stub component registry did not register the SelectableParagraph descriptor, so selectable text fell back to an unimplemented view with empty output. Register the SelectableParagraph descriptor and render its children from ParagraphState the same way as Paragraph, so selectable text stays observable in test output. Changelog: [Internal] Differential Revision: D126186990 --- .../react-native-fantom/tester/src/render/RenderOutput.cpp | 5 ++++- .../tester/src/stubs/StubComponentRegistryFactory.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/private/react-native-fantom/tester/src/render/RenderOutput.cpp b/private/react-native-fantom/tester/src/render/RenderOutput.cpp index 28ab558d2f25..edec6ff4680b 100644 --- a/private/react-native-fantom/tester/src/render/RenderOutput.cpp +++ b/private/react-native-fantom/tester/src/render/RenderOutput.cpp @@ -50,7 +50,10 @@ folly::dynamic RenderOutput::renderView( folly::dynamic props = folly::dynamic::object; #endif - if (std::string_view(view.componentName) == "Paragraph") { + // SelectableParagraph shares ParagraphState with Paragraph; render its text + // the same way so selectable text stays observable in test output. + if (std::string_view(view.componentName) == "Paragraph" || + std::string_view(view.componentName) == "SelectableParagraph") { const auto& state = static_cast&>(*view.state); element["children"] = diff --git a/private/react-native-fantom/tester/src/stubs/StubComponentRegistryFactory.h b/private/react-native-fantom/tester/src/stubs/StubComponentRegistryFactory.h index f7b4a5861e73..b68623060fa9 100644 --- a/private/react-native-fantom/tester/src/stubs/StubComponentRegistryFactory.h +++ b/private/react-native-fantom/tester/src/stubs/StubComponentRegistryFactory.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -29,6 +30,7 @@ inline ComponentRegistryFactory getDefaultComponentRegistryFactory() providerRegistry->add(concreteComponentDescriptorProvider()); providerRegistry->add(concreteComponentDescriptorProvider()); providerRegistry->add(concreteComponentDescriptorProvider()); + providerRegistry->add(concreteComponentDescriptorProvider()); providerRegistry->add(concreteComponentDescriptorProvider()); providerRegistry->add(concreteComponentDescriptorProvider()); providerRegistry->add(concreteComponentDescriptorProvider());