use freeze_qt_time ?
Some checks failed
Lint / test (push) Waiting to run
Trivy / test (push) Waiting to run
CI / test (push) Has been cancelled

This commit is contained in:
Miguel Jacq 2025-12-06 11:12:06 +11:00
parent aeb3d863e2
commit 9b2260f6a7
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9

View file

@ -2229,7 +2229,7 @@ def test_close_current_tab(qtbot, app, tmp_db_cfg, fresh_db):
assert window.tab_widget.count() == initial_count - 1
def test_parse_today_alarms(qtbot, app, tmp_db_cfg, fresh_db):
def test_parse_today_alarms(qtbot, app, tmp_db_cfg, fresh_db, freeze_qt_time):
"""Test parsing inline alarms from markdown (⏰ HH:MM format)."""
from PySide6.QtCore import QTime
@ -2255,7 +2255,7 @@ def test_parse_today_alarms(qtbot, app, tmp_db_cfg, fresh_db):
window._open_date_in_tab(today_qdate)
# Set content with a future alarm
future_time = QTime.currentTime().addSecs(5)
future_time = QTime.currentTime().addSecs(3600)
alarm_text = f"Do something ⏰ {future_time.hour():02d}:{future_time.minute():02d}"
# Set the editor's current_date attribute
@ -2353,7 +2353,7 @@ def test_parse_today_alarms_past_time(qtbot, app, tmp_db_cfg, fresh_db):
assert len(window._reminder_timers) == 0
def test_parse_today_alarms_no_text(qtbot, app, tmp_db_cfg, fresh_db):
def test_parse_today_alarms_no_text(qtbot, app, tmp_db_cfg, fresh_db, freeze_qt_time):
"""Test alarm with no text before emoji uses fallback."""
from PySide6.QtCore import QTime
@ -2379,7 +2379,7 @@ def test_parse_today_alarms_no_text(qtbot, app, tmp_db_cfg, fresh_db):
window._open_date_in_tab(today_qdate)
# Set content with alarm but no text
future_time = QTime.currentTime().addSecs(5)
future_time = QTime.currentTime().addSecs(3600)
alarm_text = f"{future_time.hour():02d}:{future_time.minute():02d}"
window.editor.current_date = today_qdate