From f66769fe8d71d9d5d15f845e6ef918f2e417598f Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Wed, 21 Sep 2022 15:43:38 -0700 Subject: rustdoc: dynamically show-hide line numbers on code examples --- .../rustdoc-gui/docblock-code-block-line-number.goml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/test/rustdoc-gui') 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 `
` 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"
-- 
cgit 1.4.1-3-g733a5