Skip to content

Commit

Permalink
Beef up the test
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhuy committed Feb 24, 2018
1 parent d509970 commit a406cef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Tests/ASLayoutEngineTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ - (void)testLayoutTransitionWithSyncMeasurement
.onMainThread();
}];

[nodeA layoutThatFits:{{15, 1}, {15, 1}}];
[nodeA layoutThatFits:ASSizeRangeMake(fixture5.layout.size)];

// Assert that node A has layout size and size range from fixture 5
XCTAssertTrue(CGSizeEqualToSize(fixture5.layout.size, nodeA.calculatedSize));
XCTAssertTrue(ASSizeRangeEqualToSizeRange([fixture5 firstSizeRangeForNode:nodeA], nodeA.constrainedSizeForCalculatedLayout));

// Then switch to fixture 1 and kick off a synchronous layout transition
// Unapplied pending layouts from the previous measurement pass will be outdated
Expand All @@ -217,7 +221,7 @@ - (void)testLayoutTransitionWithSyncMeasurement

[nodeA transitionLayoutWithAnimation:NO shouldMeasureAsync:NO measurementCompletion:nil];

// Assert that the outdated pending layouts are ignored
// Assert that node A picks up new layout size and size range from fixture 1
XCTAssertTrue(CGSizeEqualToSize(fixture1.layout.size, nodeA.calculatedSize));
XCTAssertTrue(ASSizeRangeEqualToSizeRange([fixture1 firstSizeRangeForNode:nodeA], nodeA.constrainedSizeForCalculatedLayout));

Expand Down

0 comments on commit a406cef

Please sign in to comment.