@@ -103,6 +103,17 @@ class SkyFloatingLabelTextFieldTests: XCTestCase { // swiftlint:disable:this typ
103103 XCTAssertEqual ( floatingLabelTextField. titleLabel. textColor, self . customColor)
104104 }
105105
106+ func test_whenSettingTitleErrorColor_withErrorMessageBeingSet_thenTitleLabelTextColorIsChangedToThisColor( ) {
107+ // given
108+ floatingLabelTextField. errorMessage = " test "
109+
110+ // when
111+ floatingLabelTextField. titleErrorColor = self . customColor
112+
113+ // then
114+ XCTAssertEqual ( floatingLabelTextField. titleLabel. textColor, self . customColor)
115+ }
116+
106117 func test_whenSettingErrorColor_withErrorMessageBeingEmpty_thenTitleLabelTextColorIsNotChangedToThisColor( ) {
107118 // given
108119 floatingLabelTextField. errorMessage = " "
@@ -114,6 +125,17 @@ class SkyFloatingLabelTextFieldTests: XCTestCase { // swiftlint:disable:this typ
114125 XCTAssertNotEqual ( floatingLabelTextField. titleLabel. textColor, self . customColor)
115126 }
116127
128+ func test_whenSettingTitleErrorColor_withErrorMessageBeingEmpty_thenTitleLabelTextColorIsNotChangedToThisColor( ) {
129+ // given
130+ floatingLabelTextField. errorMessage = " "
131+
132+ // when
133+ floatingLabelTextField. titleErrorColor = self . customColor
134+
135+ // then
136+ XCTAssertNotEqual ( floatingLabelTextField. titleLabel. textColor, self . customColor)
137+ }
138+
117139 func test_whenSettingErrorColor_withErrorMessageBeingNil_thenTitleLabelTextColorIsNotChangedToThisColor( ) {
118140 // given
119141 floatingLabelTextField. errorMessage = nil
@@ -125,6 +147,17 @@ class SkyFloatingLabelTextFieldTests: XCTestCase { // swiftlint:disable:this typ
125147 XCTAssertNotEqual ( floatingLabelTextField. titleLabel. textColor, self . customColor)
126148 }
127149
150+ func test_whenSettingTitleErrorColor_withErrorMessageBeingNil_thenTitleLabelTextColorIsNotChangedToThisColor( ) {
151+ // given
152+ floatingLabelTextField. errorMessage = nil
153+
154+ // when
155+ floatingLabelTextField. titleErrorColor = self . customColor
156+
157+ // then
158+ XCTAssertNotEqual ( floatingLabelTextField. titleLabel. textColor, self . customColor)
159+ }
160+
128161 func test_whenSettingErrorColor_withErrorMessageBeingSet_thenLineViewBackgroundColorIsChangedToThisColor( ) {
129162 // given
130163 floatingLabelTextField. errorMessage = " test "
@@ -136,6 +169,17 @@ class SkyFloatingLabelTextFieldTests: XCTestCase { // swiftlint:disable:this typ
136169 XCTAssertEqual ( floatingLabelTextField. lineView. backgroundColor, self . customColor)
137170 }
138171
172+ func test_whenSettingLineErrorColor_withErrorMessageBeingSet_thenLineViewBackgroundColorIsChangedToThisColor( ) {
173+ // given
174+ floatingLabelTextField. errorMessage = " test "
175+
176+ // when
177+ floatingLabelTextField. lineErrorColor = self . customColor
178+
179+ // then
180+ XCTAssertEqual ( floatingLabelTextField. lineView. backgroundColor, self . customColor)
181+ }
182+
139183 func test_whenSettingSelectedTitleColor_withTextfieldBeingSelected_thenTitleLabelTextColorIsChangedToThisColor( ) {
140184 // given
141185 floatingLabelTextField. isSelected = true
0 commit comments