// // ASOverlayLayoutSpecSnapshotTests.mm // Texture // // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" #import #import static const ASSizeRange kSize = {{320, 320}, {320, 320}}; @interface ASOverlayLayoutSpecSnapshotTests : ASLayoutSpecSnapshotTestCase @end @implementation ASOverlayLayoutSpecSnapshotTests - (void)testOverlay { ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor blueColor]); ASDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor blackColor], {20, 20}); ASLayoutSpec *layoutSpec = [ASOverlayLayoutSpec overlayLayoutSpecWithChild:backgroundNode overlay: [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringXY sizingOptions:{} child:foregroundNode]]; [self testLayoutSpec:layoutSpec sizeRange:kSize subnodes:@[backgroundNode, foregroundNode] identifier: nil]; } @end