Skip to content

Commit 93c224b

Browse files
committed
cleanup test
1 parent e95fd56 commit 93c224b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/src/test/java/com/duckduckgo/app/browser/SpecialUrlDetectorImplTest.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import com.duckduckgo.app.browser.SpecialUrlDetectorImpl.Companion.SMS_MAX_LENGT
3232
import com.duckduckgo.app.browser.applinks.ExternalAppIntentFlagsFeature
3333
import com.duckduckgo.app.browser.duckchat.AIChatQueryDetectionFeature
3434
import com.duckduckgo.app.pixels.remoteconfig.AndroidBrowserConfigFeature
35+
import com.duckduckgo.duckchat.api.DuckAiFeatureState
3536
import com.duckduckgo.duckchat.api.DuckChat
3637
import com.duckduckgo.duckplayer.api.DuckPlayer
3738
import com.duckduckgo.feature.toggles.api.FakeFeatureToggleFactory
@@ -43,6 +44,7 @@ import com.duckduckgo.privacy.config.api.TrackingParameters
4344
import com.duckduckgo.subscriptions.api.Subscriptions
4445
import junit.framework.TestCase.assertNull
4546
import junit.framework.TestCase.assertTrue
47+
import kotlinx.coroutines.flow.MutableStateFlow
4648
import kotlinx.coroutines.test.runTest
4749
import org.junit.Assert.assertEquals
4850
import org.junit.Before
@@ -73,12 +75,16 @@ class SpecialUrlDetectorImplTest {
7375

7476
val mockDuckChat: DuckChat = mock()
7577

78+
val mockDuckAiFeature: DuckAiFeatureState = mock()
79+
7680
val mockAIChatQueryDetectionFeature: AIChatQueryDetectionFeature = mock()
7781

7882
val mockAIChatQueryDetectionFeatureToggle: Toggle = mock()
7983

8084
val androidBrowserConfigFeature: AndroidBrowserConfigFeature = FakeFeatureToggleFactory.create(AndroidBrowserConfigFeature::class.java)
8185

86+
private val mockDuckAiFullScreenMode = MutableStateFlow(false)
87+
8288
@Before
8389
fun setup() = runTest {
8490
testee = spy(
@@ -92,12 +98,14 @@ class SpecialUrlDetectorImplTest {
9298
duckChat = mockDuckChat,
9399
aiChatQueryDetectionFeature = mockAIChatQueryDetectionFeature,
94100
androidBrowserConfigFeature = androidBrowserConfigFeature,
101+
duckAiFeatureState = mockDuckAiFeature,
95102
),
96103
)
97104
whenever(mockPackageManager.queryIntentActivities(any(), anyInt())).thenReturn(emptyList())
98105
whenever(mockDuckPlayer.willNavigateToDuckPlayer(any())).thenReturn(false)
99106
whenever(mockAIChatQueryDetectionFeatureToggle.isEnabled()).thenReturn(false)
100107
whenever(mockAIChatQueryDetectionFeature.self()).thenReturn(mockAIChatQueryDetectionFeatureToggle)
108+
whenever(mockDuckAiFeature.showFullScreenMode).thenReturn(mockDuckAiFullScreenMode)
101109
androidBrowserConfigFeature.handleIntentScheme().setRawStoredState(State(true))
102110
androidBrowserConfigFeature.validateIntentResolution().setRawStoredState(State(true))
103111
}

0 commit comments

Comments
 (0)