mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-18 11:55:38 -04:00
#1648 Add unit test for open search in new tab action
This commit is contained in:
parent
1114e94c86
commit
0539f15bfb
@ -45,6 +45,7 @@ import org.kiwix.kiwixmobile.core.search.viewmodel.Action.ExitedSearch
|
|||||||
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.Filter
|
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.Filter
|
||||||
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.OnItemClick
|
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.OnItemClick
|
||||||
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.OnItemLongClick
|
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.OnItemLongClick
|
||||||
|
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.OnOpenInNewTabClick
|
||||||
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.ReceivedPromptForSpeechInput
|
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.ReceivedPromptForSpeechInput
|
||||||
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.ScreenWasStartedFrom
|
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.ScreenWasStartedFrom
|
||||||
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.StartSpeechInputFailed
|
import org.kiwix.kiwixmobile.core.search.viewmodel.Action.StartSpeechInputFailed
|
||||||
@ -226,7 +227,17 @@ internal class SearchViewModelTest {
|
|||||||
actionResultsInEffects(
|
actionResultsInEffects(
|
||||||
OnItemClick(searchListItem),
|
OnItemClick(searchListItem),
|
||||||
SaveSearchToRecents(recentSearchDao, searchListItem, "id"),
|
SaveSearchToRecents(recentSearchDao, searchListItem, "id"),
|
||||||
OpenSearchItem(searchListItem)
|
OpenSearchItem(searchListItem, false)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `OnOpenInNewTabClick offers Saves and Opens in new tab`() {
|
||||||
|
val searchListItem = RecentSearchListItem("")
|
||||||
|
actionResultsInEffects(
|
||||||
|
OnOpenInNewTabClick(searchListItem),
|
||||||
|
SaveSearchToRecents(recentSearchDao, searchListItem, "id"),
|
||||||
|
OpenSearchItem(searchListItem, true)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user