Skip to content

Commit

Permalink
[Banner] Add two test cases with icons. (#7989)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenyuzzzz committed Jul 23, 2019
1 parent 4953449 commit e852b39
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions components/Banner/tests/snapshot/MDCBannerSnapshotTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,43 @@ - (void)testSingleRowStyleLongTextWithSingleActionRTL {
[self generateSnapshotAndVerifyForView:self.bannerView];
}

- (void)testLongTextWithTwoActionsAndIconLTR {
// When
self.bannerView.textLabel.text = kBannerLongText;
MDCButton *button1 = self.bannerView.leadingButton;
[button1 setTitle:@"Action1" forState:UIControlStateNormal];
[button1 setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
button1.uppercaseTitle = YES;
MDCButton *button2 = self.bannerView.trailingButton;
[button2 setTitle:@"Action2" forState:UIControlStateNormal];
[button2 setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
button2.uppercaseTitle = YES;
self.bannerView.imageView.hidden = NO;
self.bannerView.imageView.image = [UIImage mdc_testImageOfSize:CGSizeMake(40, 40)];

// Then
[self generateSnapshotAndVerifyForView:self.bannerView];
}

- (void)testLongTextWithTwoActionsAndIconRTL {
// When
self.bannerView.textLabel.text = kBannerLongText;
MDCButton *button1 = self.bannerView.leadingButton;
[button1 setTitle:@"Action1" forState:UIControlStateNormal];
[button1 setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
button1.uppercaseTitle = YES;
MDCButton *button2 = self.bannerView.trailingButton;
[button2 setTitle:@"Action2" forState:UIControlStateNormal];
[button2 setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
button2.uppercaseTitle = YES;
self.bannerView.imageView.hidden = NO;
self.bannerView.imageView.image = [UIImage mdc_testImageOfSize:CGSizeMake(40, 40)];
[self changeViewToRTL:self.bannerView];

// Then
[self generateSnapshotAndVerifyForView:self.bannerView];
}

- (void)testDynamicTypeForContentSizeCategoryExtraExtraLarge {
if (@available(iOS 10.0, *)) {
// Given
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 e852b39

Please sign in to comment.