Skip to content

Commit 1c7b851

Browse files
Extend GUI test for expand feature
1 parent 75ba20e commit 1c7b851

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/test/rustdoc-gui/code_block_lines.goml

+16
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,21 @@ assert-text: (".top-doc .line-number", "1\n2\n3\n4")
1010
assert: ".top-doc .rust-example-rendered span.hidden"
1111
assert-text: (".top-doc .rust-example-rendered span.hidden", "fn main() {\n")
1212
assert-text: (".methods .line-number", "1\n2\n3\n4\n5\n6\n7")
13+
14+
// Now we check the collapse/expand feature.
15+
assert: ".top-doc .expand"
16+
assert-false: ".top-doc .collapse"
17+
click: ".top-doc .expand"
18+
assert-text: (".top-doc .line-number", "1\n2\n3\n4\n5\n6\n7")
19+
assert: ".top-doc .collapse"
20+
assert-false: ".top-doc .expand"
21+
click: ".top-doc .collapse"
22+
assert-text: (".top-doc .line-number", "1\n2\n3\n4")
23+
assert: ".top-doc .expand"
24+
assert-false: ".top-doc .collapse"
25+
// We now check that the button isn't present if there is no hidden lines.
26+
assert-false: ".methods .expand"
27+
assert-false: ".methods .collapse"
28+
1329
// We unset the parameter to be sure it won't affect other tests.
1430
local-storage: {"rustdoc-line-numbers": ""}

0 commit comments

Comments
 (0)