From 2775f2b2eefffb4a7d20c26f920caa1c86d30a57 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 12 May 2015 19:15:16 +0200 Subject: [PATCH] Add some more tests. --- tests/javascript/position_caret/invisible.html | 5 +++++ tests/javascript/position_caret/scrolled_down_img.html | 9 +++++++++ tests/javascript/position_caret/test_position_caret.py | 9 +++++++++ 3 files changed, 23 insertions(+) create mode 100644 tests/javascript/position_caret/invisible.html create mode 100644 tests/javascript/position_caret/scrolled_down_img.html diff --git a/tests/javascript/position_caret/invisible.html b/tests/javascript/position_caret/invisible.html new file mode 100644 index 000000000..764b3ddb5 --- /dev/null +++ b/tests/javascript/position_caret/invisible.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} +{% block content %} +

This line is hidden.

+

MARKER this should be the paragraph the caret is on.

+{% endblock %} diff --git a/tests/javascript/position_caret/scrolled_down_img.html b/tests/javascript/position_caret/scrolled_down_img.html new file mode 100644 index 000000000..af302fcc0 --- /dev/null +++ b/tests/javascript/position_caret/scrolled_down_img.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} +{% block content %} +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero.

+ + + +

MARKER this should be the paragraph the caret is on.

+

Some more text

+{% endblock %} diff --git a/tests/javascript/position_caret/test_position_caret.py b/tests/javascript/position_caret/test_position_caret.py index 98976ea3d..0fbf4e3f1 100644 --- a/tests/javascript/position_caret/test_position_caret.py +++ b/tests/javascript/position_caret/test_position_caret.py @@ -83,3 +83,12 @@ def test_invisible(caret_tester, style): """Test with hidden text elements.""" caret_tester.js.load('position_caret/invisible.html', style=style) caret_tester.check() + + +def test_scrolled_down_img(caret_tester): + """Test with an image at the top with the viewport scrolled down.""" + caret_tester.js.load('position_caret/scrolled_down_img.html') + caret_tester.js.scroll_anchor('anchor') + caret_tester.check_scrolled() + caret_tester.check() +