Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 53a6974

Browse files
committed
Change tests to expect badge count when no read receipt
1 parent 854b5c4 commit 53a6974

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/push/test_http.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def test_push_unread_count_group_by_room(self) -> None:
577577
# Carry out our option-value specific test
578578
#
579579
# This push should still only contain an unread count of 1 (for 1 unread room)
580-
self._check_push_attempt(6, 1)
580+
self._check_push_attempt(7, 1)
581581

582582
@override_config({"push": {"group_unread_count_by_room": False}})
583583
def test_push_unread_count_message_count(self) -> None:
@@ -591,7 +591,7 @@ def test_push_unread_count_message_count(self) -> None:
591591
#
592592
# We're counting every unread message, so there should now be 3 since the
593593
# last read receipt
594-
self._check_push_attempt(6, 3)
594+
self._check_push_attempt(7, 3)
595595

596596
def _test_push_unread_count(self) -> None:
597597
"""
@@ -641,18 +641,18 @@ def _test_push_unread_count(self) -> None:
641641
response = self.helper.send(
642642
room_id, body="Hello there!", tok=other_access_token
643643
)
644-
# To get an unread count, the user who is getting notified has to have a read
645-
# position in the room. We'll set the read position to this event in a moment
644+
646645
first_message_event_id = response["event_id"]
647646

648647
expected_push_attempts = 1
649-
self._check_push_attempt(expected_push_attempts, 0)
648+
self._check_push_attempt(expected_push_attempts, 1)
650649

651650
self._send_read_request(access_token, first_message_event_id, room_id)
652651

653-
# Unread count has not changed. Therefore, ensure that read request does not
654-
# trigger a push notification.
655-
self.assertEqual(len(self.push_attempts), 1)
652+
# Unread count has changed. Therefore, ensure that read request triggers
653+
# a push notification.
654+
expected_push_attempts += 1
655+
self.assertEqual(len(self.push_attempts), expected_push_attempts)
656656

657657
# Send another message
658658
response2 = self.helper.send(

0 commit comments

Comments
 (0)