Skip to content

Commit e50f71a

Browse files
authored
Onboarding: Remove auto complete pixel (#6259)
Task/Issue URL: https://app.asana.com/1/137249556945/task/1209881324858027?focus=true ### Description Remove temporary logic and pixel when onboarding auto complete ### Steps to test this PR - [x] Fresh install - [x] Complete the onboarding flow and verify that everything works as expected ### No UI changes
1 parent 2a7303f commit e50f71a

File tree

3 files changed

+0
-80
lines changed

3 files changed

+0
-80
lines changed

app/src/androidTest/java/com/duckduckgo/app/cta/ui/CtaViewModelTest.kt

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -918,73 +918,6 @@ class CtaViewModelTest {
918918
assertNull(value)
919919
}
920920

921-
@Test
922-
fun givenPrivacyProEligibleWhenRefreshCtaIfNotAllRequiredCtasShownThenNotCompleteOnboarding() = runTest {
923-
givenDaxOnboardingActive()
924-
whenever(mockExtendedOnboardingFeatureToggles.noBrowserCtas()).thenReturn(mockEnabledToggle)
925-
whenever(mockExtendedOnboardingFeatureToggles.privacyProCta()).thenReturn(mockEnabledToggle)
926-
whenever(mockSubscriptions.isEligible()).thenReturn(true)
927-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_INTRO)).thenReturn(true)
928-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_DIALOG_SERP)).thenReturn(true)
929-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_INTRO_VISIT_SITE)).thenReturn(true)
930-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_END)).thenReturn(true)
931-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_INTRO_PRIVACY_PRO)).thenReturn(false)
932-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_DIALOG_TRACKERS_FOUND)).thenReturn(true)
933-
whenever(mockDismissedCtaDao.exists(CtaId.ADD_WIDGET)).thenReturn(true)
934-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_FIRE_BUTTON)).thenReturn(true)
935-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_FIRE_BUTTON_PULSE)).thenReturn(true)
936-
937-
testee.refreshCta(coroutineRule.testDispatcher, isBrowserShowing = false, detectedRefreshPatterns = detectedRefreshPatterns)
938-
939-
verify(mockPixel, never()).fire(ONBOARDING_AUTO_COMPLETE)
940-
verify(mockUserStageStore, never()).stageCompleted(AppStage.DAX_ONBOARDING)
941-
}
942-
943-
@Test
944-
fun givenPrivacyProEligibleWhenRefreshCtaIfOnboardingActiveAndAllRequiredCtasShownThenCompleteOnboardingAndSendAutoCompletePixel() = runTest {
945-
givenDaxOnboardingActive()
946-
whenever(mockExtendedOnboardingFeatureToggles.noBrowserCtas()).thenReturn(mockEnabledToggle)
947-
whenever(mockExtendedOnboardingFeatureToggles.privacyProCta()).thenReturn(mockEnabledToggle)
948-
whenever(mockSubscriptions.isEligible()).thenReturn(true)
949-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_INTRO)).thenReturn(true)
950-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_DIALOG_SERP)).thenReturn(true)
951-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_INTRO_VISIT_SITE)).thenReturn(true)
952-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_END)).thenReturn(true)
953-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_INTRO_PRIVACY_PRO)).thenReturn(true)
954-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_DIALOG_TRACKERS_FOUND)).thenReturn(true)
955-
whenever(mockDismissedCtaDao.exists(CtaId.ADD_WIDGET)).thenReturn(true)
956-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_FIRE_BUTTON)).thenReturn(true)
957-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_FIRE_BUTTON_PULSE)).thenReturn(true)
958-
959-
val value = testee.refreshCta(coroutineRule.testDispatcher, isBrowserShowing = false, detectedRefreshPatterns = detectedRefreshPatterns)
960-
assertNull(value)
961-
962-
verify(mockPixel).fire(ONBOARDING_AUTO_COMPLETE)
963-
verify(mockUserStageStore).stageCompleted(AppStage.DAX_ONBOARDING)
964-
}
965-
966-
@Test
967-
fun givenPrivacyProNotEligibleWhenRefreshCtaIfOnboardingActiveAndAllRequiredCtasShownThenCompleteOnboardingAndSendAutoCompletePixel() = runTest {
968-
givenDaxOnboardingActive()
969-
whenever(mockExtendedOnboardingFeatureToggles.noBrowserCtas()).thenReturn(mockEnabledToggle)
970-
whenever(mockExtendedOnboardingFeatureToggles.privacyProCta()).thenReturn(mockEnabledToggle)
971-
whenever(mockSubscriptions.isEligible()).thenReturn(false)
972-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_INTRO)).thenReturn(true)
973-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_DIALOG_SERP)).thenReturn(true)
974-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_INTRO_VISIT_SITE)).thenReturn(true)
975-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_END)).thenReturn(true)
976-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_DIALOG_TRACKERS_FOUND)).thenReturn(true)
977-
whenever(mockDismissedCtaDao.exists(CtaId.ADD_WIDGET)).thenReturn(true)
978-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_FIRE_BUTTON)).thenReturn(true)
979-
whenever(mockDismissedCtaDao.exists(CtaId.DAX_FIRE_BUTTON_PULSE)).thenReturn(true)
980-
981-
val value = testee.refreshCta(coroutineRule.testDispatcher, isBrowserShowing = false, detectedRefreshPatterns = detectedRefreshPatterns)
982-
assertNull(value)
983-
984-
verify(mockPixel).fire(ONBOARDING_AUTO_COMPLETE)
985-
verify(mockUserStageStore).stageCompleted(AppStage.DAX_ONBOARDING)
986-
}
987-
988921
private suspend fun givenDaxOnboardingActive() {
989922
whenever(mockUserStageStore.getUserAppStage()).thenReturn(AppStage.DAX_ONBOARDING)
990923
}

app/src/main/java/com/duckduckgo/app/cta/ui/CtaViewModel.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ class CtaViewModel @Inject constructor(
209209
detectedRefreshPatterns: Set<RefreshPattern>,
210210
): Cta? {
211211
return withContext(dispatcher) {
212-
markOnboardingAsCompletedIfRequiredCtasShown()
213212
if (isBrowserShowing) {
214213
getBrowserCta(site, detectedRefreshPatterns)
215214
} else {
@@ -218,15 +217,6 @@ class CtaViewModel @Inject constructor(
218217
}
219218
}
220219

221-
// Temporary function to complete onboarding if all CTAs were shown
222-
private suspend fun markOnboardingAsCompletedIfRequiredCtasShown() {
223-
if (daxOnboardingActive() && allOnboardingCtasShown()) {
224-
logcat { "Auto completing DAX ONBOARDING" }
225-
userStageStore.stageCompleted(AppStage.DAX_ONBOARDING)
226-
pixel.fire(AppPixelName.ONBOARDING_AUTO_COMPLETE)
227-
}
228-
}
229-
230220
suspend fun getFireDialogCta(): OnboardingDaxDialogCta? {
231221
return withContext(dispatchers.io()) {
232222
if (!daxOnboardingActive() || daxDialogFireEducationShown()) return@withContext null

app/src/main/java/com/duckduckgo/app/pixels/AppPixelName.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ enum class AppPixelName(override val pixelName: String) : Pixel.PixelName {
5555
ONBOARDING_DAX_CTA_DISMISS_BUTTON("m_onboarding_dax_cta_dismiss"),
5656
ONBOARDING_VISIT_SITE_CTA_SHOWN("onboarding_visit_site_cta_shown"),
5757

58-
// Temporary Pixel
59-
ONBOARDING_AUTO_COMPLETE("onboarding_auto_complete"),
60-
6158
BROWSER_MENU_ALLOWLIST_ADD("mb_wla"),
6259
BROWSER_MENU_ALLOWLIST_REMOVE("mb_wlr"),
6360
BROWSER_PULL_TO_REFRESH("m_browser_pull_to_refresh"),

0 commit comments

Comments
 (0)