]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/sidebar-source-code.goml
1c5eb9239ba8bba6468a73153205a0e4d10a8513
[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 (there is a 0.5s animation).
11 wait-for: 600
12 assert-css: ("nav.sidebar.expanded", {"width": "300px"})
13 assert-css: ("nav.sidebar.expanded a", {"font-size": "14.4px"})
14 // We collapse the sidebar.
15 click: (10, 10)
16 // We wait for the sidebar to be collapsed (there is a 0.5s animation).
17 wait-for: 600
18 // We ensure that the class has been removed.
19 assert-false: "nav.sidebar.expanded"
20 assert: "nav.sidebar"
21
22 // We now switch to mobile mode.
23 size: (600, 600)
24 // We check that the sidebar has the expected width (0 and 1px for the border).
25 assert-css: ("nav.sidebar", {"width": "1px"})
26 // We expand the sidebar.
27 click: "#sidebar-toggle"
28 assert-css: ("nav.sidebar.expanded", {"width": "600px"})
29 // We collapse the sidebar.
30 click: (10, 10)
31 // We ensure that the class has been removed.
32 assert-false: "nav.sidebar.expanded"
33 assert: "nav.sidebar"
34
35 // Check that the topbar is not visible
36 assert-property: (".mobile-topbar", {"offsetParent": "null"})