Skip to content

Commit 7ddf988

Browse files
committed
Correct markdown format for mentions and enable test
The markdown format for mentions should be `<@personEmail:{email}|{display}>` or `<@personid:{id}|{display}>`.
1 parent ec17329 commit 7ddf988

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/api/test_messages.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ def group_room_markdown_message(group_room, send_group_room_message, me,
106106
# Uses / depends on group_room_text_message to ensure this message is
107107
# created after group_room_text_message, so that we can be sure that a
108108
# message exists 'before' this one - used to test 'before' list filters.
109-
mention_email = me.emails[0]
110-
markdown = create_string("<personEmail:{}>, This is **markdown** with a "
111-
"mention.".format(mention_email))
109+
markdown = create_string("<@personEmail:{email}|{name}>, This is "
110+
"**markdown** with a mention."
111+
"".format(email=me.emails[0],
112+
name=me.displayName))
112113
return send_group_room_message(group_room.id, markdown=markdown)
113114

114115

@@ -204,9 +205,9 @@ def test_list_messages_with_paging(self, api, group_room,
204205
assert len(messages_list) == num_messages
205206
assert are_valid_messages(messages_list)
206207

207-
# TODO: Investigate API list messages with 'me' mentions not working
208-
# def test_list_messages_with_me_mention(self, api, group_room, me):
209-
# messages = list_messages(api, group_room.id, mentionedPeople=["me"])
210-
# messages_list = list(messages)
211-
# assert len(messages_list) >= 1
212-
# assert are_valid_messages(messages_list)
208+
def test_list_messages_mentioning_me(self, api, group_room,
209+
group_room_markdown_message):
210+
messages = list_messages(api, group_room.id, mentionedPeople=["me"])
211+
messages_list = list(messages)
212+
assert len(messages_list) >= 1
213+
assert are_valid_messages(messages_list)

0 commit comments

Comments
 (0)