新增
This commit is contained in:
@@ -43,6 +43,7 @@ def shell_window(
|
||||
NavigationItem(key, title, glyph, _ShellPageDouble, (permission,))
|
||||
for key, title, glyph, permission in (
|
||||
("reception", "接诊台", "◎", "doctor.appointment/lists"),
|
||||
("appointments", "挂号列表", "号", "doctor.appointment/lists"),
|
||||
("prescription_library", "我的处方库", "方", "tcm.prescriptionLibrary/lists"),
|
||||
("prescriptions", "已开处方", "笺", "tcm.prescription/lists"),
|
||||
("patients", "我的患者", "患", "firstvisit.myPatient/lists"),
|
||||
@@ -77,19 +78,19 @@ def test_shell_matches_admin_geometry_at_both_acceptance_sizes(
|
||||
shell_window.resize(width, height)
|
||||
application.processEvents()
|
||||
|
||||
assert shell_window.sidebar.width() == 183
|
||||
assert shell_window.topbar.height() == 50
|
||||
assert shell_window.tabs_host.height() == 40
|
||||
assert shell_window.workspace.width() == width - 183
|
||||
assert shell_window.stack.width() == width - 183
|
||||
assert shell_window.stack.height() == height - 90
|
||||
assert shell_window.sidebar.width() == 208
|
||||
assert shell_window.topbar.height() == 58
|
||||
assert shell_window.tabs_host.height() == 42
|
||||
assert shell_window.workspace.width() == width - 208
|
||||
assert shell_window.stack.width() == width - 208
|
||||
assert shell_window.stack.height() == height - 100
|
||||
assert shell_window.stack.geometry().right() < shell_window.workspace.width()
|
||||
assert shell_window.stack.geometry().bottom() < shell_window.workspace.height()
|
||||
|
||||
image = shell_window.grab().toImage()
|
||||
assert image.pixelColor(100, 100).name().lower() == "#1d2124"
|
||||
assert image.pixelColor(200, 10).name().lower() == "#ffffff"
|
||||
assert image.pixelColor(190, 70).name().lower() == "#ffffff"
|
||||
assert image.pixelColor(20, 300).name().lower() == "#ffffff"
|
||||
assert image.pixelColor(500, 10).name().lower() == "#ffffff"
|
||||
assert image.pixelColor(220, 110).name().lower() == "#f5f7fb"
|
||||
|
||||
|
||||
def test_every_visible_page_navigates_and_visited_tabs_track_active_page(
|
||||
@@ -100,6 +101,7 @@ def test_every_visible_page_navigates_and_visited_tabs_track_active_page(
|
||||
|
||||
for key in (
|
||||
"reception",
|
||||
"appointments",
|
||||
"prescription_library",
|
||||
"prescriptions",
|
||||
"patients",
|
||||
@@ -112,13 +114,15 @@ def test_every_visible_page_navigates_and_visited_tabs_track_active_page(
|
||||
|
||||
assert shell_window.visited_tab_keys() == (
|
||||
"reception",
|
||||
"appointments",
|
||||
"prescription_library",
|
||||
"prescriptions",
|
||||
"patients",
|
||||
"consultations",
|
||||
)
|
||||
assert changed[-5:] == [
|
||||
assert changed[-6:] == [
|
||||
"reception",
|
||||
"appointments",
|
||||
"prescription_library",
|
||||
"prescriptions",
|
||||
"patients",
|
||||
@@ -151,12 +155,12 @@ def test_sidebar_collapse_preserves_active_navigation(shell_window: ShellWindow)
|
||||
assert shell_window.navigate("consultations")
|
||||
|
||||
shell_window.toggle_sidebar()
|
||||
assert shell_window.sidebar.width() == 64
|
||||
assert shell_window.nav_buttons["consultations"].text() == "询"
|
||||
assert shell_window.sidebar.width() == 72
|
||||
assert shell_window.nav_buttons["consultations"].text() == ""
|
||||
assert shell_window.nav_buttons["consultations"].isChecked()
|
||||
|
||||
shell_window.toggle_sidebar()
|
||||
assert shell_window.sidebar.width() == 183
|
||||
assert shell_window.sidebar.width() == 208
|
||||
assert shell_window.nav_buttons["consultations"].text().endswith("问诊列表")
|
||||
assert shell_window.nav_buttons["consultations"].isChecked()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user