mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 19:34:25 +02:00
Merge branch 'develop' into aleksandrs/7014_sign_out_of_other_sessions
This commit is contained in:
+8
-8
@@ -64,9 +64,9 @@ class UserOtherSessionsUITests: MockScreenTestCase {
|
||||
|
||||
app.buttons["More"].tap()
|
||||
app.buttons["Select sessions"].tap()
|
||||
let singOutButton = app.buttons["Sign out"]
|
||||
XCTAssertTrue(singOutButton.exists)
|
||||
XCTAssertFalse(singOutButton.isEnabled)
|
||||
let signOutButton = app.buttons["Sign out"]
|
||||
XCTAssertTrue(signOutButton.exists)
|
||||
XCTAssertFalse(signOutButton.isEnabled)
|
||||
XCTAssertTrue(app.buttons["Select All"].exists)
|
||||
XCTAssertTrue(app.buttons["Cancel"].exists)
|
||||
}
|
||||
@@ -95,13 +95,13 @@ class UserOtherSessionsUITests: MockScreenTestCase {
|
||||
app.goToScreenWithIdentifier(MockUserOtherSessionsScreenState.all.title)
|
||||
app.buttons["More"].tap()
|
||||
app.buttons["Select sessions"].tap()
|
||||
let singOutButton = app.buttons["Sign out"]
|
||||
XCTAssertTrue(singOutButton.exists)
|
||||
XCTAssertFalse(singOutButton.isEnabled)
|
||||
let signOutButton = app.buttons["Sign out"]
|
||||
XCTAssertTrue(signOutButton.exists)
|
||||
XCTAssertFalse(signOutButton.isEnabled)
|
||||
let sessionListItem = app.buttons["UserSessionListItem_0"]
|
||||
sessionListItem.tap()
|
||||
XCTAssertTrue(singOutButton.isEnabled)
|
||||
XCTAssertTrue(signOutButton.isEnabled)
|
||||
sessionListItem.tap()
|
||||
XCTAssertFalse(singOutButton.isEnabled)
|
||||
XCTAssertFalse(signOutButton.isEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -61,4 +61,14 @@ class UserSessionOverviewUITests: MockScreenTestCase {
|
||||
XCTAssertTrue(app.staticTexts[VectorL10n.userSessionPushNotifications].exists)
|
||||
XCTAssertTrue(app.staticTexts[VectorL10n.userSessionPushNotificationsMessage].exists)
|
||||
}
|
||||
|
||||
func test_whenSessionSelected_kebabMenuShows() {
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.otherSession.title)
|
||||
let navTitle = VectorL10n.userSessionOverviewSessionTitle
|
||||
let barButton = app.navigationBars[navTitle].buttons["Menu"]
|
||||
XCTAssertTrue(barButton.exists)
|
||||
barButton.tap()
|
||||
XCTAssertTrue(app.buttons[VectorL10n.signOut].exists)
|
||||
XCTAssertTrue(app.buttons[VectorL10n.manageSessionRename].exists)
|
||||
}
|
||||
}
|
||||
|
||||
+18
-2
@@ -63,8 +63,23 @@ struct UserSessionOverview: View {
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
Menu {
|
||||
Button { viewModel.send(viewAction: .renameSession) } label: {
|
||||
Label(VectorL10n.manageSessionRename, systemImage: "pencil")
|
||||
SwiftUI.Section {
|
||||
Button { viewModel.send(viewAction: .renameSession) } label: {
|
||||
Label(VectorL10n.manageSessionRename, systemImage: "pencil")
|
||||
}
|
||||
.accessibilityIdentifier(VectorL10n.manageSessionRename)
|
||||
}
|
||||
|
||||
if #available(iOS 15, *) {
|
||||
Button(role: .destructive) { viewModel.send(viewAction: .logoutOfSession) } label: {
|
||||
Label(VectorL10n.signOut, systemImage: "rectangle.portrait.and.arrow.right.fill")
|
||||
}
|
||||
.accessibilityIdentifier(VectorL10n.signOut)
|
||||
} else {
|
||||
Button { viewModel.send(viewAction: .logoutOfSession) } label: {
|
||||
Label(VectorL10n.signOut, systemImage: "rectangle.righthalf.inset.fill.arrow.right")
|
||||
}
|
||||
.accessibilityIdentifier(VectorL10n.signOut)
|
||||
}
|
||||
} label: {
|
||||
Image(systemName: "ellipsis")
|
||||
@@ -73,6 +88,7 @@ struct UserSessionOverview: View {
|
||||
.padding(.vertical, 12)
|
||||
}
|
||||
.offset(x: 4) // Re-align the symbol after applying padding.
|
||||
.accessibilityIdentifier("Menu")
|
||||
}
|
||||
}
|
||||
.accentColor(theme.colors.accent)
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ class UserSessionsDataProvider: UserSessionsDataProviderProtocol {
|
||||
func verificationState(for deviceInfo: MXDeviceInfo?) -> UserSessionInfo.VerificationState {
|
||||
guard let deviceInfo = deviceInfo else { return .unknown }
|
||||
|
||||
guard session.crypto?.crossSigning?.canCrossSign == true else {
|
||||
guard session.crypto?.crossSigning.canCrossSign == true else {
|
||||
return deviceInfo.deviceId == session.myDeviceId ? .unverified : .unknown
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user