diff --git a/private/react-native-fantom/tester/src/render/RenderOutput.cpp b/private/react-native-fantom/tester/src/render/RenderOutput.cpp index 28ab558d2f2..edec6ff4680 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 f7b4a5861e7..b68623060fa 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());