diff --git a/DuckDuckGo/DaxDialogs.swift b/DuckDuckGo/DaxDialogs.swift index 8fc63f8e3a..d1793efb6b 100644 --- a/DuckDuckGo/DaxDialogs.swift +++ b/DuckDuckGo/DaxDialogs.swift @@ -279,7 +279,6 @@ final class DaxDialogs: NewTabDialogSpecProvider, ContextualOnboardingLogic { var isEnabled: Bool { // skip dax dialogs in integration tests guard ProcessInfo.processInfo.environment["DAXDIALOGS"] != "false" else { return false } - guard variantManager.shouldShowDaxDialogs else { return false } return !settings.isDismissed } diff --git a/DuckDuckGo/FullscreenDaxDialogViewController.swift b/DuckDuckGo/FullscreenDaxDialogViewController.swift index 3a49583756..e9bf422811 100644 --- a/DuckDuckGo/FullscreenDaxDialogViewController.swift +++ b/DuckDuckGo/FullscreenDaxDialogViewController.swift @@ -79,7 +79,7 @@ class FullscreenDaxDialogViewController: UIViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if let spec = spec { - Pixel.fire(pixel: spec.pixelName, withAdditionalParameters: [ "wo": woShown ? "1" : "0" ]) + Pixel.fire(pixel: spec.pixelName, withAdditionalParameters: [ "wo": woShown ? "1" : "0" ], includedParameters: [.appVersion, .atb]) } containerHeight.constant = daxDialogViewController?.calculateHeight() ?? 0 daxDialogViewController?.start() diff --git a/DuckDuckGo/HomeViewController.swift b/DuckDuckGo/HomeViewController.swift index 71bb361a88..0ff2977bb3 100644 --- a/DuckDuckGo/HomeViewController.swift +++ b/DuckDuckGo/HomeViewController.swift @@ -258,8 +258,6 @@ class HomeViewController: UIViewController, NewTabPage { } func presentNextDaxDialog() { - guard variantManager.shouldShowDaxDialogs else { return } - if variantManager.isContextualDaxDialogsEnabled { showNextDaxDialogNew(dialogProvider: newTabDialogTypeProvider, factory: newTabDialogFactory) } else { diff --git a/DuckDuckGo/MainViewController.swift b/DuckDuckGo/MainViewController.swift index 5b1f33e12f..6233baf103 100644 --- a/DuckDuckGo/MainViewController.swift +++ b/DuckDuckGo/MainViewController.swift @@ -2737,8 +2737,7 @@ extension MainViewController: AutoClearWorker { self.privacyProDataReporter.saveFireCount() // Ideally this should happen once data clearing has finished AND the animation is finished - // `showNextDaxDialog: true` only set from old onboarding FireDialog ActionSheet - if showNextDaxDialog && self.variantManager.shouldShowDaxDialogs { + if showNextDaxDialog { self.homeController?.showNextDaxDialog() } else if KeyboardSettings().onNewTab { let showKeyboardAfterFireButton = DispatchWorkItem { diff --git a/DuckDuckGo/NewTabPageViewController.swift b/DuckDuckGo/NewTabPageViewController.swift index c8ae9157bb..ffd3e9af70 100644 --- a/DuckDuckGo/NewTabPageViewController.swift +++ b/DuckDuckGo/NewTabPageViewController.swift @@ -165,9 +165,7 @@ final class NewTabPageViewController: UIHostingController DetectedRequest { let entity = entityProvider.entity(forHost: url.host!) return DetectedRequest(url: url.absoluteString, diff --git a/DuckDuckGoTests/DefaultVariantManagerOnboardingTests.swift b/DuckDuckGoTests/DefaultVariantManagerOnboardingTests.swift index b9e460038d..23d5d06c5f 100644 --- a/DuckDuckGoTests/DefaultVariantManagerOnboardingTests.swift +++ b/DuckDuckGoTests/DefaultVariantManagerOnboardingTests.swift @@ -94,52 +94,6 @@ final class DefaultVariantManagerOnboardingTests: XCTestCase { XCTAssertFalse(result) } - // MARK: - Should Show Dax Dialogs - - func testWhenShouldShowDaxDialogs_AndFeaturesContainOnboardingIntro_ThenReturnFalse() { - // GIVEN - let sut = makeVariantManager(features: [.newOnboardingIntro]) - - // WHEN - let result = sut.shouldShowDaxDialogs - - // THEN - XCTAssertFalse(result) - } - - func testWhenShouldShowDaxDialogs_AndFeaturesContainOnboardingIntroAndContextualDaxDialogs_ThenReturnTrue() { - // GIVEN - let sut = makeVariantManager(features: [.newOnboardingIntro, .contextualDaxDialogs]) - - // WHEN - let result = sut.shouldShowDaxDialogs - - // THEN - XCTAssertTrue(result) - } - - func testWhenShouldShowDaxDialogs_AndFeaturesContainOnboardingHighlights_ThenReturnTrue() { - // GIVEN - let sut = makeVariantManager(features: [.newOnboardingIntroHighlights]) - - // WHEN - let result = sut.shouldShowDaxDialogs - - // THEN - XCTAssertTrue(result) - } - - func testWhenShouldShowDaxDialogs_AndFeaturesIsEmpty_ThenReturnTrue() { - // GIVEN - let sut = makeVariantManager(features: []) - - // WHEN - let result = sut.shouldShowDaxDialogs - - // THEN - XCTAssertTrue(result) - } - // MARK: - Is Contextual Dax Dialogs Enabled func testWhenIsContextualDaxDialogsEnabled_AndFeaturesContainContextualDaxDialogs_ThenReturnTrue() { diff --git a/DuckDuckGoTests/HomeViewControllerDaxDialogTests.swift b/DuckDuckGoTests/HomeViewControllerDaxDialogTests.swift index e9d3ebf36b..66c9506142 100644 --- a/DuckDuckGoTests/HomeViewControllerDaxDialogTests.swift +++ b/DuckDuckGoTests/HomeViewControllerDaxDialogTests.swift @@ -109,23 +109,6 @@ final class HomeViewControllerDaxDialogTests: XCTestCase { XCTAssertNotNil(self.dialogFactory.onDismiss) } - func testWhenDaxDialogsAreNotEnabled_OnDidAppear_NothingHappens() throws { - // GIVEN - variantManager.currentVariant = MockVariant(features: [.newOnboardingIntro]) - let expectedSpec = randomDialogType() - specProvider.specToReturn = expectedSpec - - // WHEN - hvc.viewDidAppear(false) - - // THEN - XCTAssertNil(self.variantManager.capturedFeatureName) - XCTAssertFalse(self.specProvider.nextHomeScreenMessageCalled) - XCTAssertFalse(self.specProvider.nextHomeScreenMessageNewCalled) - XCTAssertNil(self.dialogFactory.homeDialog) - XCTAssertNil(self.dialogFactory.onDismiss) - } - func testWhenOldOnboarding_OnDidAppear_NothingPassedDialogFactory() throws { // GIVEN variantManager.supportedFeatures = [] @@ -197,18 +180,6 @@ final class HomeViewControllerDaxDialogTests: XCTestCase { XCTAssertFalse(specProvider.nextHomeScreenMessageNewCalled) } - func testWhenShowNextDaxDialog_AndShouldNotShowDaxDialogs_ThenReturnFalse() { - // GIVEN - variantManager.currentVariant = MockVariant(features: [.newOnboardingIntro]) - - // WHEN - hvc.showNextDaxDialog() - - // THEN - XCTAssertFalse(specProvider.nextHomeScreenMessageCalled) - XCTAssertFalse(specProvider.nextHomeScreenMessageNewCalled) - } - private func randomDialogType() -> DaxDialogs.HomeScreenSpec { let specs: [DaxDialogs.HomeScreenSpec] = [.initial, .subsequent, .final, .addFavorite] return specs.randomElement()!