ios/BitwardenShared/UI/Auth/ProfileSwitcher/TestHelpers/MockProfileSwitcherHandlerProcessor.swift
2025-10-30 09:43:05 -05:00

42 lines
1.2 KiB
Swift

import BitwardenKit
import BitwardenKitMocks
@testable import BitwardenShared
class MockProfileSwitcherHandlerProcessor:
MockProcessor<ProfileSwitcherState, ProfileSwitcherAction, ProfileSwitcherEffect>,
ProfileSwitcherHandler {
var alertsShown = [BitwardenKit.Alert]()
var allowLockAndLogout = true
var dismissProfileSwitcherCalled = false
var handleAuthEvents = [AuthEvent]()
var profileSwitcherState: ProfileSwitcherState
var profileServices: ProfileServices
var shouldHideAddAccount = false
var showProfileSwitcherCalled = false
var toast: Toast?
init(services: ProfileServices, state: ProfileSwitcherState) {
profileSwitcherState = state
profileServices = services
super.init(state: state)
}
func dismissProfileSwitcher() {
dismissProfileSwitcherCalled = true
}
func handleAuthEvent(_ authEvent: BitwardenShared.AuthEvent) async {
handleAuthEvents.append(authEvent)
}
func showAddAccount() {}
func showAlert(_ alert: BitwardenKit.Alert) {
alertsShown.append(alert)
}
func showProfileSwitcher() {
showProfileSwitcherCalled = true
}
}