IOS-1495 search test fixed IOS-1521+IOS-1495
authorXavier Algarra <xavier@pep-project.org>
Wed, 15 May 2019 15:58:58 +0200
branchIOS-1521+IOS-1495
changeset 862839a13d22e284
parent 8627 e3e57e6309e7
child 8629 2259535aff79
IOS-1495 search test fixed
pEpForiOSTests/Models/EmailListViewModelTest.swift
     1.1 --- a/pEpForiOSTests/Models/EmailListViewModelTest.swift	Wed May 15 15:47:45 2019 +0200
     1.2 +++ b/pEpForiOSTests/Models/EmailListViewModelTest.swift	Wed May 15 15:58:58 2019 +0200
     1.3 @@ -214,21 +214,22 @@
     1.4          setupViewModel()
     1.5          emailListVM.startMonitoring()
     1.6          XCTAssertEqual(emailListVM.rowCount, 13)
     1.7 -        emailListVM.setSearch(forSearchText: "searchTest")
     1.8 +        emailListVM.setSearch(forSearchText: textToSearch)
     1.9          XCTAssertEqual(emailListVM.rowCount, 3)
    1.10      }
    1.11  
    1.12 -    /*func testSetSearchFilterShortMessageWith1results() {
    1.13 +    func testSetSearchFilterShortMessageWith1results() {
    1.14          let textToSearch = "searchTest"
    1.15          TestUtil.createMessages(number: 10, engineProccesed: true, inFolder: folder)
    1.16          TestUtil.createMessage(inFolder: folder,
    1.17 -                      from: Identity.create(address: "mail@mail.com"),
    1.18 +                      from: Identity(address: "mail@mail.com"),
    1.19                        tos: [folder.account.user],
    1.20                        shortMessage: textToSearch,
    1.21                        uid: 666).save()
    1.22          setupViewModel()
    1.23 +        emailListVM.startMonitoring()
    1.24          XCTAssertEqual(emailListVM.rowCount, 11)
    1.25 -        setSearchFilter(text: textToSearch)
    1.26 +        emailListVM.setSearch(forSearchText: textToSearch)
    1.27          XCTAssertEqual(emailListVM.rowCount, 1)
    1.28      }
    1.29  
    1.30 @@ -237,19 +238,20 @@
    1.31          let longText = "bla " + textToSearch + " bla"
    1.32          TestUtil.createMessages(number: 10, engineProccesed: true, inFolder: folder)
    1.33          TestUtil.createMessage(inFolder: folder,
    1.34 -                      from: Identity.create(address: "mail@mail.com"),
    1.35 +                      from: Identity(address: "mail@mail.com"),
    1.36                        shortMessage: textToSearch,
    1.37                        uid: 666).save()
    1.38          TestUtil.createMessage(inFolder: folder,
    1.39 -                      from: Identity.create(address: "mail@mail.com"),
    1.40 +                      from: Identity(address: "mail@mail.com"),
    1.41                        tos: [folder.account.user],
    1.42                        longMessage: longText,
    1.43                        uid: 667).save()
    1.44          setupViewModel()
    1.45 +        emailListVM.startMonitoring()
    1.46          XCTAssertEqual(emailListVM.rowCount, 12)
    1.47 -        setSearchFilter(text: textToSearch)
    1.48 +        emailListVM.setSearch(forSearchText: textToSearch)
    1.49          XCTAssertEqual(emailListVM.rowCount, 2)
    1.50 -    }*/
    1.51 +    }
    1.52  
    1.53      // Threading feature is currently non-existing. Keep this code, might help later.
    1.54  //    //thread view nos is totaly disabled that means always false