Skip to content

Commit 5b49243

Browse files
committed
Assert background color change in tapped solid-style test
1 parent 5985bd4 commit 5b49243

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

TORoundedButtonExampleTests/TORoundedButtonExampleTests.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,17 @@ - (void)testTappedBackgroundColorPathForSolidStyle {
449449
TORoundedButton *button = [[TORoundedButton alloc] initWithText:@"Tap"];
450450
button.backgroundStyle = TORoundedButtonBackgroundStyleSolid;
451451
button.tappedTintColor = [UIColor redColor];
452+
UIView *backgroundView = [button valueForKey:@"backgroundView"];
452453

453-
// With a tintable (solid) background and an explicit tapped tint, the tap sequence
454-
// exercises the background-color animation path in both directions.
454+
// For a solid background the tapped tint is applied directly as the background color.
455455
[button sendActionsForControlEvents:UIControlEventTouchDown];
456456
XCTAssertTrue([self isTappedForButton:button]);
457+
XCTAssertEqualObjects(backgroundView.backgroundColor, [UIColor redColor]);
458+
459+
// Releasing reverts the background away from the tapped tint.
457460
[button sendActionsForControlEvents:UIControlEventTouchUpInside];
458461
XCTAssertFalse([self isTappedForButton:button]);
462+
XCTAssertNotEqualObjects(backgroundView.backgroundColor, [UIColor redColor]);
459463
}
460464

461465
@end

0 commit comments

Comments
 (0)