@@ -36,7 +36,7 @@ final class NotWPAccountViewModelTests: XCTestCase {
3636 func test_viewmodel_provides_expected_error_message( ) {
3737 // Given
3838 let viewModel = NotWPAccountViewModel ( )
39- let expectation = NSAttributedString ( string: Expectations . errorMessage)
39+ let expectation = NSAttributedString ( string: Expectations . errorMessage, attributes : [ . font : UIFont . title3SemiBold ] )
4040
4141 // When
4242 let errorMessage = viewModel. text
@@ -129,28 +129,61 @@ final class NotWPAccountViewModelTests: XCTestCase {
129129 XCTAssertEqual ( primaryButtonTitle, Expectations . createAnAccountTitle)
130130 }
131131
132+ // MARK: - `isPrimaryButtonHidden`
133+
134+ func test_primary_button_is_not_hidden_for_invalidWPComEmail_from_site_address_error( ) {
135+ // Given
136+ let viewModel = NotWPAccountViewModel ( error: SignInError . invalidWPComEmail ( source: . wpComSiteAddress) )
137+
138+ // Then
139+ XCTAssertFalse ( viewModel. isPrimaryButtonHidden)
140+ }
141+
142+ func test_primary_button_is_not_hidden_for_invalidWPComEmail_from_wpCom_error_when_simplified_login_feature_flag_is_off( ) {
143+ // Given
144+ let featureFlagService = MockFeatureFlagService ( isSimplifiedLoginFlowI1Enabled: false )
145+ let viewModel = NotWPAccountViewModel ( error: SignInError . invalidWPComEmail ( source: . wpCom) ,
146+ featureFlagService: featureFlagService)
147+ // Then
148+ XCTAssertFalse ( viewModel. isPrimaryButtonHidden)
149+ }
150+
151+ func test_primary_button_is_not_hidden_for_invalidWPComEmail_from_wpCom_error_when_simplified_login_is_on_and_store_creation_is_on( ) {
152+ // Given
153+ let featureFlagService = MockFeatureFlagService ( isSimplifiedLoginFlowI1Enabled: true ,
154+ isStoreCreationMVPEnabled: true )
155+ let viewModel = NotWPAccountViewModel ( error: SignInError . invalidWPComEmail ( source: . wpCom) ,
156+ featureFlagService: featureFlagService)
157+ // Then
158+ XCTAssertFalse ( viewModel. isPrimaryButtonHidden)
159+ }
160+
161+ func test_primary_button_is_hidden_for_invalidWPComEmail_from_wpCom_error_when_simplified_login_is_on_and_store_creation_is_off( ) {
162+ // Given
163+ let featureFlagService = MockFeatureFlagService ( isSimplifiedLoginFlowI1Enabled: true ,
164+ isStoreCreationMVPEnabled: false )
165+ let viewModel = NotWPAccountViewModel ( error: SignInError . invalidWPComEmail ( source: . wpCom) ,
166+ featureFlagService: featureFlagService)
167+ // Then
168+ XCTAssertTrue ( viewModel. isPrimaryButtonHidden)
169+ }
170+
132171 // MARK: - `isSecondaryButtonHidden`
133172
134173 func test_secondary_button_is_hidden_for_invalidWPComEmail_from_site_address_error( ) {
135174 // Given
136175 let viewModel = NotWPAccountViewModel ( error: SignInError . invalidWPComEmail ( source: . wpComSiteAddress) )
137176
138- // When
139- let isPrimaryButtonHidden = viewModel. isSecondaryButtonHidden
140-
141177 // Then
142- XCTAssertTrue ( isPrimaryButtonHidden )
178+ XCTAssertTrue ( viewModel . isSecondaryButtonHidden )
143179 }
144180
145181 func test_secondary_button_is_not_hidden_for_invalidWPComEmail_from_wpCom_error( ) {
146182 // Given
147183 let viewModel = NotWPAccountViewModel ( error: SignInError . invalidWPComEmail ( source: . wpCom) )
148184
149- // When
150- let isPrimaryButtonHidden = viewModel. isSecondaryButtonHidden
151-
152185 // Then
153- XCTAssertFalse ( isPrimaryButtonHidden )
186+ XCTAssertFalse ( viewModel . isSecondaryButtonHidden )
154187 }
155188
156189 // MARK: - `secondaryButtonTitle`
@@ -211,11 +244,6 @@ final class NotWPAccountViewModelTests: XCTestCase {
211244 XCTAssertNotNil ( analyticsProvider. receivedEvents. first ( where: { $0 == " what_is_wordpress_com_on_invalid_email_screen " } ) )
212245 }
213246
214- /*
215- TODO: 7903 - Navigate to create store flow
216-
217- Uncomment these tests after added create store navigation and analytics code.
218-
219247 func test_tapping_primary_button_does_not_track_create_account_event_when_simplified_login_feature_flag_is_off( ) {
220248 // Given
221249 let featureFlagService = MockFeatureFlagService ( isSimplifiedLoginFlowI1Enabled: false )
@@ -243,7 +271,6 @@ final class NotWPAccountViewModelTests: XCTestCase {
243271 // Then
244272 XCTAssertNotNil ( analyticsProvider. receivedEvents. first ( where: { $0 == " create_account_on_invalid_email_screen " } ) )
245273 }
246- */
247274}
248275
249276
0 commit comments