IOS-1649 new test draft messages are editable and selectable IOS-1649
authorXavier Algarra <xavier@pep-project.org>
Thu, 04 Jul 2019 15:26:44 +0200
branchIOS-1649
changeset 930109f065c81a2c
parent 9300 4798a2719610
child 9361 b9b0d60a6f15
IOS-1649 new test draft messages are editable and selectable
pEpForiOSTests/Models/EmailListViewModelTest.swift
     1.1 --- a/pEpForiOSTests/Models/EmailListViewModelTest.swift	Thu Jul 04 15:25:58 2019 +0200
     1.2 +++ b/pEpForiOSTests/Models/EmailListViewModelTest.swift	Thu Jul 04 15:26:44 2019 +0200
     1.3 @@ -452,6 +452,18 @@
     1.4          XCTAssertTrue(isSelectable)
     1.5      }
     1.6  
     1.7 +    func testMessageInDraftsAreEditableAndSelectable() {
     1.8 +        TestUtil.createMessage(uid: 1, inFolder: draftsFolder)
     1.9 +        moc.saveAndLogErrors()
    1.10 +        setupViewModel(forfolder: draftsFolder)
    1.11 +        emailListVM.startMonitoring()
    1.12 +        XCTAssertEqual(1, emailListVM.rowCount)
    1.13 +        let isEditable = emailListVM.isEditable(messageAt: IndexPath(row: 0, section: 0))
    1.14 +        XCTAssertTrue(isEditable)
    1.15 +        let isSelectable = emailListVM.isSelectable(messageAt: IndexPath(row: 0, section: 0))
    1.16 +        XCTAssertTrue(isSelectable)
    1.17 +    }
    1.18 +
    1.19      // Mark: - setting up
    1.20  
    1.21      fileprivate func setUpViewModel(forFolder folder: Folder, masterViewController: TestMasterViewController) {