From 45176c3561ce0c939ca6e224446ff5fad7ae131a Mon Sep 17 00:00:00 2001 From: Chris Brind Date: Sat, 7 Oct 2023 01:00:06 +0100 Subject: [PATCH] fix tests --- DuckDuckGo/OmniBar.swift | 6 ++++++ DuckDuckGoTests/AppSettingsMock.swift | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/DuckDuckGo/OmniBar.swift b/DuckDuckGo/OmniBar.swift index c794e6a359..e7cc7e92e8 100644 --- a/DuckDuckGo/OmniBar.swift +++ b/DuckDuckGo/OmniBar.swift @@ -82,6 +82,12 @@ class OmniBar: UIView { super.init(coder: coder) } + // Tests require this + override init(frame: CGRect) { + appSettings = AppDependencyProvider.shared.appSettings + super.init(frame: frame) + } + override func awakeFromNib() { super.awakeFromNib() configureMenuButton() diff --git a/DuckDuckGoTests/AppSettingsMock.swift b/DuckDuckGoTests/AppSettingsMock.swift index 53f099d6b8..b5af63136e 100644 --- a/DuckDuckGoTests/AppSettingsMock.swift +++ b/DuckDuckGoTests/AppSettingsMock.swift @@ -21,6 +21,11 @@ import Foundation @testable import DuckDuckGo class AppSettingsMock: AppSettings { + + var currentAddressBarPosition: DuckDuckGo.AddressBarPosition = .top + + var showFullSiteAddress: Bool = false + var autofillCredentialsEnabled: Bool = false var autofillCredentialsSavePromptShowAtLeastOnce: Bool = false