Reset the ToggleHistory indicator count/label when a share starts. Add a test for this

This commit is contained in:
Miguel Jacq 2019-09-03 17:02:00 +10:00
parent f118ebcb09
commit 09f2f57298
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6
5 changed files with 10 additions and 0 deletions

View File

@ -212,6 +212,8 @@ class ReceiveMode(Mode):
Set the info counters back to zero.
"""
self.history.reset()
self.toggle_history.indicator_count = 0
self.toggle_history.update_indicator()
def update_primary_action(self):
self.common.log('ReceiveMode', 'update_primary_action')

View File

@ -334,6 +334,8 @@ class ShareMode(Mode):
Set the info counters back to zero.
"""
self.history.reset()
self.toggle_history.indicator_count = 0
self.toggle_history.update_indicator()
@staticmethod
def _compute_total_size(filenames):

View File

@ -258,6 +258,8 @@ class WebsiteMode(Mode):
Set the info counters back to zero.
"""
self.history.reset()
self.toggle_history.indicator_count = 0
self.toggle_history.update_indicator()
@staticmethod
def _compute_total_size(filenames):

View File

@ -170,6 +170,9 @@ class GuiBaseTest(object):
QtTest.QTest.mouseClick(mode.server_status.server_button, QtCore.Qt.LeftButton)
self.assertEqual(mode.server_status.status, 1)
def toggle_indicator_is_reset(self, mode):
self.assertEqual(mode.toggle_history.indicator_count, 0)
self.assertFalse(mode.toggle_history.indicator_label.isVisible())
def server_status_indicator_says_starting(self, mode):
'''Test that the Server Status indicator shows we are Starting'''

View File

@ -173,6 +173,7 @@ class GuiShareTest(GuiBaseTest):
self.server_status_indicator_says_closed(self.gui.share_mode, stay_open)
self.add_button_visible(self.gui.share_mode)
self.server_working_on_start_button_pressed(self.gui.share_mode)
self.toggle_indicator_is_reset(self.gui.share_mode)
self.server_is_started(self.gui.share_mode)
self.history_indicator(self.gui.share_mode, public_mode)