File tree Expand file tree Collapse file tree
TORoundedButtonExampleTests Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments