mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Create poll UX (#1571)
* Add poll attachment button * Add poll creation feature flag * Setup navigation to CreatePollScreen * Add create/cancel actions * Add create poll screen ui skeleton * Add bindings in CreatePollScreen * Add logics in CreatePollScreen * Cleanup code * Fix option deletion crash * Fix conflicts * Add create poll logic * Add localisations * Fix test build errors * Fix crash * Add UTs * Add accessibility IDs * Add ui tests * Add 240 char limit * Fix addOption hide behavior * Add maxNumberOfOptions * Cleanup code * Move delete workaround in the view model * Use compound delete icon
This commit is contained in:
@@ -1464,6 +1464,27 @@ class RoomProxyMock: RoomProxyProtocol {
|
||||
return canUserRedactUserIDReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - createPoll
|
||||
|
||||
var createPollQuestionAnswersPollKindCallsCount = 0
|
||||
var createPollQuestionAnswersPollKindCalled: Bool {
|
||||
return createPollQuestionAnswersPollKindCallsCount > 0
|
||||
}
|
||||
var createPollQuestionAnswersPollKindReceivedArguments: (question: String, answers: [String], pollKind: Poll.Kind)?
|
||||
var createPollQuestionAnswersPollKindReceivedInvocations: [(question: String, answers: [String], pollKind: Poll.Kind)] = []
|
||||
var createPollQuestionAnswersPollKindReturnValue: Result<Void, RoomProxyError>!
|
||||
var createPollQuestionAnswersPollKindClosure: ((String, [String], Poll.Kind) async -> Result<Void, RoomProxyError>)?
|
||||
|
||||
func createPoll(question: String, answers: [String], pollKind: Poll.Kind) async -> Result<Void, RoomProxyError> {
|
||||
createPollQuestionAnswersPollKindCallsCount += 1
|
||||
createPollQuestionAnswersPollKindReceivedArguments = (question: question, answers: answers, pollKind: pollKind)
|
||||
createPollQuestionAnswersPollKindReceivedInvocations.append((question: question, answers: answers, pollKind: pollKind))
|
||||
if let createPollQuestionAnswersPollKindClosure = createPollQuestionAnswersPollKindClosure {
|
||||
return await createPollQuestionAnswersPollKindClosure(question, answers, pollKind)
|
||||
} else {
|
||||
return createPollQuestionAnswersPollKindReturnValue
|
||||
}
|
||||
}
|
||||
}
|
||||
class RoomTimelineProviderMock: RoomTimelineProviderProtocol {
|
||||
var updatePublisher: AnyPublisher<TimelineProviderUpdate, Never> {
|
||||
|
||||
Reference in New Issue
Block a user