aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_console_contentview.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_console_contentview.py')
-rw-r--r--test/test_console_contentview.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_console_contentview.py b/test/test_console_contentview.py
index ef44f834..c2ed2ffa 100644
--- a/test/test_console_contentview.py
+++ b/test/test_console_contentview.py
@@ -250,3 +250,17 @@ if cv.ViewProtobuf.is_available():
def test_get_by_shortcut():
assert cv.get_by_shortcut("h")
+
+def test_search_highlights():
+ # Default text in requests is content. We will search for nt once, and
+ # expect the first bit to be highlighted. We will do it again and expect the
+ # second to be.
+ f = tutils.tflowview()
+
+ ui_elements = f.search("nt")
+ text_object = ui_elements.contents()[2]
+ assert text_object.get_text() == ('content', [(None, 2), ('dark red', 2)])
+
+ ui_elements = f.search("nt")
+ text_object = ui_elements.contents()[2]
+ assert text_object.get_text() == ('content', [(None, 5), ('dark red', 2)])