Skip to content

Commit

Permalink
remove unused tests
Browse files Browse the repository at this point in the history
These were part of an old approach and are no longer needed
  • Loading branch information
mikescamell committed Oct 21, 2024
1 parent 0563f4c commit ec5e402
Showing 1 changed file with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions app/src/androidTest/java/com/duckduckgo/app/tabs/db/TabsDaoTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -367,66 +367,4 @@ class TabsDaoTest {

assertNull(tabId)
}

@Test
fun whenFindTabIdByUrlPatternQueriedAndTabExistsThenTabIdIdReturned() = runTest {
val tab = TabEntity(
tabId = "TAB_ID",
url = "https://www.duckduckgo.com/",
position = 0,
deletable = true,
)

testee.insertTab(tab)
val tabId = testee.findTabIdByUrlPattern("duckduckgo.com/")

assertEquals(tab.tabId, tabId)
}

@Test
fun whenFindTabIdByUrlPatternQueriedWithFullUrlAndTabExistsThenTabIdReturned() = runTest {
val tab = TabEntity(
tabId = "TAB_ID",
url = "https://www.duckduckgo.com/",
position = 0,
deletable = true,
)

testee.insertTab(tab)
val tabId = testee.findTabIdByUrlPattern("https://www.duckduckgo.com/")

assertEquals(tab.tabId, tabId)
}

@Test
fun whenFindTabIdByUrlPatternQueriedAndMultipleTabsExistThenLastAddedTabIdIdReturned() = runTest {
val tab1 = TabEntity(
tabId = "TAB_ID_1",
url = "https://www.duckduckgo.com/",
position = 0,
)

val tab2 = tab1.copy(tabId = "TAB_ID_2", position = 1)

testee.insertTab(tab1)
testee.insertTab(tab2)
val tabId = testee.findTabIdByUrlPattern("duckduckgo.com/")

assertEquals(tab2.tabId, tabId)
}

@Test
fun whenFindTabIdByUrlPatternQueriedWithNoTrailingSlashAndTabExistsThenNullReturned() = runTest {
val tab = TabEntity(
tabId = "TAB_ID",
url = "https://www.duckduckgo.com/",
position = 0,
deletable = true,
)

testee.insertTab(tab)
val tabId = testee.findTabIdByUrlPattern("duckduckgo.com")

assertNull(tabId)
}
}

0 comments on commit ec5e402

Please sign in to comment.