diff --git a/deltachat-rpc-client/tests/test_something.py b/deltachat-rpc-client/tests/test_something.py index 5488291a8..5ff3c29ed 100644 --- a/deltachat-rpc-client/tests/test_something.py +++ b/deltachat-rpc-client/tests/test_something.py @@ -801,3 +801,27 @@ def test_get_all_accounts_deadlock(rpc): all_accounts = rpc.get_all_accounts.future() rpc.add_account() all_accounts() + + +def test_delete_deltachat_folder(acfactory, direct_imap): + """Test that DeltaChat folder is recreated if user deletes it manually.""" + ac1 = acfactory.new_configured_account() + ac1.set_config("mvbox_move", "1") + ac1.bring_online() + + ac1_direct_imap = direct_imap(ac1) + ac1_direct_imap.conn.folder.delete("DeltaChat") + assert "DeltaChat" not in ac1_direct_imap.list_folders() + + # Wait until new folder is created and UIDVALIDITY is updated. + while True: + event = ac1.wait_for_event() + if event.kind == EventType.INFO and "uid/validity change folder DeltaChat" in event.msg: + break + + ac2 = acfactory.get_online_account() + ac2.create_chat(ac1).send_text("hello") + msg = ac1.wait_for_incoming_msg().get_snapshot() + assert msg.text == "hello" + + assert "DeltaChat" in ac1_direct_imap.list_folders() diff --git a/python/tests/test_1_online.py b/python/tests/test_1_online.py index c41dfe1d8..d5f8b75fc 100644 --- a/python/tests/test_1_online.py +++ b/python/tests/test_1_online.py @@ -1979,23 +1979,6 @@ def test_scan_folders(acfactory, lp, folder, move, expected_destination): assert len(ac1.direct_imap.get_all_messages()) == 0 -def test_delete_deltachat_folder(acfactory): - """Test that DeltaChat folder is recreated if user deletes it manually.""" - ac1 = acfactory.new_online_configuring_account(mvbox_move=True) - ac2 = acfactory.new_online_configuring_account() - acfactory.wait_configured(ac1) - - ac1.direct_imap.conn.folder.delete("DeltaChat") - assert "DeltaChat" not in ac1.direct_imap.list_folders() - acfactory.bring_accounts_online() - - ac2.create_chat(ac1).send_text("hello") - msg = ac1._evtracker.wait_next_incoming_message() - assert msg.text == "hello" - - assert "DeltaChat" in ac1.direct_imap.list_folders() - - def test_archived_muted_chat(acfactory, lp): """If an archived and muted chat receives a new message, DC_EVENT_MSGS_CHANGED for DC_CHAT_ID_ARCHIVED_LINK must be generated if the chat had only seen messages previously.