Skip to content

Commit

Permalink
[Shapes] Add a snapshot test for small path rendered in a large bound…
Browse files Browse the repository at this point in the history
…ing box with same borderWidth and cornerRadius.

PiperOrigin-RevId: 323814069
  • Loading branch information
attributeshift authored and material-automation committed Jul 29, 2020
1 parent 1b68b48 commit aeacc8d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions components/Shapes/tests/snapshot/MDCShapedViewSnapshotTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,25 @@ - (void)testRectShapedViewWithCornerRadius {
[self generateSnapshotAndVerifyView];
}

- (void)testSmallRectShapedViewWithCornerRadiusSameAsBoarderWidth {
// Given
MDCRectangleShapeGenerator *shapeGenerator = [[MDCRectangleShapeGenerator alloc] init];
MDCRoundedCornerTreatment *cornerTreatment = [MDCRoundedCornerTreatment cornerWithRadius:10.f];
[shapeGenerator setCorners:cornerTreatment];
shapeGenerator.topLeftCornerOffset = CGPointMake(40.f, 40.f);
shapeGenerator.topRightCornerOffset = CGPointMake(-40.f, 40.f);
shapeGenerator.bottomLeftCornerOffset = CGPointMake(40.f, -40.f);
shapeGenerator.bottomRightCornerOffset = CGPointMake(-40.f, -40.f);
((MDCShapedShadowLayer *)self.shapedView.layer).shapedBorderWidth = 10;
((MDCShapedShadowLayer *)self.shapedView.layer).shapedBorderColor = UIColor.redColor;

// When
self.shapedView.shapeGenerator = shapeGenerator;

// Then
[self generateSnapshotAndVerifyView];
}

- (void)testCurvedRectShapedViewElevation00 {
// When
self.shapedView.shapeGenerator =
Expand Down

0 comments on commit aeacc8d

Please sign in to comment.