Skip to content

Commit 79ddfaf

Browse files
committed
Fix the failing unit tests
1 parent 7ea4927 commit 79ddfaf

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

browser-mode/browser-mode-impl/src/test/kotlin/com/duckduckgo/browsermode/impl/RealWebViewModeInitializerTest.kt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,21 @@ class RealWebViewModeInitializerTest {
3737
)
3838

3939
@Test
40-
fun `bind returns success when Fire mode is available and profile binding succeeds`() {
40+
fun `bind returns success when Fire mode is available and Fire profile binding succeeds`() {
4141
val result = testee.bind(webView, BrowserMode.FIRE)
4242

4343
assertTrue(result.isSuccess)
4444
assertEquals(listOf(BoundProfile(webView, BrowserMode.FIRE.profileName)), webViewProfileBinder.boundProfiles)
4545
}
4646

47+
@Test
48+
fun `bind returns success when Fire mode is available and regular profile binding succeeds`() {
49+
val result = testee.bind(webView, BrowserMode.REGULAR)
50+
51+
assertTrue(result.isSuccess)
52+
assertEquals(listOf(BoundProfile(webView, BrowserMode.REGULAR.profileName)), webViewProfileBinder.boundProfiles)
53+
}
54+
4755
@Test
4856
fun `bind returns failure when profile binding throws`() {
4957
val expected = IllegalStateException("WebKit profile binding failed")
@@ -67,12 +75,13 @@ class RealWebViewModeInitializerTest {
6775
}
6876

6977
@Test
70-
fun `bind returns success and skips profile binding when Fire mode is unavailable for regular profile`() {
78+
fun `bind returns failure and skips profile binding when Fire mode is unavailable for regular profile`() {
7179
fireModeAvailability.available = false
7280

7381
val result = testee.bind(webView, BrowserMode.REGULAR)
7482

75-
assertTrue(result.isSuccess)
83+
assertTrue(result.isFailure)
84+
assertTrue(result.exceptionOrNull() is IllegalStateException)
7685
assertTrue(webViewProfileBinder.boundProfiles.isEmpty())
7786
}
7887

0 commit comments

Comments
 (0)