diff --git a/tests/unit/browser/test_caret.py b/tests/unit/browser/test_caret.py index 273fd6881..70677361c 100644 --- a/tests/unit/browser/test_caret.py +++ b/tests/unit/browser/test_caret.py @@ -331,16 +331,24 @@ class TestSearch: class TestFollowSelected: - def test_follow_selected_without_a_selection(self, qtbot, caret, selection): - with qtbot.wait_signal(caret.follow_selected_done): - caret.follow_selected() + LOAD_STARTED_DELAY = 50 - def test_follow_selected_with_text(self, qtbot, caret, selection): + def test_follow_selected_without_a_selection(self, qtbot, caret, selection, web_tab, + mode_manager): + mode_manager.leave(usertypes.KeyMode.caret) + with qtbot.wait_signal(caret.follow_selected_done): + with qtbot.assert_not_emitted(web_tab.load_started): + caret.follow_selected() + qtbot.wait(self.LOAD_STARTED_DELAY) + + def test_follow_selected_with_text(self, qtbot, caret, selection, web_tab): caret.move_to_next_word() selection.toggle() caret.move_to_end_of_word() with qtbot.wait_signal(caret.follow_selected_done): - caret.follow_selected() + with qtbot.assert_not_emitted(web_tab.load_started): + caret.follow_selected() + qtbot.wait(self.LOAD_STARTED_DELAY) @pytest.mark.parametrize('with_js', [True, False]) def test_follow_selected_with_link(self, caret, selection, config_stub,