summaryrefslogtreecommitdiff
path: root/tests/unit/browser/test_caret.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2018-09-08 16:01:38 +0200
committerFlorian Bruhin <me@the-compiler.org>2018-09-08 16:01:38 +0200
commit20da259de6995ab9143969e0caa38cb5f8e77d67 (patch)
tree2047b115d3fac2252339c6a3bc3eea38cd7459ec /tests/unit/browser/test_caret.py
parent45eece372f27ae5262db54b564d2eaab745fe529 (diff)
downloadqutebrowser-20da259de6995ab9143969e0caa38cb5f8e77d67.tar.gz
qutebrowser-20da259de6995ab9143969e0caa38cb5f8e77d67.zip
Rewrite some :follow-selected tests as unit tests
Diffstat (limited to 'tests/unit/browser/test_caret.py')
-rw-r--r--tests/unit/browser/test_caret.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/browser/test_caret.py b/tests/unit/browser/test_caret.py
index c7e100a59..0fd434a77 100644
--- a/tests/unit/browser/test_caret.py
+++ b/tests/unit/browser/test_caret.py
@@ -315,3 +315,25 @@ class TestSearch:
caret.move_to_end_of_line()
selection.check('wei drei')
+
+
+class TestFollowSelected:
+
+ def test_follow_selected_without_a_selection(self, caret, selection):
+ caret.follow_selected()
+
+ def test_follow_selected_with_text(self, caret, selection):
+ caret.move_to_next_word()
+ selection.toggle()
+ caret.move_to_end_of_word()
+ caret.follow_selected()
+
+ @pytest.mark.parametrize('with_js', [True, False])
+ def test_follow_selected_with_link(self, caret, selection, config_stub,
+ qtbot, web_tab, with_js):
+ config_stub.val.content.javascript.enabled = with_js
+ selection.toggle()
+ caret.move_to_end_of_word()
+ with qtbot.wait_signal(web_tab.load_finished):
+ caret.follow_selected()
+ assert web_tab.url().path() == '/data/hello.txt'