mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 15:09:31 +02:00
Add tests
This commit is contained in:
@@ -39,6 +39,7 @@ enum MockUserSessionOverviewScreenState: MockScreenState, CaseIterable {
|
||||
.currentSession(sessionState: .verified),
|
||||
.otherSession(sessionState: .verified),
|
||||
.otherSession(sessionState: .unverified),
|
||||
.otherSession(sessionState: .permanentlyUnverified),
|
||||
.sessionWithPushNotifications(enabled: true),
|
||||
.sessionWithPushNotifications(enabled: false),
|
||||
.remotelyTogglingPushersNotAvailable]
|
||||
|
||||
@@ -93,4 +93,9 @@ class UserSessionOverviewUITests: MockScreenTestCase {
|
||||
let button = app.buttons[buttonId]
|
||||
XCTAssertTrue(button.exists)
|
||||
}
|
||||
|
||||
func test_whenPermanentlySessionSelected_copyIsCorrect() {
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.otherSession(sessionState: .permanentlyUnverified).title)
|
||||
XCTAssertTrue(app.buttons[VectorL10n.userOtherSessionPermanentlyUnverifiedAdditionalInfo].exists)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,24 @@ class UserSessionCardViewDataTests: XCTestCase {
|
||||
XCTAssertEqual(verificationStateVerified, .unverified)
|
||||
XCTAssertEqual(verificationStateUnverified, .unverified)
|
||||
}
|
||||
|
||||
func testDeviceNotHavingCryptoSupportOnVerifiedDevice() {
|
||||
let mxSession = MockSession(canCrossSign: true)
|
||||
let dataProvider = UserSessionsDataProvider(session: mxSession)
|
||||
|
||||
let verificationState = dataProvider.verificationState(for: nil)
|
||||
|
||||
XCTAssertEqual(verificationState, .permanentlyUnverified)
|
||||
}
|
||||
|
||||
func testDeviceNotHavingCryptoSupportOnUnverifiedDevice() {
|
||||
let mxSession = MockSession(canCrossSign: false)
|
||||
let dataProvider = UserSessionsDataProvider(session: mxSession)
|
||||
|
||||
let verificationState = dataProvider.verificationState(for: nil)
|
||||
|
||||
XCTAssertEqual(verificationState, .permanentlyUnverified)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Mocks
|
||||
|
||||
Reference in New Issue
Block a user