Skip to content

Commit

Permalink
Setting orderVerticalActionsByEmphasis incorrectly calculates top a…
Browse files Browse the repository at this point in the history
…nd bottom insets for actions.

PiperOrigin-RevId: 314793489
  • Loading branch information
galiak11 authored and material-automation committed Jun 4, 2020
1 parent 4e461e2 commit ba35999
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/Dialogs/tests/snapshot/MDCAlertControllerInsetsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,22 @@ - (void)testAlertActionsHaveJustifiedVerticalCustomInsets {
[self generateSizedSnapshotAndVerifyForAlert:self.alertController];
}

// Testing regression reported in: "b/157470757 - Dialog with too little bottom padding".
- (void)testAlertVerticalActionsHaveCorrectVerticalCustomInsets {
// Given
[self addActionWithTitle:kFirstLongAction];
self.alertController.actionsHorizontalAlignmentInVerticalLayout =
MDCContentHorizontalAlignmentJustified;
[self.alertController applyThemeWithScheme:self.containerScheme2019];
self.alertView.actionsInsets = UIEdgeInsetsMake(4.f, 20.f, 20.f, 20.f);

// When
self.alertController.orderVerticalActionsByEmphasis = YES;

// Then
[self generateSizedSnapshotAndVerifyForAlert:self.alertController];
}

#pragma mark - Helpers

- (void)setElementsBackgroundColors {
Expand Down

0 comments on commit ba35999

Please sign in to comment.