about summary refs log tree commit diff
path: root/src/test/rustdoc-gui
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-09-21 15:43:38 -0700
committerMichael Howell <michael@notriddle.com>2022-09-21 16:12:15 -0700
commitf66769fe8d71d9d5d15f845e6ef918f2e417598f (patch)
treeaf67830725d1d5348c27a406043e16ac6846e4e9 /src/test/rustdoc-gui
parent7a718f3be217a17e00de317fba6d1d60facfd613 (diff)
downloadrust-f66769fe8d71d9d5d15f845e6ef918f2e417598f.tar.gz
rust-f66769fe8d71d9d5d15f845e6ef918f2e417598f.zip
rustdoc: dynamically show-hide line numbers on code examples
Diffstat (limited to 'src/test/rustdoc-gui')
-rw-r--r--src/test/rustdoc-gui/docblock-code-block-line-number.goml17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/docblock-code-block-line-number.goml b/src/test/rustdoc-gui/docblock-code-block-line-number.goml
index baf9651c40d..ebfffbce715 100644
--- a/src/test/rustdoc-gui/docblock-code-block-line-number.goml
+++ b/src/test/rustdoc-gui/docblock-code-block-line-number.goml
@@ -20,3 +20,20 @@ assert-css: ("pre.line-number", {
 })
 // The first code block has two lines so let's check its `<pre>` elements lists both of them.
 assert-text: ("pre.line-number", "1\n2")
+
+// Now, try changing the setting dynamically. We'll turn it off, using the settings menu,
+// and make sure it goes away.
+
+// First, open the settings menu.
+click: "#settings-menu"
+wait-for: "#settings"
+assert-css: ("#settings", {"display": "block"})
+
+// Then, click the toggle button.
+click: "input#line-numbers + .slider"
+wait-for: 100 // wait-for-false does not exist
+assert-false: "pre.line-number"
+
+// Finally, turn it on again.
+click: "input#line-numbers + .slider"
+wait-for: "pre.line-number"