Skip to content

Commit 5514906

Browse files
committed
rustdoc: add test cases for mile wide bar
1 parent 3924493 commit 5514906

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tests/rustdoc-gui/huge-logo.goml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set-window-size: (1280, 1024)
77
assert-property: (".sidebar-crate .logo-container", {"offsetWidth": "96", "offsetHeight": 48})
88
// offsetWidth = width of sidebar, offsetHeight = height + top padding
99
assert-property: (".sidebar-crate .logo-container img", {"offsetWidth": "48", "offsetHeight": 64})
10+
assert-css: (".sidebar-crate .logo-container img", {"border-top-width": "16px", "margin-top": "-16px"})
1011

1112
set-window-size: (400, 600)
1213
// offset = size + margin

tests/rustdoc-gui/sidebar.goml

+15
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,18 @@ assert-property: (".sidebar .sidebar-crate h2 a", {
179179
"offsetTop": |index_sidebar_y|,
180180
"offsetLeft": |index_sidebar_x|,
181181
})
182+
183+
// Check that the sidebar links touch the left side of the box
184+
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
185+
assert-position: (".sidebar .block a", {"x": -4})
186+
assert-position: (".sidebar-crate > h2 > a", {"x": -3})
187+
188+
// Check that the main sidebar links touch the left side of the box
189+
// but the crate name doesn't, because the logo takes that space
190+
go-to: "file://" + |DOC_PATH| + "/huge_logo/index.html"
191+
assert-position: (".sidebar .block a", {"x": -4})
192+
// when side-by-side, it's not line wrapped
193+
assert-position-false: (".sidebar-crate > h2 > a", {"x": -3})
194+
// when line-wrapped, see that it becomes flush-left again
195+
drag-and-drop: ((205, 100), (108, 100))
196+
assert-position: (".sidebar-crate > h2 > a", {"x": -3})

0 commit comments

Comments
 (0)