mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
- **feat: add `AccountsChanged` and `AccountsItemChanged` events** - **emit event and add tests** closes #6106 TODO: - [x] test receiving synced config from second device - [x] bug: investigate how to delay the configuration event until it is actually configured - because desktop gets the event but still shows account as if it was unconfigured, maybe event is emitted before the value is written to the database? - [x] update node bindings constants
30 lines
747 B
Python
30 lines
747 B
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
from deltachat_rpc_client import EventType
|
|
|
|
if TYPE_CHECKING:
|
|
from deltachat_rpc_client.pytestplugin import ACFactory
|
|
|
|
|
|
def test_event_on_configuration(acfactory: ACFactory) -> None:
|
|
"""
|
|
Test if ACCOUNTS_ITEM_CHANGED event is emitted on configure
|
|
"""
|
|
|
|
account = acfactory.new_preconfigured_account()
|
|
account.clear_all_events()
|
|
assert not account.is_configured()
|
|
future = account.configure.future()
|
|
while True:
|
|
event = account.wait_for_event()
|
|
if event.kind == EventType.ACCOUNTS_ITEM_CHANGED:
|
|
break
|
|
assert account.is_configured()
|
|
|
|
future()
|
|
|
|
|
|
# other tests are written in rust: src/tests/account_events.rs
|