mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-02 14:36:15 -04:00
Add tests for Chat, and fix the server_status message bar when in Chat mode
This commit is contained in:
parent
e067fc2963
commit
b39162f33c
6 changed files with 124 additions and 11 deletions
|
@ -153,11 +153,21 @@ class TestTabs(GuiBaseTest):
|
|||
self.gui.status_bar.server_status_label.text(), "Ready to share"
|
||||
)
|
||||
|
||||
# New tab, chat mode
|
||||
self.gui.tabs.new_tab_button.click()
|
||||
self.gui.tabs.widget(4).chat_button.click()
|
||||
self.assertFalse(self.gui.tabs.widget(4).new_tab.isVisible())
|
||||
self.assertTrue(self.gui.tabs.widget(4).chat_mode.isVisible())
|
||||
self.assertEqual(
|
||||
self.gui.status_bar.server_status_label.text(), "Ready to chat"
|
||||
)
|
||||
|
||||
# Close tabs
|
||||
self.gui.tabs.tabBar().tabButton(0, QtWidgets.QTabBar.RightSide).click()
|
||||
self.gui.tabs.tabBar().tabButton(0, QtWidgets.QTabBar.RightSide).click()
|
||||
self.gui.tabs.tabBar().tabButton(0, QtWidgets.QTabBar.RightSide).click()
|
||||
self.gui.tabs.tabBar().tabButton(0, QtWidgets.QTabBar.RightSide).click()
|
||||
self.gui.tabs.tabBar().tabButton(0, QtWidgets.QTabBar.RightSide).click()
|
||||
|
||||
def test_07_close_share_tab_while_server_started_should_warn(self):
|
||||
"""Closing a share mode tab when the server is running should throw a warning"""
|
||||
|
@ -165,7 +175,7 @@ class TestTabs(GuiBaseTest):
|
|||
self.close_tab_with_active_server(tab)
|
||||
|
||||
def test_08_close_receive_tab_while_server_started_should_warn(self):
|
||||
"""Closing a recieve mode tab when the server is running should throw a warning"""
|
||||
"""Closing a receive mode tab when the server is running should throw a warning"""
|
||||
tab = self.new_receive_tab()
|
||||
self.close_tab_with_active_server(tab)
|
||||
|
||||
|
@ -174,22 +184,32 @@ class TestTabs(GuiBaseTest):
|
|||
tab = self.new_website_tab_with_files()
|
||||
self.close_tab_with_active_server(tab)
|
||||
|
||||
def test_10_close_persistent_share_tab_shows_warning(self):
|
||||
def test_10_close_chat_tab_while_server_started_should_warn(self):
|
||||
"""Closing a chat mode tab when the server is running should throw a warning"""
|
||||
tab = self.new_chat_tab()
|
||||
self.close_tab_with_active_server(tab)
|
||||
|
||||
def test_11_close_persistent_share_tab_shows_warning(self):
|
||||
"""Closing a share mode tab that's persistent should show a warning"""
|
||||
tab = self.new_share_tab_with_files()
|
||||
self.close_persistent_tab(tab)
|
||||
|
||||
def test_11_close_persistent_receive_tab_shows_warning(self):
|
||||
def test_12_close_persistent_receive_tab_shows_warning(self):
|
||||
"""Closing a receive mode tab that's persistent should show a warning"""
|
||||
tab = self.new_receive_tab()
|
||||
self.close_persistent_tab(tab)
|
||||
|
||||
def test_12_close_persistent_website_tab_shows_warning(self):
|
||||
def test_13_close_persistent_website_tab_shows_warning(self):
|
||||
"""Closing a website mode tab that's persistent should show a warning"""
|
||||
tab = self.new_website_tab_with_files()
|
||||
self.close_persistent_tab(tab)
|
||||
|
||||
def test_13_quit_with_server_started_should_warn(self):
|
||||
def test_14_close_persistent_chat_tab_shows_warning(self):
|
||||
"""Closing a chat mode tab that's persistent should show a warning"""
|
||||
tab = self.new_chat_tab()
|
||||
self.close_persistent_tab(tab)
|
||||
|
||||
def test_15_quit_with_server_started_should_warn(self):
|
||||
"""Quitting OnionShare with any active servers should show a warning"""
|
||||
tab = self.new_share_tab()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue