about summary refs log tree commit diff
path: root/src/test/rustdoc-gui
diff options
context:
space:
mode:
authorJacob Hoffman-Andrews <github@hoffman-andrews.com>2022-02-03 22:50:32 -0800
committerJacob Hoffman-Andrews <github@hoffman-andrews.com>2022-02-05 22:11:27 -0800
commite27ebb5dff38aad9fbaa3d957820a1bd3c8d3bbf (patch)
treeb51fdee4e4d109e05bf2465be5c462f1a03820df /src/test/rustdoc-gui
parent4c55c8362de32be1530b2441c3e3a51e73edeb21 (diff)
downloadrust-e27ebb5dff38aad9fbaa3d957820a1bd3c8d3bbf.tar.gz
rust-e27ebb5dff38aad9fbaa3d957820a1bd3c8d3bbf.zip
Linkify sidebar headings for sibling items
Also adjust CSS so this doesn't produce excess padding/margin.
Diffstat (limited to 'src/test/rustdoc-gui')
-rw-r--r--src/test/rustdoc-gui/sidebar-mobile.goml2
-rw-r--r--src/test/rustdoc-gui/sidebar.goml7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/test/rustdoc-gui/sidebar-mobile.goml b/src/test/rustdoc-gui/sidebar-mobile.goml
index 60bcffe120b..ef588a69f1d 100644
--- a/src/test/rustdoc-gui/sidebar-mobile.goml
+++ b/src/test/rustdoc-gui/sidebar-mobile.goml
@@ -39,4 +39,4 @@ assert-position: ("#method\.must_use", {"y": 45})
 // Check that the bottom-most item on the sidebar menu can be scrolled fully into view.
 click: ".sidebar-menu-toggle"
 scroll-to: ".block.keyword li:nth-child(1)"
-assert-position: (".block.keyword li:nth-child(1)", {"y": 542.96875})
+assert-position: (".block.keyword li:nth-child(1)", {"y": 542.234375})
diff --git a/src/test/rustdoc-gui/sidebar.goml b/src/test/rustdoc-gui/sidebar.goml
index ef3a92ad7a6..9505e00512f 100644
--- a/src/test/rustdoc-gui/sidebar.goml
+++ b/src/test/rustdoc-gui/sidebar.goml
@@ -78,3 +78,10 @@ assert-text: ("#functions + .item-table .item-left > a", "foo")
 // Links to trait implementations in the sidebar should not wrap even if they are long.
 goto: file://|DOC_PATH|/lib2/struct.HasALongTraitWithParams.html
 assert-property: (".sidebar-links a", {"offsetHeight": 29})
+
+// Test that clicking on of the "In <module>" headings in the sidebar links to the
+// appropriate anchor in index.html.
+goto: file://|DOC_PATH|/test_docs/struct.Foo.html
+click: ".block.mod h3 a"
+// PAGE: index.html
+assert-css: ("#modules", {"background-color": "rgb(253, 255, 211)"})