From cf320d13b0d90aef907503ef2d0f9c88a5a4a7da Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Wed, 17 Jan 2024 12:42:09 +0100 Subject: [PATCH] Using non-dynamic colors --- Tests/Card Tests/CardComponentTests.swift | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Tests/Card Tests/CardComponentTests.swift b/Tests/Card Tests/CardComponentTests.swift index bfe42f32c4..de265cbd5a 100644 --- a/Tests/Card Tests/CardComponentTests.swift +++ b/Tests/Card Tests/CardComponentTests.swift @@ -408,9 +408,12 @@ class CardComponentTests: XCTestCase { var configuration = CardComponent.Configuration() + let tintColor: UIColor = .black + let titleColor: UIColor = .gray + configuration.style = { - var style = FormComponentStyle(tintColor: .systemYellow) - style.textField.title.color = .gray + var style = FormComponentStyle(tintColor: tintColor) + style.textField.title.color = titleColor return style }() @@ -425,13 +428,14 @@ class CardComponentTests: XCTestCase { let switchView: UISwitch = try XCTUnwrap(component.viewController.view.findView(with: "AdyenCard.CardComponent.storeDetailsItem.switch")) let securityCodeItemView: FormTextItemView = try XCTUnwrap(component.viewController.view.findView(with: "AdyenCard.CardComponent.securityCodeItem")) - XCTAssertEqual(securityCodeItemView.titleLabel.textColor, .gray) + wait(until: switchView, at: \.onTintColor, is: tintColor) + + wait(until: securityCodeItemView, at: \.titleLabel.textColor, is: titleColor) - self.focus(textItemView: securityCodeItemView) + focus(textItemView: securityCodeItemView) - wait(until: switchView, at: \.onTintColor, is: .systemYellow) - wait(until: securityCodeItemView, at: \.titleLabel.textColor, is: .systemYellow) - wait(until: securityCodeItemView, at: \.separatorView.backgroundColor?.cgColor, is: UIColor.systemYellow.cgColor) + wait(until: securityCodeItemView, at: \.titleLabel.textColor, is: tintColor) + wait(until: securityCodeItemView, at: \.separatorView.backgroundColor, is: tintColor) } func testSuccessTintColorCustomization() throws { @@ -2213,6 +2217,7 @@ class CardComponentTests: XCTestCase { private func focus(textItemView: some FormTextItemView) { textItemView.textField.becomeFirstResponder() + wait(until: textItemView.textField, at: \.isFirstResponder, is: true) } private enum CardViewIdentifier {