新增
This commit is contained in:
@@ -18,7 +18,11 @@ from doctor_workstation.ui.diagnosis_media import (
|
||||
safe_http_url,
|
||||
)
|
||||
from doctor_workstation.ui.dialogs import diagnosis as diagnosis_module
|
||||
from doctor_workstation.ui.dialogs.diagnosis import DiagnosisDialog, OrderDetailDrawer
|
||||
from doctor_workstation.ui.dialogs.diagnosis import (
|
||||
DiagnosisDialog,
|
||||
OrderDetailDrawer,
|
||||
present_order_detail,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
@@ -214,6 +218,31 @@ def test_order_detail_is_eighty_percent_readonly_drawer_with_real_sections(
|
||||
application.processEvents()
|
||||
|
||||
|
||||
def test_present_order_detail_shared_entry_matches_admin_drawer_sections(
|
||||
application: QApplication,
|
||||
) -> None:
|
||||
host = QFrame()
|
||||
host.resize(1100, 720)
|
||||
host.show()
|
||||
application.processEvents()
|
||||
drawer = present_order_detail(
|
||||
host,
|
||||
_rich_order(),
|
||||
order_id=801,
|
||||
permissions=["tcm.prescriptionOrder/logs", "tcm.prescriptionOrder/detail"],
|
||||
exec_=False,
|
||||
)
|
||||
application.processEvents()
|
||||
assert isinstance(drawer, OrderDetailDrawer)
|
||||
labels = [label.text() for label in drawer.findChildren(QLabel)]
|
||||
for section in ("金额概览", "处方详情", "收款记录", "履约与收货信息", "物流轨迹", "操作日志"):
|
||||
assert section in labels
|
||||
assert "RX-20260811-0801" in " ".join(labels)
|
||||
drawer.close()
|
||||
host.close()
|
||||
application.processEvents()
|
||||
|
||||
|
||||
def test_order_detail_missing_fields_use_explicit_empty_states_without_fake_zero(
|
||||
application: QApplication,
|
||||
) -> None:
|
||||
@@ -287,6 +316,9 @@ def test_recording_preference_inline_height_alternates_and_safe_external_open(
|
||||
assert player.maximumHeight() == 180
|
||||
assert player.property("maximumPlaybackHeight") == 180
|
||||
assert player._source_attached is False
|
||||
assert player.player is None
|
||||
assert player.audio_output is None
|
||||
assert player.video is None
|
||||
alternate_buttons = cell.findChildren(QPushButton, "DiagnosisRecordingAlternateLink")
|
||||
assert [button.text() for button in alternate_buttons] == [
|
||||
"COS HLS 1",
|
||||
@@ -309,6 +341,29 @@ def test_recording_preference_inline_height_alternates_and_safe_external_open(
|
||||
application.processEvents()
|
||||
|
||||
|
||||
def test_recording_rows_do_not_eagerly_create_native_players(
|
||||
application: QApplication,
|
||||
) -> None:
|
||||
cells = [
|
||||
RecordingPlaybackCell(
|
||||
[f"https://media.example.invalid/replay-{index}.mp4"],
|
||||
record_id=index,
|
||||
)
|
||||
for index in range(40)
|
||||
]
|
||||
application.processEvents()
|
||||
|
||||
inline_players = [cell.inline_player for cell in cells]
|
||||
assert all(player is not None for player in inline_players)
|
||||
assert all(player.player is None for player in inline_players if player is not None)
|
||||
assert all(player.audio_output is None for player in inline_players if player is not None)
|
||||
assert all(player.video is None for player in inline_players if player is not None)
|
||||
|
||||
for cell in cells:
|
||||
cell.close()
|
||||
application.processEvents()
|
||||
|
||||
|
||||
def test_video_table_embeds_player_and_preserves_row_bound_upload(
|
||||
application: QApplication,
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user