更新
This commit is contained in:
@@ -346,6 +346,54 @@ def test_shell_hides_global_ai_entries_without_ai_permission(
|
||||
application.processEvents()
|
||||
|
||||
|
||||
def test_shell_ai_entry_reports_when_reception_is_not_available(
|
||||
application: QApplication,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
navigation = [
|
||||
NavigationItem(
|
||||
"appointments",
|
||||
"问诊列表",
|
||||
"号",
|
||||
_ShellPageDouble,
|
||||
("doctor.appointment/lists",),
|
||||
)
|
||||
]
|
||||
monkeypatch.setattr(
|
||||
shell_module,
|
||||
"_resolve_navigation",
|
||||
lambda _menu, _permissions, *, demo_mode: [
|
||||
(item, item.title) for item in navigation
|
||||
],
|
||||
)
|
||||
messages: list[str] = []
|
||||
monkeypatch.setattr(
|
||||
shell_module,
|
||||
"show_toast",
|
||||
lambda _parent, message, *_args, **_kwargs: messages.append(message),
|
||||
)
|
||||
window = ShellWindow(
|
||||
object(),
|
||||
{"user": {"name": "无接诊台医生"}, "demo_mode": True},
|
||||
permissions={
|
||||
"doctor.appointment/lists",
|
||||
"tcm.diagnosis/aiAssistant",
|
||||
},
|
||||
)
|
||||
window.show()
|
||||
application.processEvents()
|
||||
|
||||
window.assistant_button.click()
|
||||
application.processEvents()
|
||||
|
||||
assert any("没有可用的接诊台" in message for message in messages)
|
||||
assert all("已进入接诊台" not in message for message in messages)
|
||||
assert window.stack.currentWidget() is window.pages["appointments"]
|
||||
|
||||
window.close()
|
||||
application.processEvents()
|
||||
|
||||
|
||||
def test_shell_settings_opens_global_local_audio_upload_manager(
|
||||
application: QApplication,
|
||||
shell_window: ShellWindow,
|
||||
|
||||
Reference in New Issue
Block a user