11// Checks multiple things on the sidebar display (width of its elements, colors, etc).
22goto: file://|DOC_PATH|/test_docs/index.html
3+ assert-property: (".sidebar", {"clientWidth": "200"})
34show-text: true
45local-storage: {"rustdoc-theme": "light"}
56// We reload the page so the local storage settings are being used.
@@ -39,11 +40,13 @@ assert-property: ("html", {"scrollTop": "0"})
3940
4041// We now go back to the crate page to click on the "lib2" crate link.
4142goto: file://|DOC_PATH|/test_docs/index.html
43+ assert-property: (".sidebar", {"clientWidth": "200"})
4244assert-css: (".sidebar-elems .crate > ul > li:first-child > a", {"color": "rgb(53, 109, 164)"})
4345click: ".sidebar-elems .crate > ul > li:first-child > a"
4446
4547// PAGE: lib2/index.html
4648goto: file://|DOC_PATH|/lib2/index.html
49+ assert-property: (".sidebar", {"clientWidth": "200"})
4750assert-text: (".sidebar > .location", "Crate lib2")
4851// We check that we have the crates list and that the "current" on is now "lib2".
4952assert-text: (".sidebar-elems .crate > ul > li > a.current", "lib2")
@@ -65,11 +68,13 @@ assert-text: (".sidebar .sidebar-elems .location", "In lib2")
6568assert-false: ".sidebar-elems > .crate"
6669
6770goto: ./module/index.html
71+ assert-property: (".sidebar", {"clientWidth": "200"})
6872assert-text: (".sidebar > .location", "Module module")
6973// We check that we don't have the crate list.
7074assert-false: ".sidebar-elems > .crate"
7175
7276goto: ./sub_module/sub_sub_module/index.html
77+ assert-property: (".sidebar", {"clientWidth": "200"})
7378assert-text: (".sidebar > .location", "Module sub_sub_module")
7479// We check that we don't have the crate list.
7580assert-false: ".sidebar-elems .crate"
@@ -78,11 +83,21 @@ assert-text: ("#functions + .item-table .item-left > a", "foo")
7883
7984// Links to trait implementations in the sidebar should not wrap even if they are long.
8085goto: file://|DOC_PATH|/lib2/struct.HasALongTraitWithParams.html
86+ assert-property: (".sidebar", {"clientWidth": "200"})
8187assert-property: (".sidebar-elems section .block li > a", {"offsetHeight": 29})
8288
8389// Test that clicking on of the "In <module>" headings in the sidebar links to the
8490// appropriate anchor in index.html.
8591goto: file://|DOC_PATH|/test_docs/struct.Foo.html
92+ assert-property: (".sidebar", {"clientWidth": "200"})
8693click: ".block.mod h3 a"
8794// PAGE: index.html
8895assert-css: ("#modules", {"background-color": "rgb(253, 255, 211)"})
96+ 
97+ // Finally, assert that the `[+]/[−]` toggle doesn't affect sidebar width.
98+ click: "#toggle-all-docs"
99+ assert-text: ("#toggle-all-docs", "[+]")
100+ assert-property: (".sidebar", {"clientWidth": "200"})
101+ click: "#toggle-all-docs"
102+ assert-text: ("#toggle-all-docs", "[−]")
103+ assert-property: (".sidebar", {"clientWidth": "200"})
0 commit comments