Skip to content

Commit ea97bdc

Browse files
Update/add tests for source sidebar in mobile mode
1 parent 27ff258 commit ea97bdc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/test/rustdoc-gui/sidebar-source-code-display.goml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,13 @@ assert-css: (
116116
"#source-sidebar .expand + .children .folders .name",
117117
{"color": "rgb(255, 180, 76)", "background-color": "rgb(20, 25, 31)"},
118118
)
119+
120+
// Now checking on mobile devices.
121+
size: (500, 700)
122+
reload:
123+
// Waiting for the sidebar to be displayed...
124+
wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
125+
126+
// We now check it takes the full size of the display.
127+
assert-property: ("body", {"clientWidth": "500", "clientHeight": "700"})
128+
assert-property: (".sidebar", {"clientWidth": "500", "clientHeight": "700"})

src/test/rustdoc-gui/sidebar-source-code.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ assert: "nav.sidebar"
1818

1919
// We now switch to mobile mode.
2020
size: (600, 600)
21-
// We check that the sidebar has the expected width (0 and 1px for the border).
22-
assert-css: ("nav.sidebar", {"width": "1px"})
21+
// We check that the sidebar has the expected width (0).
22+
assert-css: ("nav.sidebar", {"width": "0px"})
2323
// We expand the sidebar.
2424
click: "#sidebar-toggle"
2525
assert-css: (".source-sidebar-expanded nav.sidebar", {"width": "600px"})

0 commit comments

Comments
 (0)