mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add check for trait impl method anchor
This commit is contained in:
@@ -45,6 +45,22 @@ define-function: (
|
||||
{"color": |src_link_color|, "text-decoration": "none"},
|
||||
)
|
||||
|
||||
// Now we ensure that the `§` anchor is "reachable" for users on trait methods.
|
||||
// To ensure the anchor is not hovered, we move the cursor to another item.
|
||||
move-cursor-to: "#search-button"
|
||||
// By default, the anchor is not displayed.
|
||||
wait-for-css: ("#method\.vroum .anchor", {"display": "none"})
|
||||
// Once we move the cursor to the method, the anchor should appear.
|
||||
move-cursor-to: "#method\.vroum .code-header"
|
||||
assert-css-false: ("#method\.vroum .anchor", {"display": "none"})
|
||||
// Now we move the cursor to the anchor to check there is no gap between the method and the
|
||||
// anchor, making the anchor disappear and preventing users to click on it.
|
||||
// To make it work, we need to first move it between the method and the anchor.
|
||||
store-position: ("#method\.vroum .code-header", {"x": method_x, "y": method_y})
|
||||
move-cursor-to: (|method_x| - 2, |method_y|)
|
||||
// Anchor should still be displayed.
|
||||
assert-css-false: ("#method\.vroum .anchor", {"display": "none"})
|
||||
|
||||
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
|
||||
// Since we changed page, we need to set the theme again.
|
||||
call-function: ("switch-theme", {"theme": |theme|})
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
#![stable(feature = "some_feature", since = "1.3.5")]
|
||||
#![doc(rust_logo)]
|
||||
|
||||
pub trait X {
|
||||
fn vroum();
|
||||
}
|
||||
|
||||
#[stable(feature = "some_feature", since = "1.3.5")]
|
||||
pub struct Foo {}
|
||||
|
||||
@@ -13,3 +17,7 @@ pub fn bar() {}
|
||||
#[stable(feature = "some_other_feature", since = "1.3.6")]
|
||||
pub fn yo() {}
|
||||
}
|
||||
|
||||
impl X for Foo {
|
||||
fn vroum() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user