pEpForiOSTests/UI/Compose/Cells/BodyCell/BodyCellViewModelTest.swift
branchIOS-2259
changeset 15205 f2d94a86ef56
parent 13013 b2243c1de656
child 15206 4044ef5b3584
equal deleted inserted replaced
15204:5491d0a23790 15205:f2d94a86ef56
   149         let expectedPlainText = attributedTextWins
   149         let expectedPlainText = attributedTextWins
   150         let expectedHtml = htmlVersion(of: newAttributedContent)
   150         let expectedHtml = htmlVersion(of: newAttributedContent)
   151 
   151 
   152         setupAssertionDelegates(initialPlaintext: initText,
   152         setupAssertionDelegates(initialPlaintext: initText,
   153                                 initialAttributedText: initAttributedText,
   153                                 initialAttributedText: initAttributedText,
   154                                 initialInlinedAttachments: nil,
       
   155                                 expectInsertCalled: expInsertTextCalled(mustBeCalled: false),
       
   156                                 inserted: nil,
       
   157                                 expUserWantsToAddMediaCalled: expUserWantsToAddMediaCalled(mustBeCalled: false),
       
   158                                 expUserWantsToAddDocumentCalled: expUserWantsToAddDocumentCalled(mustBeCalled: false),
       
   159                                 expInlinedAttachmentsCalled: expInlinedAttachmentChanged(mustBeCalled: false),
       
   160                                 inlined: nil,
       
   161                                 expBodyChangedCalled: expBodyChangedCalled(mustBeCalled: true),
       
   162                                 exectedPlain: expectedPlainText,
       
   163                                 exectedHtml: expectedHtml)
       
   164         vm.handleTextChange(newText: newPlainText, newAttributedText: newAttributedText)
       
   165         waitForExpectations(timeout: UnitTestUtils.waitTime)
       
   166     }
       
   167 
       
   168     func testHandleTextChange_emptyString() {
       
   169         let newPlainText = ""
       
   170         let newAttributedContent = ""
       
   171         let newAttributedText = NSAttributedString(string: newAttributedContent)
       
   172 
       
   173         let attributedTextWins = newAttributedContent
       
   174         let expectedPlainText = attributedTextWins
       
   175         let expectedHtml = htmlVersion(of: newAttributedContent)
       
   176 
       
   177         setupAssertionDelegates(initialPlaintext: nil,
       
   178                                 initialAttributedText: nil,
       
   179                                 initialInlinedAttachments: nil,
   154                                 initialInlinedAttachments: nil,
   180                                 expectInsertCalled: expInsertTextCalled(mustBeCalled: false),
   155                                 expectInsertCalled: expInsertTextCalled(mustBeCalled: false),
   181                                 inserted: nil,
   156                                 inserted: nil,
   182                                 expUserWantsToAddMediaCalled: expUserWantsToAddMediaCalled(mustBeCalled: false),
   157                                 expUserWantsToAddMediaCalled: expUserWantsToAddMediaCalled(mustBeCalled: false),
   183                                 expUserWantsToAddDocumentCalled: expUserWantsToAddDocumentCalled(mustBeCalled: false),
   158                                 expUserWantsToAddDocumentCalled: expUserWantsToAddDocumentCalled(mustBeCalled: false),