Skip to content

Commit 4e3fb68

Browse files
Add test for source code clickable line number
1 parent 09150f8 commit 4e3fb68

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
goto: file://|DOC_PATH|/../src/test_docs/lib.rs.html
2+
// Check that we can click on the line number.
3+
click: (40, 224) // This is the position of the span for line 4.
4+
// Unfortunately, "#4" isn't a valid query selector, so we have to go around that limitation
5+
// by instead getting the nth span.
6+
assert: (".line-numbers > span:nth-child(4)", "class", "line-highlighted")
7+
// We now check that the good spans are highlighted
8+
goto: file://|DOC_PATH|/../src/test_docs/lib.rs.html#4-6
9+
assert-false: (".line-numbers > span:nth-child(3)", "class", "line-highlighted")
10+
assert: (".line-numbers > span:nth-child(4)", "class", "line-highlighted")
11+
assert: (".line-numbers > span:nth-child(5)", "class", "line-highlighted")
12+
assert: (".line-numbers > span:nth-child(6)", "class", "line-highlighted")
13+
assert-false: (".line-numbers > span:nth-child(7)", "class", "line-highlighted")

0 commit comments

Comments
 (0)