diff options
author | Florian Bruhin <me@the-compiler.org> | 2018-09-08 16:01:38 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2018-09-08 16:01:38 +0200 |
commit | 20da259de6995ab9143969e0caa38cb5f8e77d67 (patch) | |
tree | 2047b115d3fac2252339c6a3bc3eea38cd7459ec /tests/unit/browser/test_caret.py | |
parent | 45eece372f27ae5262db54b564d2eaab745fe529 (diff) | |
download | qutebrowser-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.py | 22 |
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' |