Skip to content

Commit

Permalink
[Dialogs] Adding actions order tests (material-components#9829)
Browse files Browse the repository at this point in the history
Testing the orderVerticalActionsByEmphasis flag, which determines actions order in vertical layout (b/122654717).

PiperOrigin-RevId: 297348035
  • Loading branch information
galiak11 authored Mar 5, 2020
1 parent d7906ec commit 42b2e1e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/Dialogs/tests/snapshot/MDCAlertControllerActionsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,22 @@ - (void)testMediumEmphasisActionsAreJustifiedInVerticalLayout {
[self generateSnapshotAndVerifyForView:self.alertController.view];
}

#pragma mark - Vertical Order Tests

- (void)testActionsAreOrderedByEmphasis {
// Given
[self addFirstLongActionWithEmphasis:MDCActionEmphasisHigh];
[self addShortActionWithEmphasis:MDCActionEmphasisMedium cancelAction:YES];
[self.alertController applyThemeWithScheme:self.containerScheme2019];

// When
MDCAlertControllerView *view = (MDCAlertControllerView *)self.alertController.view;
view.orderVerticalActionsByEmphasis = YES;

// Then
[self generateSnapshotAndVerifyForView:self.alertController.view];
}

#pragma mark - Helpers

- (void)addFirstLongActionWithEmphasis:(MDCActionEmphasis)emphasis {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 42b2e1e

Please sign in to comment.