Skip to content
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

Merged
merged 5 commits into from
Feb 18, 2021

Conversation

azatZul
Copy link
Collaborator

@azatZul azatZul commented Feb 16, 2021

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.

@wiruzx wiruzx self-requested a review February 16, 2021 10:56
contentTransferStatus.value = .failed
XCTAssertEqual(viewModel.messageContentTransferStatus, .failed)
// to get rid of the warning about not used variable
XCTAssert(presenter === presenter)
Copy link
Contributor

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)

Copy link
Collaborator Author

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?

Copy link
Contributor

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, will do

@wiruzx wiruzx merged commit ec04592 into badoo:master Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants