@@ -918,73 +918,6 @@ class CtaViewModelTest {
918
918
assertNull(value)
919
919
}
920
920
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
-
988
921
private suspend fun givenDaxOnboardingActive () {
989
922
whenever(mockUserStageStore.getUserAppStage()).thenReturn(AppStage .DAX_ONBOARDING )
990
923
}
0 commit comments