Add desktop ready checks, smarter chat scrolling, and fight-night reactions

This commit is contained in:
Peter Stockings
2026-10-05 15:46:55 +11:00
parent 19576de166
commit f3eeda71e6
13 changed files with 1228 additions and 10 deletions
+20
View File
@@ -22,3 +22,23 @@ def test_certificate_error_finds_nested_verification_error():
def test_non_certificate_error_is_ignored():
assert SyncClientThread._certificate_error(ConnectionError("offline")) is None
def test_ready_check_event_dispatch(qtbot):
client = SyncClientThread()
message = {'type': 'ready_check', 'active': True, 'id': 'check'}
with qtbot.waitSignal(client.ready_check_updated) as signal:
client._handle_message(message)
assert signal.args == [message]
def test_fight_event_dispatch_and_nonfatal_feedback(qtbot):
client = SyncClientThread()
for event_type, signal in (('reaction', client.fight_reaction), ('fight_poll', client.fight_poll_updated)):
message = {'type': event_type, 'kind': 'ko'}
with qtbot.waitSignal(signal) as event:
client._handle_message(message)
assert event.args == [message]
with qtbot.waitSignal(client.system_message) as event:
client._handle_message({'type': 'reaction_error', 'message': 'Cooldown'})
assert event.args == ['Cooldown']