Skip to content

Commit b863345

Browse files
committed
test(rpc-client): vCard color is the same as the contact color (#7294)
This tests "fix(jsonrpc): Use Core's logic for computing VcardContact.color".
1 parent 61b49a9 commit b863345

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

deltachat-rpc-client/tests/test_vcard.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
def test_vcard(acfactory) -> None:
2-
alice, bob = acfactory.get_online_accounts(2)
2+
alice, bob, fiona = acfactory.get_online_accounts(3)
33

44
alice_contact_bob = alice.create_contact(bob, "Bob")
55
alice_contact_charlie = alice.create_contact("charlie@example.org", "Charlie")
6+
alice_contact_charlie_snapshot = alice_contact_charlie.get_snapshot()
7+
alice_contact_fiona = alice.create_contact(fiona, "Fiona")
8+
alice_contact_fiona_snapshot = alice_contact_fiona.get_snapshot()
69

710
alice_chat_bob = alice_contact_bob.create_chat()
811
alice_chat_bob.send_contact(alice_contact_charlie)
@@ -12,3 +15,12 @@ def test_vcard(acfactory) -> None:
1215
snapshot = message.get_snapshot()
1316
assert snapshot.vcard_contact
1417
assert snapshot.vcard_contact.addr == "charlie@example.org"
18+
assert snapshot.vcard_contact.color == alice_contact_charlie_snapshot.color
19+
20+
alice_chat_bob.send_contact(alice_contact_fiona)
21+
event = bob.wait_for_incoming_msg_event()
22+
message = bob.get_message_by_id(event.msg_id)
23+
snapshot = message.get_snapshot()
24+
assert snapshot.vcard_contact
25+
assert snapshot.vcard_contact.key
26+
assert snapshot.vcard_contact.color == alice_contact_fiona_snapshot.color

0 commit comments

Comments
 (0)