Preserve navigation focus when Anime availability changes
Some checks failed
review/code-gpt Anime removal leaves active root invalid; Back pops a singleton stack (B1).
Some checks failed
review/code-gpt Anime removal leaves active root invalid; Back pops a singleton stack (B1).
This commit is contained in:
parent
53b8358317
commit
9e15dbee8c
3 changed files with 12 additions and 2 deletions
|
|
@ -82,13 +82,18 @@ class AnimeAvailabilityTest {
|
|||
includeItemTypes = listOf(BaseItemKind.SERIES), limit = 1) } returns successQueryResult(titles)
|
||||
val libraries = LibraryReadFacade(api)
|
||||
val session = WolfskinSession().apply {
|
||||
state = ShellState(listOf(ShellPerson(key, key, key.take(1), false, user.id.toString())), key)
|
||||
state = ShellState(listOf(ShellPerson(key, key, key.take(1), count == 0, user.id.toString())), key).apply {
|
||||
pickerVisible = false
|
||||
focusNav(tabs.size)
|
||||
}
|
||||
}
|
||||
val model = WolfskinShellViewModel(context, session, mockk(), mockk(), mockk(), mockk(relaxed = true),
|
||||
libraries, WolfskinSeeAllLists(), conductarr, mockk(relaxed = true))
|
||||
try {
|
||||
requireNotNull(model.onForeground(server, user)).join()
|
||||
assertEquals("$key with $count Anime titles", count > 0, "anime" in session.state!!.tabs)
|
||||
assertEquals("The avatar must remain focused when Anime appears or disappears",
|
||||
session.state!!.tabs.size, session.state!!.navIndex)
|
||||
val home = HomeLibrary(destinations = mapOf("anime" to titles.map { HomeTitle(it.id.toString(), it.name.orEmpty(), "tv") }),
|
||||
destinationTotals = mapOf("anime" to count))
|
||||
assertEquals("An empty Anime audience must not create a Home shelf", count > 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue