-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed content in compound messages #695
Failed content in compound messages #695
Conversation
contentTransferStatus.value = .failed | ||
XCTAssertEqual(viewModel.messageContentTransferStatus, .failed) | ||
// to get rid of the warning about not used variable | ||
XCTAssert(presenter === presenter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do something like this to avoid extra assertion:
let (_, viewModel) = try self.makeRealPresenter(contentTransferStatus: contentTransferStatus)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, due to the fact that compound presenter propagates the action from the content presenter to the View Model, it should be retained until the test case finishes. I tried to wrap the code in the case in autorelease pool but the unused presenter still was deallocating right after the initialisation.
Maybe you can suggest some other way how to keep in memory until the end of the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be this would work (at the end of the test):
_ = presenter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, will do
Added an ability to show failed icon when content of some message wrapped in a compound message is failed to load.
When it happened and the message itself is delivered, a content presenter itself should handle the tap on the failed button.