Skip to content

Commit 592028a

Browse files
Add rustdoc-gui regression test for #137082
1 parent 6b2f5cf commit 592028a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tests/rustdoc-gui/code-example-buttons.goml

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ click: ".example-wrap .copy-button"
2626
move-cursor-to: ".search-input"
2727
assert-count: (".example-wrap:not(:hover) .button-holder.keep-visible", 0)
2828
assert-css: (".example-wrap .copy-button", { "visibility": "hidden" })
29+
// Since we clicked on the copy button, the clipboard content should have been updated.
30+
assert-clipboard: 'println!("nothing fancy");\nprintln!("but with two lines!");'
2931

3032
define-function: (
3133
"check-buttons",

tests/rustdoc-gui/copy-path.goml

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
// Checks that the "copy path" button is not triggering JS error and its display
2-
// isn't broken.
3-
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
2+
// isn't broken and the copied path is as expected.
3+
go-to: "file://" + |DOC_PATH| + "/test_docs/foreign_impl_order/trait.Foo.html"
4+
5+
// We ensure that the clipboard is empty.
6+
assert-clipboard: ""
47

58
// First we store the size of the button before we click on it.
69
store-size: ("#copy-path", {"width": width, "height": height})
710
click: "#copy-path"
811
// We wait for the new text to appear.
912
wait-for: "#copy-path.clicked"
13+
// We check that the clipboard value is the expected one.
14+
assert-clipboard: "test_docs::foreign_impl_order::Foo"
1015
// We check that the size didn't change.
1116
assert-size: ("#copy-path.clicked", {"width": |width|, "height": |height|})
1217
// We wait for the button to turn back to its original state.

0 commit comments

Comments
 (0)