]> git.proxmox.com Git - rustc.git/blame - src/test/rustdoc-gui/sidebar-source-code.goml
Update unsuspicious file list
[rustc.git] / src / test / rustdoc-gui / sidebar-source-code.goml
CommitLineData
a2a8927a
XL
1// The goal of this test is to ensure that the sidebar is working as expected in the source
2// code pages.
2b03887a 3goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
a2a8927a
XL
4// First: desktop mode.
5size: (1100, 800)
6// We check that the sidebar isn't expanded and has the expected width.
7assert-css: ("nav.sidebar", {"width": "50px"})
8// We now click on the button to expand the sidebar.
9click: (10, 10)
5e7ed085 10// We wait for the sidebar to be expanded.
923072b8
FG
11wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "300px"})
12assert-css: (".source-sidebar-expanded nav.sidebar a", {"font-size": "14px"})
a2a8927a
XL
13// We collapse the sidebar.
14click: (10, 10)
a2a8927a 15// We ensure that the class has been removed.
923072b8 16wait-for: "html:not(.expanded)"
a2a8927a
XL
17assert: "nav.sidebar"
18
064997fb 19// Checking that only the path to the current file is "open".
2b03887a 20goto: "file://" + |DOC_PATH| + "/src/lib2/another_folder/sub_mod/mod.rs.html"
064997fb
FG
21// First we expand the sidebar again.
22click: (10, 10)
23// We wait for the sidebar to be expanded.
24wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "300px"})
25assert: "//*[@class='dir-entry' and @open]/*[text()='lib2']"
26assert: "//*[@class='dir-entry' and @open]/*[text()='another_folder']"
27assert: "//*[@class='dir-entry' and @open]/*[text()='sub_mod']"
28// Only "another_folder" should be "open" in "lib2".
29assert: "//*[@class='dir-entry' and not(@open)]/*[text()='another_mod']"
30// All other trees should be collapsed.
487cf647 31assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 7)
064997fb 32
a2a8927a
XL
33// We now switch to mobile mode.
34size: (600, 600)
064997fb 35wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "600px"})
a2a8927a
XL
36// We collapse the sidebar.
37click: (10, 10)
064997fb
FG
38// We check that the sidebar has the expected width (0).
39assert-css: ("nav.sidebar", {"width": "0px"})
a2a8927a 40// We ensure that the class has been removed.
923072b8 41assert-false: ".source-sidebar-expanded"
a2a8927a 42assert: "nav.sidebar"
5099ac24
FG
43
44// Check that the topbar is not visible
2b03887a 45assert-false: ".mobile-topbar"