diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:13:23 +0000 |
commit | 20431706a863f92cb37dc512fef6e48d192aaf2c (patch) | |
tree | 2867f13f5fd5437ba628c67d7f87309ccadcd286 /src/test/rustdoc-gui/docblock-code-block-line-number.goml | |
parent | Releasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip |
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/rustdoc-gui/docblock-code-block-line-number.goml')
-rw-r--r-- | src/test/rustdoc-gui/docblock-code-block-line-number.goml | 27 |
1 files changed, 22 insertions, 5 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 baf9651c4..911ee34be 100644 --- a/src/test/rustdoc-gui/docblock-code-block-line-number.goml +++ b/src/test/rustdoc-gui/docblock-code-block-line-number.goml @@ -1,8 +1,8 @@ // Checks that the setting "line numbers" is working as expected. -goto: file://|DOC_PATH|/test_docs/fn.foo.html +goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" // We check that without this setting, there is no line number displayed. -assert-false: "pre.line-number" +assert-false: "pre.example-line-numbers" // We now set the setting to show the line numbers on code examples. local-storage: {"rustdoc-line-numbers": "true" } @@ -10,13 +10,30 @@ local-storage: {"rustdoc-line-numbers": "true" } reload: // We wait for them to be added into the DOM by the JS... -wait-for: "pre.line-number" +wait-for: "pre.example-line-numbers" // If the test didn't fail, it means that it was found! // Let's now check some CSS properties... -assert-css: ("pre.line-number", { +assert-css: ("pre.example-line-numbers", { "margin": "0px", "padding": "13px 8px", "text-align": "right", }) // 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") +assert-text: ("pre.example-line-numbers", "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.example-line-numbers" + +// Finally, turn it on again. +click: "input#line-numbers + .slider" +wait-for: "pre.example-line-numbers" |