From abe8ed603ae6e270f5bfcfc4014f9ed1bd5ece21 Mon Sep 17 00:00:00 2001
From: Oliver Wiese <oliver.wiese@fu-berlin.de>
Date: Fri, 20 Mar 2020 19:03:50 +0100
Subject: [PATCH] fix wrong port test

---
 enzevalos_iphone/AuthenticationModel.swift                | 1 +
 .../SwiftUI/AccountSetup/AccountSetupView.swift           | 4 +++-
 enzevalos_iphoneTests/GeneratedMocks.swift                | 4 ++--
 enzevalos_iphoneUITests/SwiftUIOnboardingUITests.swift    | 8 +-------
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/enzevalos_iphone/AuthenticationModel.swift b/enzevalos_iphone/AuthenticationModel.swift
index 3f8231bb..d8fcc2d4 100644
--- a/enzevalos_iphone/AuthenticationModel.swift
+++ b/enzevalos_iphone/AuthenticationModel.swift
@@ -68,6 +68,7 @@ class AuthenticationModel: NSObject {
     func checkIMAPConfig(mailAccount: MailAccount, _ callback: AuthenticationCallback) {
         imapConfigurationSuccessful = false
         let mailSession: MailSession = setupIMAPSession(mailAccount: mailAccount, callback: callback)
+        print(mailSession.server.port)
         currentIMAP = mailSession
         if extendedValidation && mailSession.startTestingServerConfig(){
             imapConfigurationSuccessful = true
diff --git a/enzevalos_iphone/SwiftUI/AccountSetup/AccountSetupView.swift b/enzevalos_iphone/SwiftUI/AccountSetup/AccountSetupView.swift
index 8ea05f66..02e6cf33 100644
--- a/enzevalos_iphone/SwiftUI/AccountSetup/AccountSetupView.swift
+++ b/enzevalos_iphone/SwiftUI/AccountSetup/AccountSetupView.swift
@@ -138,7 +138,9 @@ struct AccountSetupView: View {
     }
     
     var advancedSectionSwitch: some View{
-        Button(action: {self.isDetailed.toggle()}) {
+        Button(action: {self.isDetailed.toggle()
+            self.viewModel.isDetailedAuthentication = self.isDetailed
+        }) {
             HStack{
                 if(!self.isDetailed){
                     Text(NSLocalizedString("Advanced options", comment: ""))
diff --git a/enzevalos_iphoneTests/GeneratedMocks.swift b/enzevalos_iphoneTests/GeneratedMocks.swift
index eb83f10c..39ed835c 100644
--- a/enzevalos_iphoneTests/GeneratedMocks.swift
+++ b/enzevalos_iphoneTests/GeneratedMocks.swift
@@ -1,4 +1,4 @@
-// MARK: - Mocks generated from file: enzevalos_iphone/AuthenticationModel.swift at 2020-03-20 15:35:06 +0000
+// MARK: - Mocks generated from file: enzevalos_iphone/AuthenticationModel.swift at 2020-03-20 18:02:50 +0000
 
 //
 //  AuthenticationModel.swift
@@ -654,7 +654,7 @@ import Foundation
 }
 
 
-// MARK: - Mocks generated from file: enzevalos_iphone/AuthenticationViewModel.swift at 2020-03-20 15:35:06 +0000
+// MARK: - Mocks generated from file: enzevalos_iphone/AuthenticationViewModel.swift at 2020-03-20 18:02:50 +0000
 
 //
 //  AuthenticationViewModel.swift
diff --git a/enzevalos_iphoneUITests/SwiftUIOnboardingUITests.swift b/enzevalos_iphoneUITests/SwiftUIOnboardingUITests.swift
index 93a435b9..926f3f67 100644
--- a/enzevalos_iphoneUITests/SwiftUIOnboardingUITests.swift
+++ b/enzevalos_iphoneUITests/SwiftUIOnboardingUITests.swift
@@ -330,16 +330,10 @@ class SwiftUIOnboardingUITests: XCTestCase {
         
         scrollViewsQuery.otherElements.containing(.staticText, identifier:"Welcome").element.swipeUp()
         elementsQuery.buttons["Next"].tap()
-        var exists = elementsQuery.staticTexts["Couldn't connect to server.\n Please check your IMAP server configuration."].waitForExistence(timeout: timeoutShort)
+        let exists = elementsQuery.staticTexts["Couldn't connect to server.\n Please check your IMAP server configuration."].waitForExistence(timeout: timeoutShort)
         if exists {
             XCTFail("No error but wrong port for user: \(user.adr)")
         }
-        
-        input(text: user.portIMAP, view: imapPortField)
-        exists = elementsQuery/*@START_MENU_TOKEN@*/.buttons["OnboardActionButtonAccessibilityIdentifier"]/*[[".buttons[\"Got it!\"]",".buttons[\"OnboardActionButtonAccessibilityIdentifier\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.waitForExistence(timeout: timeoutShort)
-        if !exists {
-            XCTFail("Could not login with user: \(user.adr)")
-        }
     }
     
     private static func loadAccounts() -> [String:(adr: String, pw: String, hostIMAP: String, portIMAP: String, conTypeIMAP: String, hostSMTP: String, portSMTP: String, conTypeSMTP: String)] {
-- 
GitLab