mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-07-01 12:26:26 +00:00
wip: navigation components
This commit is contained in:
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
0
tests/ui/__init__.py
Normal file
0
tests/ui/__init__.py
Normal file
0
tests/ui/navigation/__init__.py
Normal file
0
tests/ui/navigation/__init__.py
Normal file
31
tests/ui/navigation/test_navhost.py
Normal file
31
tests/ui/navigation/test_navhost.py
Normal file
@ -0,0 +1,31 @@
|
||||
from ui.navigation.navhost import NavHost
|
||||
from ui.navigation.navitem import NavItem
|
||||
|
||||
|
||||
class TestNavHost:
|
||||
def test_auto_append_parent(self):
|
||||
navHost = NavHost()
|
||||
|
||||
navHost.registerNavItem(NavItem(id="aaa.bbb.ccc.ddd"))
|
||||
|
||||
navItems = navHost.navItems
|
||||
|
||||
assert NavItem(id="aaa.bbb.ccc.ddd") in navItems
|
||||
assert NavItem(id="aaa.bbb.ccc") in navItems
|
||||
assert NavItem(id="aaa.bbb") in navItems
|
||||
assert NavItem(id="aaa") in navItems
|
||||
|
||||
def test_auto_select_child(self):
|
||||
navHost = NavHost()
|
||||
|
||||
navHost.registerNavItem(NavItem(id="aaa"))
|
||||
navHost.registerNavItem(NavItem(id="bbb"))
|
||||
|
||||
assert navHost.currentNavItem.id == "aaa"
|
||||
|
||||
navHost.registerNavItem(NavItem(id="aaa.bbb"))
|
||||
navHost.registerNavItem(NavItem(id="aaa.ccc"))
|
||||
|
||||
navHost.navigate("aaa")
|
||||
|
||||
assert navHost.currentNavItem.id == "aaa.bbb"
|
Reference in New Issue
Block a user