diff --git a/ReactCommon/fabric/mounting/tests/shadowTreeGeneration.h b/ReactCommon/fabric/mounting/tests/shadowTreeGeneration.h index b542b5d6744579..6058d9d531353b 100644 --- a/ReactCommon/fabric/mounting/tests/shadowTreeGeneration.h +++ b/ReactCommon/fabric/mounting/tests/shadowTreeGeneration.h @@ -119,17 +119,50 @@ static ShadowNode::Unshared messWithChildren( static ShadowNode::Unshared messWithLayotableOnlyFlag( Entropy const &entropy, ShadowNode const &shadowNode) { - folly::dynamic dynamic = folly::dynamic::object(); + auto oldProps = shadowNode.getProps(); + auto newProps = shadowNode.getComponentDescriptor().cloneProps( + oldProps, RawProps(folly::dynamic::object())); - if (entropy.random()) { - dynamic["collapsable"] = folly::dynamic{true}; - } else { - dynamic["collapsable"] = folly::dynamic{}; + auto &viewProps = + const_cast(static_cast(*newProps)); + + if (entropy.random(0.1)) { + viewProps.nativeId = entropy.random() ? "42" : ""; + } + + if (entropy.random(0.1)) { + viewProps.backgroundColor = + entropy.random() ? SharedColor() : whiteColor(); + } + + if (entropy.random(0.1)) { + viewProps.foregroundColor = + entropy.random() ? SharedColor() : blackColor(); + } + + if (entropy.random(0.1)) { + viewProps.shadowColor = + entropy.random() ? SharedColor() : blackColor(); + } + + if (entropy.random(0.1)) { + viewProps.accessible = entropy.random(); + } + + if (entropy.random(0.1)) { + viewProps.zIndex = entropy.random() ? 1 : 0; + } + + if (entropy.random(0.1)) { + viewProps.pointerEvents = entropy.random() ? PointerEventsMode::Auto + : PointerEventsMode::None; + } + + if (entropy.random(0.1)) { + viewProps.transform = entropy.random() ? Transform::Identity() + : Transform::Perspective(42); } - auto oldProps = shadowNode.getProps(); - auto newProps = shadowNode.getComponentDescriptor().cloneProps( - oldProps, RawProps(dynamic)); return shadowNode.clone({newProps}); }