Swiftgram/Tests/ASDisplayNodeSnapshotTests.m
Garrett Moon 8013e25524 Update license v2 (#67)
* Fixed license

* Update all licenses

* Update Dangerfile for new license

* Update already updated licenses

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…
2017-04-24 16:59:57 -07:00

37 lines
1.0 KiB
Objective-C

//
// ASDisplayNodeSnapshotTests.m
// Texture
//
// Created by Adlai Holler on 8/16/16.
// Copyright © 2016 Facebook. All rights reserved.
//
#import "ASSnapshotTestCase.h"
#import <AsyncDisplayKit/AsyncDisplayKit.h>
@interface ASDisplayNodeSnapshotTests : ASSnapshotTestCase
@end
@implementation ASDisplayNodeSnapshotTests
- (void)testBasicHierarchySnapshotTesting
{
ASDisplayNode *node = [[ASDisplayNode alloc] init];
node.backgroundColor = [UIColor blueColor];
ASTextNode *subnode = [[ASTextNode alloc] init];
subnode.backgroundColor = [UIColor whiteColor];
subnode.attributedText = [[NSAttributedString alloc] initWithString:@"Hello"];
node.automaticallyManagesSubnodes = YES;
node.layoutSpecBlock = ^(ASDisplayNode * _Nonnull node, ASSizeRange constrainedSize) {
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(5, 5, 5, 5) child:subnode];
};
ASDisplayNodeSizeToFitSizeRange(node, ASSizeRangeMake(CGSizeZero, CGSizeMake(INFINITY, INFINITY)));
ASSnapshotVerifyNode(node, nil);
}
@end