From c3d840dcfc4e430735e8a0a45f6bd2f57c425463 Mon Sep 17 00:00:00 2001 From: redshiftzero Date: Fri, 13 Mar 2020 19:08:04 -0400 Subject: [PATCH] test: ensure on_source_changed is called when we sync --- tests/gui/test_main.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/gui/test_main.py b/tests/gui/test_main.py index 9364b7e6b4..fd33da021f 100644 --- a/tests/gui/test_main.py +++ b/tests/gui/test_main.py @@ -157,6 +157,20 @@ def test_hide_login(mocker): assert w.login_dialog is None +def test_refresh_current_source_conversation(mocker): + """ + Ensure on_source_changed is called on the MainView (which + updates the current conversation) when + refresh_current_source_conversation() is called. + """ + w = Window() + w.main_view = mocker.MagicMock() + + w.refresh_current_source_conversation() + + w.main_view.on_source_changed.assert_called_once_with() + + def test_show_sources(mocker): """ Ensure the sources list is passed to the main view to be updated.