-
-
Notifications
You must be signed in to change notification settings - Fork 286
WIP: tests: helper: Add tests for set_count. #548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
This is an important stepping stone to fixing #535. |
8454e32 to
812a667
Compare
812a667 to
22c42ca
Compare
|
There's will be a little bit of duplication across the tests for setting up and initializing variables. I'm wondering if it would be viable to abstract out the setup, or would it make the tests too complex? |
tests/helper/test_helper.py
Outdated
| (-1, [15], 4, 3, {200: 2, 201: 1}), # self-pm | ||
| (1, [16, 10], 6, 5, {200: 4, 201: 1}), | ||
| (1, [], 4, 3, {200: 2, 201: 1}), | ||
| # (1, [15], 4, 3, {200: 2, 201: 1}), # self-pm # FIXME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test fails when a pm sent by the user is to be marked as unread. I don't know if such a case will ever arise, but set_count should probably handle it anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vaguely remember discovering the same fact a while ago. I think the reason I concluded was that the server does not set the unread for self PM's hence there is no point setting the counts from ZT side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll remove this then
22c42ca to
407a9c2
Compare
|
@neiljp @sumanthvrao, if you have time to give this a review please let me know if these tests look okay. :) |
|
This looks like a great start @kaustubh-nair . If possible we can try reusing some fixtures in The list you have mentioned above seems comprehensive enough! Let's go ahead with that. |
|
The fixtures in |
08d2a32 to
3b3ba04
Compare
ed2400b to
cb5e94e
Compare
|
@sumanthvrao @neiljp This is ready for an initial review. I do realize there is a LOT of duplication going on here. I will push some refactor commits sometime later tomorrow. |
413acd3 to
686f563
Compare
Add test for verifying unread_counts when marking streams as read/unread. Added new index fixture that contains a large number of messages.
Add test for verifying unread counts when marking self-pm and one-on-one pm as read/unread. Add new pm entries to 'index_multiple_messages' fixture.
Add test for verifying unread counts when marking group-pm as read/unread. Add new pm entries to 'index_multiple_messages' fixture.
Add test for verifying unread_counts when marking muted streams read/unread. The 'all_msg' attribute in unread counts does not change while changing the read status of such messages.
Add test for verifying unread_counts when marking muted topics read/unread. The 'all_msg' attribute in unread counts does not change while changing the read status of such messages.
Ensure controller.update_screen is called while setting unread counts.
686f563 to
f736248
Compare
|
Heads up @kaustubh-nair, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
Test messages sent by user(set_countnot called)Test topics whose view is open( UI test, fix in different PR )