新增
This commit is contained in:
@@ -69,13 +69,13 @@ def test_editor_is_a_fixed_header_body_footer_right_drawer(
|
||||
|
||||
origin = host.mapToGlobal(QPoint(0, 0))
|
||||
assert editor.windowFlags() & Qt.WindowType.FramelessWindowHint
|
||||
assert editor.width() == 1200
|
||||
assert editor.width() == 860
|
||||
assert editor.height() == host.height()
|
||||
assert editor.x() + editor.width() == origin.x() + host.width()
|
||||
assert editor.y() == origin.y()
|
||||
assert editor.save_button.text() == "确定"
|
||||
assert editor.windowTitle() == "新增处方"
|
||||
assert not editor.findChildren(QTabWidget)
|
||||
assert editor.tabs.count() == 4
|
||||
assert editor.tabs.tabText(2) == "剂型与用法"
|
||||
assert editor.body_scroll.verticalScrollBar().maximum() > 0
|
||||
assert editor.body_scroll.horizontalScrollBar().maximum() == 0
|
||||
|
||||
@@ -110,7 +110,35 @@ def test_drawer_uses_full_width_on_a_narrow_host(application: QApplication) -> N
|
||||
assert editor.width() == host.width()
|
||||
assert editor.x() == origin.x()
|
||||
assert editor.body_scroll.horizontalScrollBar().maximum() == 0
|
||||
assert editor.herbs._grid_columns == 3
|
||||
assert editor.herbs.table_mode
|
||||
assert editor.add_main_button.text() == "添加主方药材"
|
||||
|
||||
editor.close()
|
||||
host.close()
|
||||
application.processEvents()
|
||||
|
||||
|
||||
def test_decoction_usage_fields_pack_without_a_hidden_column_gap(
|
||||
application: QApplication,
|
||||
) -> None:
|
||||
host = QWidget()
|
||||
host.resize(1440, 900)
|
||||
host.show()
|
||||
source = _seed()
|
||||
source["prescription_type"] = "饮片"
|
||||
editor = PrescriptionEditorDialog(_repository(), source, parent=host)
|
||||
_show(editor, application)
|
||||
|
||||
assert editor._main_decoction_field.isVisible()
|
||||
assert editor._main_bags_field.isVisible()
|
||||
assert editor._main_bag_field.isHidden()
|
||||
assert editor._main_dosage_field.y() == editor._main_decoction_field.y()
|
||||
gap = editor._main_decoction_field.x() - (
|
||||
editor._main_dosage_field.x() + editor._main_dosage_field.width()
|
||||
)
|
||||
assert 0 <= gap <= 24
|
||||
assert abs(editor._main_dosage_field.width() - editor._main_decoction_field.width()) < 40
|
||||
assert editor.cancel_button.x() < editor.save_button.x()
|
||||
|
||||
editor.close()
|
||||
host.close()
|
||||
|
||||
Reference in New Issue
Block a user