mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Seamlessly switch for the RichTextEditor based message composer to the… (#2753)
* Seemlesly switch for the RichTextEditor based message composer to the plain one depending on whether formatting options are enabled or not. * Address PR comments * Fixes #2803 - Add extra padding at the bottom of the composer suggestions list * Update preview test snapshots * Update UI test snapshots
This commit is contained in:
@@ -36,7 +36,6 @@ final class AppSettings {
|
|||||||
case pusherProfileTag
|
case pusherProfileTag
|
||||||
case logLevel
|
case logLevel
|
||||||
case viewSourceEnabled
|
case viewSourceEnabled
|
||||||
case richTextEditorEnabled
|
|
||||||
case appAppearance
|
case appAppearance
|
||||||
case sharePresence
|
case sharePresence
|
||||||
case hideUnreadMessagesBadge
|
case hideUnreadMessagesBadge
|
||||||
@@ -234,9 +233,6 @@ final class AppSettings {
|
|||||||
@UserPreference(key: UserDefaultsKeys.viewSourceEnabled, defaultValue: false, storageType: .userDefaults(store))
|
@UserPreference(key: UserDefaultsKeys.viewSourceEnabled, defaultValue: false, storageType: .userDefaults(store))
|
||||||
var viewSourceEnabled
|
var viewSourceEnabled
|
||||||
|
|
||||||
@UserPreference(key: UserDefaultsKeys.richTextEditorEnabled, defaultValue: true, storageType: .userDefaults(store))
|
|
||||||
var richTextEditorEnabled
|
|
||||||
|
|
||||||
// MARK: - Element Call
|
// MARK: - Element Call
|
||||||
|
|
||||||
@UserPreference(key: UserDefaultsKeys.elementCallBaseURL, defaultValue: "https://call.element.io", storageType: .userDefaults(store))
|
@UserPreference(key: UserDefaultsKeys.elementCallBaseURL, defaultValue: "https://call.element.io", storageType: .userDefaults(store))
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ enum ComposerToolbarViewAction {
|
|||||||
case voiceMessage(ComposerToolbarVoiceMessageAction)
|
case voiceMessage(ComposerToolbarVoiceMessageAction)
|
||||||
|
|
||||||
case plainComposerTextChanged
|
case plainComposerTextChanged
|
||||||
|
case didToggleFormattingOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ComposerAttachmentType {
|
enum ComposerAttachmentType {
|
||||||
@@ -95,7 +96,7 @@ struct ComposerToolbarViewState: BindableState {
|
|||||||
case .previewVoiceMessage:
|
case .previewVoiceMessage:
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
if ServiceLocator.shared.settings.richTextEditorEnabled {
|
if bindings.composerFormattingEnabled {
|
||||||
return !composerEmpty
|
return !composerEmpty
|
||||||
} else {
|
} else {
|
||||||
return !bindings.plainComposerText.string.isEmpty
|
return !bindings.plainComposerText.string.isEmpty
|
||||||
@@ -108,7 +109,7 @@ struct ComposerToolbarViewState: BindableState {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if ServiceLocator.shared.settings.richTextEditorEnabled {
|
if bindings.composerFormattingEnabled {
|
||||||
return composerEmpty
|
return composerEmpty
|
||||||
} else {
|
} else {
|
||||||
return bindings.plainComposerText.string.isEmpty
|
return bindings.plainComposerText.string.isEmpty
|
||||||
@@ -128,7 +129,7 @@ struct ComposerToolbarViewState: BindableState {
|
|||||||
struct ComposerToolbarViewStateBindings {
|
struct ComposerToolbarViewStateBindings {
|
||||||
var plainComposerText: NSAttributedString = .init(string: "")
|
var plainComposerText: NSAttributedString = .init(string: "")
|
||||||
var composerFocused = false
|
var composerFocused = false
|
||||||
var composerActionsEnabled = false
|
var composerFormattingEnabled = false
|
||||||
var composerExpanded = false
|
var composerExpanded = false
|
||||||
var formatItems: [FormatItem] = .init()
|
var formatItems: [FormatItem] = .init()
|
||||||
var alertInfo: AlertInfo<UUID>?
|
var alertInfo: AlertInfo<UUID>?
|
||||||
|
|||||||
@@ -125,10 +125,9 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
|||||||
case .previewVoiceMessage:
|
case .previewVoiceMessage:
|
||||||
actionsSubject.send(.voiceMessage(.send))
|
actionsSubject.send(.voiceMessage(.send))
|
||||||
default:
|
default:
|
||||||
if ServiceLocator.shared.settings.richTextEditorEnabled {
|
if context.composerFormattingEnabled {
|
||||||
let sendHTML = appSettings.richTextEditorEnabled
|
|
||||||
actionsSubject.send(.sendMessage(plain: wysiwygViewModel.content.markdown,
|
actionsSubject.send(.sendMessage(plain: wysiwygViewModel.content.markdown,
|
||||||
html: sendHTML ? wysiwygViewModel.content.html : nil,
|
html: wysiwygViewModel.content.html,
|
||||||
mode: state.composerMode,
|
mode: state.composerMode,
|
||||||
intentionalMentions: wysiwygViewModel.getMentionsState().toIntentionalMentions()))
|
intentionalMentions: wysiwygViewModel.getMentionsState().toIntentionalMentions()))
|
||||||
} else {
|
} else {
|
||||||
@@ -148,7 +147,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
|||||||
case .handlePasteOrDrop(let provider):
|
case .handlePasteOrDrop(let provider):
|
||||||
actionsSubject.send(.handlePasteOrDrop(provider: provider))
|
actionsSubject.send(.handlePasteOrDrop(provider: provider))
|
||||||
case .enableTextFormatting:
|
case .enableTextFormatting:
|
||||||
state.bindings.composerActionsEnabled = true
|
state.bindings.composerFormattingEnabled = true
|
||||||
state.bindings.composerFocused = true
|
state.bindings.composerFocused = true
|
||||||
case .composerAction(let action):
|
case .composerAction(let action):
|
||||||
if action == .link {
|
if action == .link {
|
||||||
@@ -162,6 +161,15 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
|||||||
processVoiceMessageAction(voiceMessageAction)
|
processVoiceMessageAction(voiceMessageAction)
|
||||||
case .plainComposerTextChanged:
|
case .plainComposerTextChanged:
|
||||||
completionSuggestionService.processTextMessage(state.bindings.plainComposerText.string)
|
completionSuggestionService.processTextMessage(state.bindings.plainComposerText.string)
|
||||||
|
case .didToggleFormattingOptions:
|
||||||
|
if context.composerFormattingEnabled {
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.wysiwygViewModel.textView.flushPills()
|
||||||
|
self.wysiwygViewModel.setMarkdownContent(self.context.plainComposerText.string)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
context.plainComposerText = NSAttributedString(string: wysiwygViewModel.attributedContent.text.string)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +252,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
|||||||
private func processVoiceMessageAction(_ action: ComposerToolbarVoiceMessageAction) {
|
private func processVoiceMessageAction(_ action: ComposerToolbarVoiceMessageAction) {
|
||||||
switch action {
|
switch action {
|
||||||
case .startRecording:
|
case .startRecording:
|
||||||
state.bindings.composerActionsEnabled = false
|
state.bindings.composerFormattingEnabled = false
|
||||||
actionsSubject.send(.voiceMessage(.startRecording))
|
actionsSubject.send(.voiceMessage(.startRecording))
|
||||||
case .stopRecording:
|
case .stopRecording:
|
||||||
actionsSubject.send(.voiceMessage(.stopRecording))
|
actionsSubject.send(.voiceMessage(.stopRecording))
|
||||||
@@ -297,7 +305,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if appSettings.richTextEditorEnabled {
|
if context.composerFormattingEnabled {
|
||||||
wysiwygViewModel.setMention(url: url.absoluteString, name: item.displayName ?? item.id, mentionType: .user)
|
wysiwygViewModel.setMention(url: url.absoluteString, name: item.displayName ?? item.id, mentionType: .user)
|
||||||
} else {
|
} else {
|
||||||
let attributedString = NSMutableAttributedString(attributedString: state.bindings.plainComposerText)
|
let attributedString = NSMutableAttributedString(attributedString: state.bindings.plainComposerText)
|
||||||
@@ -305,7 +313,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
|||||||
state.bindings.plainComposerText = attributedString
|
state.bindings.plainComposerText = attributedString
|
||||||
}
|
}
|
||||||
case .allUsers:
|
case .allUsers:
|
||||||
if appSettings.richTextEditorEnabled {
|
if context.composerFormattingEnabled {
|
||||||
wysiwygViewModel.setAtRoomMention()
|
wysiwygViewModel.setAtRoomMention()
|
||||||
} else {
|
} else {
|
||||||
let attributedString = NSMutableAttributedString(attributedString: state.bindings.plainComposerText)
|
let attributedString = NSMutableAttributedString(attributedString: state.bindings.plainComposerText)
|
||||||
@@ -333,7 +341,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func set(text: String) {
|
private func set(text: String) {
|
||||||
if ServiceLocator.shared.settings.richTextEditorEnabled {
|
if context.composerFormattingEnabled {
|
||||||
wysiwygViewModel.textView.flushPills()
|
wysiwygViewModel.textView.flushPills()
|
||||||
|
|
||||||
wysiwygViewModel.setHtmlContent(text)
|
wysiwygViewModel.setHtmlContent(text)
|
||||||
|
|||||||
+1
@@ -52,6 +52,7 @@ struct CompletionSuggestionView: View {
|
|||||||
list()
|
list()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.padding(.bottom, Constants.listItemPadding)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ struct ComposerToolbar: View {
|
|||||||
VStack(spacing: 8) {
|
VStack(spacing: 8) {
|
||||||
topBar
|
topBar
|
||||||
|
|
||||||
if context.composerActionsEnabled {
|
if context.composerFormattingEnabled {
|
||||||
if verticalSizeClass != .compact,
|
if verticalSizeClass != .compact,
|
||||||
context.composerExpanded {
|
context.composerExpanded {
|
||||||
suggestionView
|
suggestionView
|
||||||
@@ -68,7 +68,7 @@ struct ComposerToolbar: View {
|
|||||||
topBarLayout {
|
topBarLayout {
|
||||||
mainTopBarContent
|
mainTopBarContent
|
||||||
|
|
||||||
if !context.composerActionsEnabled {
|
if !context.composerFormattingEnabled {
|
||||||
if context.viewState.isUploading {
|
if context.viewState.isUploading {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
.scaledFrame(size: 44, relativeTo: .title)
|
.scaledFrame(size: 44, relativeTo: .title)
|
||||||
@@ -106,7 +106,7 @@ struct ComposerToolbar: View {
|
|||||||
private var mainTopBarContent: some View {
|
private var mainTopBarContent: some View {
|
||||||
ZStack(alignment: .bottom) {
|
ZStack(alignment: .bottom) {
|
||||||
topBarLayout {
|
topBarLayout {
|
||||||
if !context.composerActionsEnabled {
|
if !context.composerFormattingEnabled {
|
||||||
RoomAttachmentPicker(context: context)
|
RoomAttachmentPicker(context: context)
|
||||||
}
|
}
|
||||||
messageComposer
|
messageComposer
|
||||||
@@ -122,7 +122,7 @@ struct ComposerToolbar: View {
|
|||||||
|
|
||||||
private var closeRTEButton: some View {
|
private var closeRTEButton: some View {
|
||||||
Button {
|
Button {
|
||||||
context.composerActionsEnabled = false
|
context.composerFormattingEnabled = false
|
||||||
context.composerExpanded = false
|
context.composerExpanded = false
|
||||||
} label: {
|
} label: {
|
||||||
Image(Asset.Images.closeRte.name)
|
Image(Asset.Images.closeRte.name)
|
||||||
@@ -158,7 +158,8 @@ struct ComposerToolbar: View {
|
|||||||
MessageComposer(plainComposerText: $context.plainComposerText,
|
MessageComposer(plainComposerText: $context.plainComposerText,
|
||||||
composerView: composerView,
|
composerView: composerView,
|
||||||
mode: context.viewState.composerMode,
|
mode: context.viewState.composerMode,
|
||||||
showResizeGrabber: context.viewState.bindings.composerActionsEnabled,
|
composerFormattingEnabled: context.composerFormattingEnabled,
|
||||||
|
showResizeGrabber: context.composerFormattingEnabled,
|
||||||
isExpanded: $context.composerExpanded) {
|
isExpanded: $context.composerExpanded) {
|
||||||
context.send(viewAction: .sendMessage)
|
context.send(viewAction: .sendMessage)
|
||||||
} editAction: {
|
} editAction: {
|
||||||
@@ -179,8 +180,8 @@ struct ComposerToolbar: View {
|
|||||||
}
|
}
|
||||||
.environmentObject(context)
|
.environmentObject(context)
|
||||||
.focused($composerFocused)
|
.focused($composerFocused)
|
||||||
.padding(.leading, context.composerActionsEnabled ? 7 : 0)
|
.padding(.leading, context.composerFormattingEnabled ? 7 : 0)
|
||||||
.padding(.trailing, context.composerActionsEnabled ? 4 : 0)
|
.padding(.trailing, context.composerFormattingEnabled ? 4 : 0)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
guard !composerFocused else { return }
|
guard !composerFocused else { return }
|
||||||
composerFocused = true
|
composerFocused = true
|
||||||
@@ -196,6 +197,9 @@ struct ComposerToolbar: View {
|
|||||||
.onChange(of: context.plainComposerText) { _ in
|
.onChange(of: context.plainComposerText) { _ in
|
||||||
context.send(viewAction: .plainComposerTextChanged)
|
context.send(viewAction: .plainComposerTextChanged)
|
||||||
}
|
}
|
||||||
|
.onChange(of: context.composerFormattingEnabled) { _ in
|
||||||
|
context.send(viewAction: .didToggleFormattingOptions)
|
||||||
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
composerFocused = context.composerFocused
|
composerFocused = context.composerFocused
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ struct MessageComposer: View {
|
|||||||
@Binding var plainComposerText: NSAttributedString
|
@Binding var plainComposerText: NSAttributedString
|
||||||
let composerView: WysiwygComposerView
|
let composerView: WysiwygComposerView
|
||||||
let mode: RoomScreenComposerMode
|
let mode: RoomScreenComposerMode
|
||||||
|
let composerFormattingEnabled: Bool
|
||||||
let showResizeGrabber: Bool
|
let showResizeGrabber: Bool
|
||||||
@Binding var isExpanded: Bool
|
@Binding var isExpanded: Bool
|
||||||
let sendAction: () -> Void
|
let sendAction: () -> Void
|
||||||
@@ -68,7 +69,7 @@ struct MessageComposer: View {
|
|||||||
VStack(alignment: .leading, spacing: -6) {
|
VStack(alignment: .leading, spacing: -6) {
|
||||||
header
|
header
|
||||||
|
|
||||||
if ServiceLocator.shared.settings.richTextEditorEnabled {
|
if composerFormattingEnabled {
|
||||||
Color.clear
|
Color.clear
|
||||||
.overlay(alignment: .top) {
|
.overlay(alignment: .top) {
|
||||||
composerView
|
composerView
|
||||||
@@ -254,6 +255,7 @@ struct MessageComposer_Previews: PreviewProvider, TestablePreview {
|
|||||||
return MessageComposer(plainComposerText: .constant(content),
|
return MessageComposer(plainComposerText: .constant(content),
|
||||||
composerView: composerView,
|
composerView: composerView,
|
||||||
mode: mode,
|
mode: mode,
|
||||||
|
composerFormattingEnabled: false,
|
||||||
showResizeGrabber: false,
|
showResizeGrabber: false,
|
||||||
isExpanded: .constant(false),
|
isExpanded: .constant(false),
|
||||||
sendAction: { },
|
sendAction: { },
|
||||||
|
|||||||
+2
-1
@@ -36,7 +36,8 @@ struct MessageComposerTextField: View {
|
|||||||
private var placeholderView: some View {
|
private var placeholderView: some View {
|
||||||
if text.string.isEmpty {
|
if text.string.isEmpty {
|
||||||
Text(placeholder)
|
Text(placeholder)
|
||||||
.foregroundColor(.compound.textPlaceholder)
|
.font(Font(UIFont.preferredFont(forTextStyle: .body)))
|
||||||
|
.foregroundColor(.compound.textSecondary)
|
||||||
.accessibilityHidden(true)
|
.accessibilityHidden(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,15 +37,13 @@ struct RoomAttachmentPicker: View {
|
|||||||
|
|
||||||
var menuContent: some View {
|
var menuContent: some View {
|
||||||
VStack(alignment: .leading, spacing: 0.0) {
|
VStack(alignment: .leading, spacing: 0.0) {
|
||||||
if ServiceLocator.shared.settings.richTextEditorEnabled {
|
Button {
|
||||||
Button {
|
context.send(viewAction: .enableTextFormatting)
|
||||||
context.send(viewAction: .enableTextFormatting)
|
} label: {
|
||||||
} label: {
|
Label(L10n.screenRoomAttachmentTextFormatting, icon: \.textFormatting)
|
||||||
Label(L10n.screenRoomAttachmentTextFormatting, icon: \.textFormatting)
|
.labelStyle(.menuSheet)
|
||||||
.labelStyle(.menuSheet)
|
|
||||||
}
|
|
||||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerTextFormatting)
|
|
||||||
}
|
}
|
||||||
|
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerTextFormatting)
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
context.send(viewAction: .attach(.poll))
|
context.send(viewAction: .attach(.poll))
|
||||||
|
|||||||
@@ -272,18 +272,10 @@ class RoomScreenInteractionHandler {
|
|||||||
private func processEditMessageEvent(_ messageTimelineItem: EventBasedMessageTimelineItemProtocol) {
|
private func processEditMessageEvent(_ messageTimelineItem: EventBasedMessageTimelineItemProtocol) {
|
||||||
let text: String
|
let text: String
|
||||||
switch messageTimelineItem.contentType {
|
switch messageTimelineItem.contentType {
|
||||||
case .text(let textItem):
|
case .text:
|
||||||
if ServiceLocator.shared.settings.richTextEditorEnabled, let formattedBodyHTMLString = textItem.formattedBodyHTMLString {
|
text = messageTimelineItem.body
|
||||||
text = formattedBodyHTMLString
|
case .emote:
|
||||||
} else {
|
text = "/me " + messageTimelineItem.body
|
||||||
text = messageTimelineItem.body
|
|
||||||
}
|
|
||||||
case .emote(let emoteItem):
|
|
||||||
if ServiceLocator.shared.settings.richTextEditorEnabled, let formattedBodyHTMLString = emoteItem.formattedBodyHTMLString {
|
|
||||||
text = "/me " + formattedBodyHTMLString
|
|
||||||
} else {
|
|
||||||
text = "/me " + messageTimelineItem.body
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
text = messageTimelineItem.body
|
text = messageTimelineItem.body
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ struct RoomScreen: View {
|
|||||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||||
.safeAreaInset(edge: .bottom, spacing: 0) {
|
.safeAreaInset(edge: .bottom, spacing: 0) {
|
||||||
composerToolbar
|
composerToolbar
|
||||||
.padding(.bottom, composerToolbarContext.composerActionsEnabled ? 8 : 12)
|
.padding(.bottom, composerToolbarContext.composerFormattingEnabled ? 8 : 12)
|
||||||
.background {
|
.background {
|
||||||
if composerToolbarContext.composerActionsEnabled {
|
if composerToolbarContext.composerFormattingEnabled {
|
||||||
RoundedRectangle(cornerRadius: 20)
|
RoundedRectangle(cornerRadius: 20)
|
||||||
.stroke(Color.compound.borderInteractiveSecondary, lineWidth: 0.5)
|
.stroke(Color.compound.borderInteractiveSecondary, lineWidth: 0.5)
|
||||||
.ignoresSafeArea()
|
.ignoresSafeArea()
|
||||||
@@ -186,7 +186,7 @@ struct RoomScreen: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private var isNavigationBarHidden: Bool {
|
private var isNavigationBarHidden: Bool {
|
||||||
composerToolbarContext.composerActionsEnabled && composerToolbarContext.composerExpanded && UIDevice.current.userInterfaceIdiom == .pad
|
composerToolbarContext.composerFormattingEnabled && composerToolbarContext.composerExpanded && UIDevice.current.userInterfaceIdiom == .pad
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-1
@@ -40,7 +40,6 @@ enum AdvancedSettingsScreenViewAction { }
|
|||||||
protocol AdvancedSettingsProtocol: AnyObject {
|
protocol AdvancedSettingsProtocol: AnyObject {
|
||||||
var timelineStyle: TimelineStyle { get set }
|
var timelineStyle: TimelineStyle { get set }
|
||||||
var viewSourceEnabled: Bool { get set }
|
var viewSourceEnabled: Bool { get set }
|
||||||
var richTextEditorEnabled: Bool { get set }
|
|
||||||
var appAppearance: AppAppearance { get set }
|
var appAppearance: AppAppearance { get set }
|
||||||
var sharePresence: Bool { get set }
|
var sharePresence: Bool { get set }
|
||||||
}
|
}
|
||||||
|
|||||||
-3
@@ -31,9 +31,6 @@ struct AdvancedSettingsScreen: View {
|
|||||||
kind: .picker(selection: $context.timelineStyle,
|
kind: .picker(selection: $context.timelineStyle,
|
||||||
items: TimelineStyle.allCases.map { (title: $0.name, tag: $0) }))
|
items: TimelineStyle.allCases.map { (title: $0.name, tag: $0) }))
|
||||||
|
|
||||||
ListRow(label: .plain(title: L10n.commonRichTextEditor),
|
|
||||||
kind: .toggle($context.richTextEditorEnabled))
|
|
||||||
|
|
||||||
ListRow(label: .plain(title: L10n.actionViewSource),
|
ListRow(label: .plain(title: L10n.actionViewSource),
|
||||||
kind: .toggle($context.viewSourceEnabled))
|
kind: .toggle($context.viewSourceEnabled))
|
||||||
|
|
||||||
|
|||||||
@@ -487,9 +487,8 @@ class MockScreen: Identifiable {
|
|||||||
var sessionVerificationControllerProxy = SessionVerificationControllerProxyMock.configureMock(requestDelay: .seconds(5))
|
var sessionVerificationControllerProxy = SessionVerificationControllerProxyMock.configureMock(requestDelay: .seconds(5))
|
||||||
let parameters = SessionVerificationScreenCoordinatorParameters(sessionVerificationControllerProxy: sessionVerificationControllerProxy)
|
let parameters = SessionVerificationScreenCoordinatorParameters(sessionVerificationControllerProxy: sessionVerificationControllerProxy)
|
||||||
return SessionVerificationScreenCoordinator(parameters: parameters)
|
return SessionVerificationScreenCoordinator(parameters: parameters)
|
||||||
case .userSessionScreen, .userSessionScreenReply, .userSessionScreenRTE:
|
case .userSessionScreen, .userSessionScreenReply:
|
||||||
let appSettings: AppSettings = ServiceLocator.shared.settings
|
let appSettings: AppSettings = ServiceLocator.shared.settings
|
||||||
appSettings.richTextEditorEnabled = id == .userSessionScreenRTE
|
|
||||||
appSettings.hasRunIdentityConfirmationOnboarding = true
|
appSettings.hasRunIdentityConfirmationOnboarding = true
|
||||||
appSettings.hasRunNotificationPermissionsOnboarding = true
|
appSettings.hasRunNotificationPermissionsOnboarding = true
|
||||||
appSettings.analyticsConsentState = .optedOut
|
appSettings.analyticsConsentState = .optedOut
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ enum UITestsScreenIdentifier: String {
|
|||||||
case templateScreen
|
case templateScreen
|
||||||
case userSessionScreen
|
case userSessionScreen
|
||||||
case userSessionScreenReply
|
case userSessionScreenReply
|
||||||
case userSessionScreenRTE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension UITestsScreenIdentifier: CustomStringConvertible {
|
extension UITestsScreenIdentifier: CustomStringConvertible {
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:c7eca90ff3c9a34106fa556be1a0b865695e30b3753bd7add22e686d9ea258c6
|
oid sha256:8cd0132d6e6b1accd323b35c4f76194715ec5672e8ebadba2cea0d8b9328acd4
|
||||||
size 167818
|
size 156339
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:2fb30d84c0853cbab1341218d256e42c64d3f9388e9b51fe572c1cf3d44e4270
|
oid sha256:b952da8ab3650bd6c62f5fcb2f58f5abbc43abb59a194a67bb5e5b45c6d358c0
|
||||||
size 235706
|
size 217756
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:022549154cb0f9a9d6d828b592251e787d04b871f01c05f0133b8bda66a7e4c0
|
oid sha256:2cf3303ef793b9062a0971a0af37cc4fb76ac950d2ef5025330cef2e59e619db
|
||||||
size 114860
|
size 104184
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:a12aa0931a0e8428e1db8f70c79fb84af1e5aa5ff0c14d3553154f5e7b6ee56c
|
oid sha256:c1a257c5c1b5a762cd8454637d6fa378980b930fbeed3ec12c8ccb8cce99f2b9
|
||||||
size 182408
|
size 165685
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:584936cfc953eb5780568ffa48b847b74375f27617237ec6a6321cd4b68a464f
|
oid sha256:fa34be11d7d59e45cd2821e05f537be2affc7d5bd12184d83cf068bf369b098e
|
||||||
size 98064
|
size 98123
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:d9a09a79a543da4fb27e42c153b3cb73928780423f40cf1316fb3ea05d96f3a0
|
oid sha256:a71f6e976ae147b899fa553e8fb552e455b9f20a1013bdaff291f81319d3baa1
|
||||||
size 86227
|
size 86322
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:584936cfc953eb5780568ffa48b847b74375f27617237ec6a6321cd4b68a464f
|
oid sha256:fa34be11d7d59e45cd2821e05f537be2affc7d5bd12184d83cf068bf369b098e
|
||||||
size 98064
|
size 98123
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:d9a09a79a543da4fb27e42c153b3cb73928780423f40cf1316fb3ea05d96f3a0
|
oid sha256:a71f6e976ae147b899fa553e8fb552e455b9f20a1013bdaff291f81319d3baa1
|
||||||
size 86227
|
size 86322
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:dc4f1c939e34cc256d2d2bcb73fe17b81c3317d991f4d4751ac2dfe05cb59b9e
|
oid sha256:acc1a17b9860920860f64f5c9093381324f14f52eabddd623f80bb2bf93504b1
|
||||||
size 58984
|
size 59031
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:38944a01c234414b5e0f93e04b3a7d08076007d69c73ffd1654eb5fe1dc8afe6
|
oid sha256:d4c8414e631ee302555bb2b8ebee2d23543945650607f7f45c86c789c19ef9b2
|
||||||
size 45027
|
size 45050
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:dc4f1c939e34cc256d2d2bcb73fe17b81c3317d991f4d4751ac2dfe05cb59b9e
|
oid sha256:acc1a17b9860920860f64f5c9093381324f14f52eabddd623f80bb2bf93504b1
|
||||||
size 58984
|
size 59031
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:38944a01c234414b5e0f93e04b3a7d08076007d69c73ffd1654eb5fe1dc8afe6
|
oid sha256:d4c8414e631ee302555bb2b8ebee2d23543945650607f7f45c86c789c19ef9b2
|
||||||
size 45027
|
size 45050
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:414bb169097a0c4926e1ac3e1abb3fe6445516b581c91bc27e0372027ae03de2
|
oid sha256:68c681cc22384d1377be5d56b42c57a68766537c3d642218251eb1d889cd515e
|
||||||
size 107377
|
size 106538
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:82a4bf18699ddb72af9eb3546d9e4eccb827e086ef780dd07e1ca4446fcf9c07
|
oid sha256:2534a9d8feef7a99b2c14730239c98b7c3bb28329b7e646c02345e62179e3a50
|
||||||
size 111389
|
size 111497
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:b223ffc19a1adc5976523c13aa1009c74d4c6bdebe1c1e3c516b83e4a2ff5df2
|
oid sha256:01db58870824c2b09793408d64ce3397d72cf3720e92d8278668e2ef277bb97e
|
||||||
size 120523
|
size 119713
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:90b3446fa6405f82d269c30e80e573cbf825529e6c9ea21e2ee22a0292cedc44
|
oid sha256:1d495b78efc77d2370ab66926502aeca2cd1f0f287c5c9468ec86900a687a90e
|
||||||
size 118070
|
size 118169
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:4ce075a57cc5716d9f4db8db8179fd3777b18a7896111803148d81e3d88b87ff
|
oid sha256:dbad3711a413251613374bdab77d08a20ac11460f31e9d640da4b87fdd6b0850
|
||||||
size 63974
|
size 63472
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:632052c7ad476e1f865d049f5f384ad36035a22900b64a306b64baffdd5efcfc
|
oid sha256:6b37aebdb445443adc4cb347b76ef061a6e3d100c7a9031eda954fe55c3b9a83
|
||||||
size 69710
|
size 69835
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:fe98b57e90a038f674b398b2b44c79b474c3d51a1a4524bc654f52737912f99d
|
oid sha256:c085235245f929824031e4e7f9703ab3c48c7993fac4b8bbbb447877c74b81d7
|
||||||
size 75426
|
size 74842
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:1a237b585b57ad52e604e6a7f59b7bedb77b7ce21bc85d6f0988551e3290f4d9
|
oid sha256:415897be3efc67d7a387bd01d2ac15f4e4d257be2578b3a2436722e8801e11d9
|
||||||
size 75952
|
size 76091
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:ff699339be624231ce8d338b43803eff390c868c22f679512a9a853e27919d2f
|
oid sha256:255d4ad8785ce55927d809c1ce8f8fc566bb46ef7e92febbb740855bd54f262e
|
||||||
size 111526
|
size 117167
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:4425db337993d4069e94f878c8a5e6ff7c06544c8ea5563bcbf12cdc53e79935
|
oid sha256:2bd33c81a3a58bff01c4930140df955246cf7e45b09548164aa4607fd30e5ce3
|
||||||
size 256291
|
size 267496
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:4425db337993d4069e94f878c8a5e6ff7c06544c8ea5563bcbf12cdc53e79935
|
oid sha256:2bd33c81a3a58bff01c4930140df955246cf7e45b09548164aa4607fd30e5ce3
|
||||||
size 256291
|
size 267496
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:179f0d0596f940a0de23cb62efb8bbf7af4a6c4589f510391d284f61a0ffb38d
|
oid sha256:fa86d0dbdc54d0672cc91b205214964e30bcf04a6180736954e7741840fec0df
|
||||||
size 127081
|
size 132015
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:a752263b69ae606f5aedea31029a683861a44525443fe038f1a83b5856d4e8a5
|
oid sha256:4ea58a90f9022375da55bef45def849facd626d12f1c80ad0a2e926a8b5867ce
|
||||||
size 292519
|
size 317615
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:a752263b69ae606f5aedea31029a683861a44525443fe038f1a83b5856d4e8a5
|
oid sha256:4ea58a90f9022375da55bef45def849facd626d12f1c80ad0a2e926a8b5867ce
|
||||||
size 292519
|
size 317615
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:28df2a5d42e2bec66e6e3ac89593311407219db2cbc7e1a278a1d274dd12b2b8
|
oid sha256:4d87655de27da0abd56aa5c7dcf865a40979a374bf538fec3813b60db084023e
|
||||||
size 61141
|
size 70233
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:6230b276ef067dc451cfa6b5a0983759c4dbf00e16b0e2bb57561398be935233
|
oid sha256:541bf91dd974bcf68680fb4e4e08b642286f26e5b0069b83381bd17a79b368f1
|
||||||
size 181563
|
size 192646
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:6230b276ef067dc451cfa6b5a0983759c4dbf00e16b0e2bb57561398be935233
|
oid sha256:541bf91dd974bcf68680fb4e4e08b642286f26e5b0069b83381bd17a79b368f1
|
||||||
size 181563
|
size 192646
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:c5881ef2c4cb7b0865baac1f2718dfa6cdde63967c9e3b59962fafe3bde3e0e2
|
oid sha256:d09dcf7d327f5184def7594234aa02ae385daa20e04e8d69a1953b06a3bf89f1
|
||||||
size 71102
|
size 82896
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:661b4c36d625ea8657458fb57c36e88b3bcdd82e41f5ab21cc7cd265683f362f
|
oid sha256:329b7f3e6e50cc5780ebc19f4b2c1975d735f25bbc91319274b97940ace1d447
|
||||||
size 214398
|
size 236732
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:661b4c36d625ea8657458fb57c36e88b3bcdd82e41f5ab21cc7cd265683f362f
|
oid sha256:329b7f3e6e50cc5780ebc19f4b2c1975d735f25bbc91319274b97940ace1d447
|
||||||
size 214398
|
size 236732
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:210b94e65098c70d9362fb9e8e9fde574eb46efcb06077f81abe3e1e7790da99
|
oid sha256:ab6c8ec8d4b807f873436ce3edd97dd479d9594b28afc0728229705a44c70f1d
|
||||||
size 101026
|
size 101009
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:210b94e65098c70d9362fb9e8e9fde574eb46efcb06077f81abe3e1e7790da99
|
oid sha256:ab6c8ec8d4b807f873436ce3edd97dd479d9594b28afc0728229705a44c70f1d
|
||||||
size 101026
|
size 101009
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:3849590fd946e5d503c6e456da074a9d37e08c9f69bb46ac26493ac0586bc639
|
oid sha256:0387ca568b2fa08a33656c433ed6626ffe2b55a3d90d5a228635629bfcc8a099
|
||||||
size 59316
|
size 59637
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:3849590fd946e5d503c6e456da074a9d37e08c9f69bb46ac26493ac0586bc639
|
oid sha256:0387ca568b2fa08a33656c433ed6626ffe2b55a3d90d5a228635629bfcc8a099
|
||||||
size 59316
|
size 59637
|
||||||
|
|||||||
@@ -45,20 +45,6 @@ class UserSessionScreenTests: XCTestCase {
|
|||||||
try await app.assertScreenshot(.userSessionScreenReply)
|
try await app.assertScreenshot(.userSessionScreenReply)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testUserSessionRTE() async throws {
|
|
||||||
let app = Application.launch(.userSessionScreenRTE)
|
|
||||||
|
|
||||||
app.buttons[A11yIdentifiers.homeScreen.roomName(firstRoomName)].tap()
|
|
||||||
XCTAssert(app.staticTexts[firstRoomName].waitForExistence(timeout: 5.0))
|
|
||||||
try await Task.sleep(for: .seconds(1))
|
|
||||||
|
|
||||||
app.buttons[A11yIdentifiers.roomScreen.composerToolbar.openComposeOptions].forceTap()
|
|
||||||
try await app.assertScreenshot(.userSessionScreenRTE, step: 1)
|
|
||||||
|
|
||||||
app.buttons[A11yIdentifiers.roomScreen.attachmentPickerTextFormatting].tap()
|
|
||||||
try await app.assertScreenshot(.userSessionScreenRTE, step: 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
func testElementCall() async throws {
|
func testElementCall() async throws {
|
||||||
let app = Application.launch(.userSessionScreen)
|
let app = Application.launch(.userSessionScreen)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:79e3da37ad9a5d7c61a05c1a2b97cf9b9a5abc7baec1027ef708e9d3dfe02118
|
oid sha256:c848c67896ff09355855508ee15ff790e8616f0ccf1f0bc2a09e712ed37f9fa2
|
||||||
size 330902
|
size 320571
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:1814315276b9621711e1b9f66df068fb47d308297f45318ea89a25ff3676e873
|
oid sha256:816b90d1d31fc84e19ef0318d0619d680ab7d3c84987d811ec86b54738a6cf57
|
||||||
size 708706
|
size 753048
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:9054bcc523d299dbe7ac9d1bf8a872b0263bb90ccc13383224c4a1c71c4c9ec9
|
oid sha256:b03923620460adf38f959544ee655df6215f83d5937536b38f9f97aa3a0f8392
|
||||||
size 785650
|
size 867141
|
||||||
|
|||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:816b90d1d31fc84e19ef0318d0619d680ab7d3c84987d811ec86b54738a6cf57
|
|
||||||
size 753048
|
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:b03923620460adf38f959544ee655df6215f83d5937536b38f9f97aa3a0f8392
|
|
||||||
size 867141
|
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:be1bb4a5e13a7b1be7e4ad38ae50ab5e3ca06a546015c1346a56358b26093696
|
|
||||||
size 465583
|
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:f5431083268d760a1aa3e65967a3be1c91cef27344f83e5e30591b6bb646e79a
|
|
||||||
size 319539
|
|
||||||
@@ -30,7 +30,6 @@ class ComposerToolbarViewModelTests: XCTestCase {
|
|||||||
override func setUp() {
|
override func setUp() {
|
||||||
AppSettings.resetAllSettings()
|
AppSettings.resetAllSettings()
|
||||||
appSettings = AppSettings()
|
appSettings = AppSettings()
|
||||||
appSettings.richTextEditorEnabled = true
|
|
||||||
ServiceLocator.shared.register(appSettings: appSettings)
|
ServiceLocator.shared.register(appSettings: appSettings)
|
||||||
wysiwygViewModel = WysiwygComposerViewModel()
|
wysiwygViewModel = WysiwygComposerViewModel()
|
||||||
completionSuggestionServiceMock = CompletionSuggestionServiceMock(configuration: .init())
|
completionSuggestionServiceMock = CompletionSuggestionServiceMock(configuration: .init())
|
||||||
@@ -39,6 +38,8 @@ class ComposerToolbarViewModelTests: XCTestCase {
|
|||||||
mediaProvider: MockMediaProvider(),
|
mediaProvider: MockMediaProvider(),
|
||||||
appSettings: appSettings,
|
appSettings: appSettings,
|
||||||
mentionDisplayHelper: ComposerMentionDisplayHelper.mock)
|
mentionDisplayHelper: ComposerMentionDisplayHelper.mock)
|
||||||
|
|
||||||
|
viewModel.context.composerFormattingEnabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tearDown() {
|
override func tearDown() {
|
||||||
@@ -94,7 +95,7 @@ class ComposerToolbarViewModelTests: XCTestCase {
|
|||||||
XCTAssertTrue(viewModel.state.bindings.composerFocused)
|
XCTAssertTrue(viewModel.state.bindings.composerFocused)
|
||||||
viewModel.state.composerEmpty = false
|
viewModel.state.composerEmpty = false
|
||||||
viewModel.process(viewAction: .sendMessage)
|
viewModel.process(viewAction: .sendMessage)
|
||||||
XCTAssertTrue(viewModel.state.bindings.composerActionsEnabled)
|
XCTAssertTrue(viewModel.state.bindings.composerFormattingEnabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testAlertIsShownAfterLinkAction() {
|
func testAlertIsShownAfterLinkAction() {
|
||||||
|
|||||||
Reference in New Issue
Block a user