@@ -128,8 +128,8 @@ assert-count: (".sidebar .location", 1)
128128// - Module name, followed by TOC for module headings
129129// - "In crate [name]" parent pointer, followed by sibling navigation
130130assert-count: (".sidebar h2", 3)
131- assert-text: (".sidebar > .sidebar-elems > h2", "In crate lib2")
132- assert-property: (".sidebar > .sidebar-elems > h2 > a", {
131+ assert-text: (".sidebar > .sidebar-elems > #ModNav > h2", "In crate lib2")
132+ assert-property: (".sidebar > .sidebar-elems > #ModNav > h2 > a", {
133133 "href": "/lib2/index.html",
134134}, ENDS_WITH)
135135// We check that we don't have the crate list.
@@ -139,8 +139,8 @@ go-to: "./sub_module/sub_sub_module/index.html"
139139assert-property: (".sidebar", {"clientWidth": "200"})
140140assert-text: (".sidebar > .sidebar-crate > h2 > a", "lib2")
141141assert-text: (".sidebar .location", "Module sub_sub_module")
142- assert-text: (".sidebar > .sidebar-elems > h2", "In lib2::module::sub_module")
143- assert-property: (".sidebar > .sidebar-elems > h2 > a", {
142+ assert-text: (".sidebar > .sidebar-elems > #ModNav > h2", "In lib2::module::sub_module")
143+ assert-property: (".sidebar > .sidebar-elems > #ModNav > h2 > a", {
144144 "href": "/module/sub_module/index.html",
145145}, ENDS_WITH)
146146// We check that we don't have the crate list.
@@ -184,3 +184,36 @@ assert-property: (".sidebar .sidebar-crate h2 a", {
184184 "offsetTop": |index_sidebar_y|,
185185 "offsetLeft": |index_sidebar_x|,
186186})
187+
188+ // Configuration option to show TOC in sidebar.
189+ set-local-storage: {"rustdoc-hide-toc": "true"}
190+ go-to: "file://" + |DOC_PATH| + "/test_docs/enum.WhoLetTheDogOut.html"
191+ assert-css: ("#TOC", {"display": "none"})
192+ assert-css: (".sidebar .in-crate", {"display": "none"})
193+ set-local-storage: {"rustdoc-hide-toc": "false"}
194+ go-to: "file://" + |DOC_PATH| + "/test_docs/enum.WhoLetTheDogOut.html"
195+ assert-css: ("#TOC", {"display": "block"})
196+ assert-css: (".sidebar .in-crate", {"display": "block"})
197+
198+ set-local-storage: {"rustdoc-hide-modnav": "true"}
199+ go-to: "file://" + |DOC_PATH| + "/test_docs/enum.WhoLetTheDogOut.html"
200+ assert-css: ("#ModNav", {"display": "none"})
201+ set-local-storage: {"rustdoc-hide-modnav": "false"}
202+ go-to: "file://" + |DOC_PATH| + "/test_docs/enum.WhoLetTheDogOut.html"
203+ assert-css: ("#ModNav", {"display": "block"})
204+
205+ set-local-storage: {"rustdoc-hide-toc": "true"}
206+ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
207+ assert-css: ("#TOC", {"display": "none"})
208+ assert-false: ".sidebar .in-crate"
209+ set-local-storage: {"rustdoc-hide-toc": "false"}
210+ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
211+ assert-css: ("#TOC", {"display": "block"})
212+ assert-false: ".sidebar .in-crate"
213+
214+ set-local-storage: {"rustdoc-hide-modnav": "true"}
215+ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
216+ assert-css: ("#ModNav", {"display": "none"})
217+ set-local-storage: {"rustdoc-hide-modnav": "false"}
218+ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
219+ assert-css: ("#ModNav", {"display": "block"})
0 commit comments