Skip to content

Commit 413acd3

Browse files
committed
tests: helper: Test screen updated on setting unread counts.
Ensure controller.update_screen is called while setting unread counts.
1 parent 6a6b896 commit 413acd3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/helper/test_helper.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,15 @@ def test_set_count_muted_topics(mocker, initial_unread_counts, muted_topics,
193193
assert controller.model.unread_counts == expected_unread_counts
194194

195195

196+
@pytest.mark.parametrize('id_list, new_count', [([], 1)])
197+
def test_set_count_screen_updated(mocker, id_list, new_count):
198+
controller = mocker.patch('zulipterminal.core.Controller.__init__')
199+
controller.update_screen = mocker.patch(
200+
'zulipterminal.core.Controller.update_screen')
201+
set_count(id_list, controller, new_count)
202+
controller.update_screen.assert_called_once_with()
203+
204+
196205
def test_index_messages_narrow_all_messages(mocker,
197206
messages_successful_response,
198207
index_all_messages,

0 commit comments

Comments
 (0)