diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-03 11:38:33 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 12:57:00 +0100 |
commit | 7639dcb4995b13c2756f9d59e0a67e22cba57a38 (patch) | |
tree | f38f36bfab6ab13fb89497fff1fb5e8d29e787ac /tests/conftest.py | |
parent | 15cabf8ba1b9daa7e28475ea46cc5a8fd478e174 (diff) | |
download | wee-slack-7639dcb4995b13c2756f9d59e0a67e22cba57a38.tar.gz |
Correctly show reactions with more than 50 users in v3.0.0
If a reaction has more than 50 users, the list of users will be cropped
to just 50 users. This made the counts wrong since we used the number of
users rather than the count property. Fix it by using the count property
instead and adding "and others" to the list of users if
show_reaction_nicks is enabled (the same as the Slack client shows when
you hover over the reaction).
This is the same fix as in commit 6b388cd9, but for version 3.0.0.
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 981faab..cda1833 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -148,13 +148,20 @@ color_reset = "<[color:reset]>" workspace_id = "T0FC8BFQR" -with open("mock_data/slack_users_info_person.json") as f: +with open("mock_data/slack_users_info_person_1.json") as f: user_test1_info_response: SlackUserInfoSuccessResponse[SlackUserInfo] = json.loads( f.read() ) user_test1_info = user_test1_info_response["user"] user_test1_id = user_test1_info["id"] +with open("mock_data/slack_users_info_person_2.json") as f: + user_test2_info_response: SlackUserInfoSuccessResponse[SlackUserInfo] = json.loads( + f.read() + ) + user_test2_info = user_test2_info_response["user"] + user_test2_id = user_test2_info["id"] + with open("mock_data/slack_conversations_info_channel_public.json") as f: channel_public_info_response: SlackConversationsInfoSuccessResponse[ SlackConversationsInfo @@ -172,9 +179,15 @@ def workspace(): user_test1 = SlackUser(w, user_test1_info) user_test1_future = Future[SlackUser]() user_test1_future.set_result(user_test1) - w.my_user = user_test1 w.users[user_test1_id] = user_test1_future + user_test2 = SlackUser(w, user_test2_info) + user_test2_future = Future[SlackUser]() + user_test2_future.set_result(user_test2) + w.users[user_test2_id] = user_test2_future + + w.my_user = user_test1 + channel_public_future = Future[SlackConversation]() w.conversations[channel_public_id] = channel_public_future channel_public = SlackConversation(w, channel_public_info) |