#2380 - Add simple call screen UI test

This commit is contained in:
Stefan Ceriu
2024-01-25 17:08:14 +02:00
committed by Stefan Ceriu
parent da298938cb
commit 119fa09617
72 changed files with 168 additions and 138 deletions
+14 -2
View File
@@ -27,7 +27,7 @@ struct RoomProxyMockConfiguration {
var isSpace = Bool.random()
var isPublic = Bool.random()
var isEncrypted = true
var hasOngoingCall = false
var hasOngoingCall = true
var canonicalAlias: String?
var hasUnreadNotifications = Bool.random()
@@ -43,7 +43,7 @@ struct RoomProxyMockConfiguration {
var ownUserID = "@alice:somewhere.org"
var canUserTriggerRoomNotification = false
var canUserJoinCall = false
var canUserJoinCall = true
var joinedMembersCount = 50
var activeMembersCount = 25
@@ -87,5 +87,17 @@ extension RoomProxyMock {
canUserRedactOtherUserIDReturnValue = .success(false)
canUserTriggerRoomNotificationUserIDReturnValue = .success(configuration.canUserTriggerRoomNotification)
canUserJoinCallUserIDReturnValue = .success(configuration.canUserJoinCall)
let widgetDriver = ElementCallWidgetDriverMock()
widgetDriver.underlyingMessagePublisher = .init()
widgetDriver.underlyingActions = PassthroughSubject().eraseToAnyPublisher()
guard let url = URL(string: "https://call.element.dev/\(UUID().uuidString)#?appPrompt=false") else {
fatalError()
}
widgetDriver.startBaseURLClientIDUseEncryptionReturnValue = .success(url)
elementCallWidgetDriverReturnValue = widgetDriver
}
}
@@ -142,6 +142,7 @@ enum A11yIdentifiers {
let attachmentPickerPoll = "room-attachment_picker_poll"
let attachmentPickerTextFormatting = "room-attachment_picker_text_formatting"
let timelineItemActionMenu = "room-timeline_item_action_menu"
let joinCall = "room-join_call"
let composerToolbar = ComposerToolbar()
@@ -176,12 +176,14 @@ struct RoomScreen: View {
.labelStyle(.titleAndIcon)
}
.buttonStyle(ElementCallButtonStyle())
.accessibilityIdentifier(A11yIdentifiers.roomScreen.joinCall)
} else {
Button {
context.send(viewAction: .presentCall)
} label: {
CompoundIcon(\.videoCallSolid)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.joinCall)
}
}