更新
This commit is contained in:
@@ -95,7 +95,13 @@ def test_navigation_requires_each_pages_actual_list_capability() -> None:
|
||||
def test_video_release_does_not_remove_a_newer_call() -> None:
|
||||
older = object()
|
||||
newer = object()
|
||||
controller = SimpleNamespace(video_calls={"501": newer})
|
||||
# _release_video_call also clears the preview slot, so the double needs the
|
||||
# same attributes the real controller sets up in __init__.
|
||||
controller = SimpleNamespace(
|
||||
video_calls={"501": newer},
|
||||
_video_preview_state=None,
|
||||
_video_preview_generation=0,
|
||||
)
|
||||
|
||||
ApplicationController._release_video_call(controller, "501", older)
|
||||
assert controller.video_calls == {"501": newer}
|
||||
@@ -505,3 +511,37 @@ def test_certificate_error_opens_server_settings(tmp_path: Any) -> None:
|
||||
assert "信任自签名证书" in window.error_banner.label.text()
|
||||
window.close()
|
||||
application.processEvents()
|
||||
|
||||
|
||||
def test_business_dialogs_can_be_maximized_but_prompts_cannot() -> None:
|
||||
"""Dense AI panels and editors were stuck at their constructed size."""
|
||||
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtWidgets import QApplication, QDialog, QMessageBox
|
||||
|
||||
from doctor_workstation.ui.theme import allow_dialog_resize
|
||||
|
||||
application = QApplication.instance() or QApplication([])
|
||||
assert application is not None
|
||||
|
||||
dialog = QDialog()
|
||||
dialog.resize(600, 400)
|
||||
allow_dialog_resize(dialog)
|
||||
flags = dialog.windowFlags()
|
||||
assert flags & Qt.WindowType.WindowMaximizeButtonHint
|
||||
assert flags & Qt.WindowType.WindowMinimizeButtonHint
|
||||
assert dialog.isSizeGripEnabled()
|
||||
dialog.deleteLater()
|
||||
|
||||
# Transient prompts keep their plain frame.
|
||||
prompt = QMessageBox()
|
||||
allow_dialog_resize(prompt)
|
||||
assert not (prompt.windowFlags() & Qt.WindowType.WindowMaximizeButtonHint)
|
||||
prompt.deleteLater()
|
||||
|
||||
# A dialog that pinned itself to a fixed size keeps that decision.
|
||||
fixed = QDialog()
|
||||
fixed.setFixedSize(420, 300)
|
||||
allow_dialog_resize(fixed)
|
||||
assert not (fixed.windowFlags() & Qt.WindowType.WindowMaximizeButtonHint)
|
||||
fixed.deleteLater()
|
||||
|
||||
Reference in New Issue
Block a user