mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
fix(healthchat): keep legacy accounts on the typed account provider
This commit is contained in:
@@ -225,6 +225,23 @@ final class AuthenticationStartScreenViewModelTests {
|
||||
#expect(account == classicAppAccount)
|
||||
}
|
||||
|
||||
@Test
|
||||
func healthChatProviderAllowsLegacyAccount() async {
|
||||
// Given the account providers HealthChat ships with and an account from the legacy HealthChat app.
|
||||
let classicAppAccount = makeClassicAppAccount(serverName: "healthchat.ch",
|
||||
homeserverURL: "https://matrix.healthchat.ch")
|
||||
appSettings = HealthChatAppSettingsHook().configure(appSettings)
|
||||
await setupViewModel(classicAppAccount: classicAppAccount)
|
||||
|
||||
// Then the legacy account must still be offered for migration. A silent failure here logs every
|
||||
// updating user out of the migration path, so the real hook values are tested, not a stand-in.
|
||||
guard case .welcomeBack(let account) = context.viewState.classicAppMode else {
|
||||
Issue.record("Expected classicAppMode to be .welcomeBack")
|
||||
return
|
||||
}
|
||||
#expect(account == classicAppAccount)
|
||||
}
|
||||
|
||||
@Test
|
||||
func singleProviderWithDisallowedClassicAppAccount() async {
|
||||
// Given a view model for an app that only allows a single provider that does NOT match the Classic account's server.
|
||||
|
||||
Reference in New Issue
Block a user