File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
androidTest/java/com/duckduckgo/app/browser
main/java/com/duckduckgo/app/browser Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -3248,6 +3248,21 @@ class BrowserTabViewModelTest {
32483248 assertCommandIssued<Navigate >()
32493249 }
32503250
3251+ @Test
3252+ fun whenSubmittedQueryAndNavigationStateIsNullThenResetHistoryCommandSent () {
3253+ whenever(mockOmnibarConverter.convertQueryToUrl(" nytimes.com" , null )).thenReturn(" nytimes.com" )
3254+ testee.onUserSubmittedQuery(" nytimes.com" )
3255+ assertCommandIssued<Command .ResetHistory >()
3256+ }
3257+
3258+ @Test
3259+ fun whenSubmittedQueryAndNavigationStateIsNotNullThenResetHistoryCommandNotSent () {
3260+ setupNavigation(isBrowsing = true )
3261+ whenever(mockOmnibarConverter.convertQueryToUrl(" nytimes.com" , null )).thenReturn(" nytimes.com" )
3262+ testee.onUserSubmittedQuery(" nytimes.com" )
3263+ assertCommandNotIssued<Command .ResetHistory >()
3264+ }
3265+
32513266 private suspend fun givenFireButtonPulsing () {
32523267 whenever(mockUserStageStore.getUserAppStage()).thenReturn(AppStage .DAX_ONBOARDING )
32533268 dismissedCtaDaoChannel.send(listOf (DismissedCta (CtaId .DAX_DIALOG_TRACKERS_FOUND )))
Original file line number Diff line number Diff line change @@ -619,7 +619,7 @@ class BrowserTabViewModel(
619619 }
620620
621621 private fun shouldClearHistoryOnNewQuery (): Boolean {
622- val navigation = webNavigationState ? : return false
622+ val navigation = webNavigationState ? : return true
623623 return ! currentBrowserViewState().browserShowing && navigation.hasNavigationHistory
624624 }
625625
You can’t perform that action at this time.
0 commit comments