diff options
Diffstat (limited to 'desktop/tests')
-rw-r--r-- | desktop/tests/gui_base_test.py | 9 | ||||
-rw-r--r-- | desktop/tests/test_gui_chat.py | 1 | ||||
-rw-r--r-- | desktop/tests/test_gui_receive.py | 1 | ||||
-rw-r--r-- | desktop/tests/test_gui_share.py | 1 |
4 files changed, 11 insertions, 1 deletions
diff --git a/desktop/tests/gui_base_test.py b/desktop/tests/gui_base_test.py index ea95eef7..2bf762e1 100644 --- a/desktop/tests/gui_base_test.py +++ b/desktop/tests/gui_base_test.py @@ -177,8 +177,15 @@ class GuiBaseTest(unittest.TestCase): tab.get_mode().toggle_history.click() self.assertEqual(tab.get_mode().history.isVisible(), not currently_visible) + def javascript_is_correct_mime_type(self, tab, file): + """Test that the javascript file send.js is fetchable and that its MIME type is correct""" + path = f"{tab.get_mode().web.static_url_path}/js/{file}" + url = f"http://127.0.0.1:{tab.app.port}/{path}" + r = requests.get(url) + self.assertTrue(r.headers["Content-Type"].startswith("text/javascript;")) + def history_indicator(self, tab, indicator_count="1"): - """Test that we can make sure the history is toggled off, do an action, and the indiciator works""" + """Test that we can make sure the history is toggled off, do an action, and the indicator works""" # Make sure history is toggled off if tab.get_mode().history.isVisible(): tab.get_mode().toggle_history.click() diff --git a/desktop/tests/test_gui_chat.py b/desktop/tests/test_gui_chat.py index 786782f7..ee6c0787 100644 --- a/desktop/tests/test_gui_chat.py +++ b/desktop/tests/test_gui_chat.py @@ -61,6 +61,7 @@ class TestChat(GuiBaseTest): tab = self.new_chat_tab() self.run_all_chat_mode_started_tests(tab) self.view_chat(tab) + self.javascript_is_correct_mime_type(tab, "chat.js") self.change_username(tab) self.run_all_chat_mode_stopping_tests(tab) self.close_all_tabs() diff --git a/desktop/tests/test_gui_receive.py b/desktop/tests/test_gui_receive.py index 423b63a0..3921c6a2 100644 --- a/desktop/tests/test_gui_receive.py +++ b/desktop/tests/test_gui_receive.py @@ -124,6 +124,7 @@ class TestReceive(GuiBaseTest): def run_all_receive_mode_tests(self, tab): """Submit files and messages in receive mode and stop the share""" self.run_all_receive_mode_setup_tests(tab) + self.javascript_is_correct_mime_type(tab, "receive.js") self.upload_file(tab, self.tmpfile_test, "test.txt") self.history_widgets_present(tab) self.counter_incremented(tab, 1) diff --git a/desktop/tests/test_gui_share.py b/desktop/tests/test_gui_share.py index 2cc48d17..ba175fa9 100644 --- a/desktop/tests/test_gui_share.py +++ b/desktop/tests/test_gui_share.py @@ -197,6 +197,7 @@ class TestShare(GuiBaseTest): self.tmpfile_test ) self.web_page(tab, "Total size") + self.javascript_is_correct_mime_type(tab, "send.js") self.download_share(tab) self.history_widgets_present(tab) self.server_is_stopped(tab) |