From dfe0f57311597d4d4953017bd65b2339bee2ca8e Mon Sep 17 00:00:00 2001 From: Rahul Malik Date: Wed, 28 Aug 2019 10:43:00 -0700 Subject: [PATCH] Propagate ASTraitCollection for snapshot testing (#1646) Our helper methods set the current trait collection on the node we want to snapshot but did not propagate the trait collection as expected. --- Tests/ASSnapshotTestCase.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/ASSnapshotTestCase.mm b/Tests/ASSnapshotTestCase.mm index 160b8f86..b6530b05 100644 --- a/Tests/ASSnapshotTestCase.mm +++ b/Tests/ASSnapshotTestCase.mm @@ -36,7 +36,7 @@ NSOrderedSet *ASSnapshotTestCaseDefaultSuffixes(void) // Since the goal of this method is to just to ensure a node is rendered before snapshotting, this should be reasonable default for all callers. #if AS_AT_LEAST_IOS13 if (@available(iOS 13.0, *)) { - node.primitiveTraitCollection = ASPrimitiveTraitCollectionFromUITraitCollection(UITraitCollection.currentTraitCollection); + ASTraitCollectionPropagateDown(node, ASPrimitiveTraitCollectionFromUITraitCollection(UITraitCollection.currentTraitCollection)); } #endif // #if AS_AT_LEAST_IOS13 node.displaysAsynchronously = NO;