]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/sidebar-source-code.goml
Rollup merge of #95373 - RalfJung:invalid_value, r=davidtwco
[rust.git] / src / test / rustdoc-gui / sidebar-source-code.goml
1 // The goal of this test is to ensure that the sidebar is working as expected in the source
2 // code pages.
3 goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
4 // First: desktop mode.
5 size: (1100, 800)
6 // We check that the sidebar isn't expanded and has the expected width.
7 assert-css: ("nav.sidebar", {"width": "50px"})
8 // We now click on the button to expand the sidebar.
9 click: (10, 10)
10 // We wait for the sidebar to be expanded.
11 wait-for-css: ("nav.sidebar.expanded", {"width": "300px"})
12 assert-css: ("nav.sidebar.expanded a", {"font-size": "14px"})
13 // We collapse the sidebar.
14 click: (10, 10)
15 // We ensure that the class has been removed.
16 wait-for: "nav.sidebar:not(.expanded)"
17 assert: "nav.sidebar"
18
19 // We now switch to mobile mode.
20 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"})
23 // We expand the sidebar.
24 click: "#sidebar-toggle"
25 assert-css: ("nav.sidebar.expanded", {"width": "600px"})
26 // We collapse the sidebar.
27 click: (10, 10)
28 // We ensure that the class has been removed.
29 assert-false: "nav.sidebar.expanded"
30 assert: "nav.sidebar"
31
32 // Check that the topbar is not visible
33 assert-property: (".mobile-topbar", {"offsetParent": "null"})