Add tests for new toggle on deref blocks
This commit is contained in:
parent
a868b3fce7
commit
9855a3844b
30
tests/rustdoc-gui/deref-block.goml
Normal file
30
tests/rustdoc-gui/deref-block.goml
Normal file
@ -0,0 +1,30 @@
|
||||
// This test ensures that several clickable items actually have the pointer cursor.
|
||||
go-to: "file://" + |DOC_PATH| + "/lib2/struct.Derefer.html"
|
||||
|
||||
assert-text: (".big-toggle summary", "Methods from Deref<Target = str>§")
|
||||
// We ensure it doesn't go over `§`.
|
||||
assert-css: (".big-toggle summary::before", {
|
||||
"left": "-34px",
|
||||
"top": "9px",
|
||||
})
|
||||
// It should NOT have the same X or Y position as the other toggles.
|
||||
compare-elements-position-false: (
|
||||
".big-toggle summary::before",
|
||||
".method-toggle summary::before",
|
||||
["x", "y"],
|
||||
)
|
||||
|
||||
// We now check that if we're in mobile mode, it gets back to its original X position.
|
||||
set-window-size: (600, 600)
|
||||
assert-css: (".big-toggle summary::before", {
|
||||
"left": "-11px",
|
||||
"top": "9px",
|
||||
})
|
||||
// It should have the same X position as the other toggles.
|
||||
compare-elements-position: (".big-toggle summary::before", ".method-toggle summary::before", ["x"])
|
||||
// But still shouldn't have the same Y position.
|
||||
compare-elements-position-false: (
|
||||
".big-toggle summary::before",
|
||||
".method-toggle summary::before",
|
||||
["y"],
|
||||
)
|
@ -355,3 +355,13 @@ pub trait TraitWithLongItemsName {
|
||||
fn this_is_a_method_with_a_long_name_returning_something() -> String;
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Derefer(String);
|
||||
|
||||
impl std::ops::Deref for Derefer {
|
||||
type Target = str;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user