@@ -50,9 +50,9 @@ set-local-storage: {"rustdoc-theme": "light"}
5050// We reload the page so the local storage settings are being used.
5151reload:
5252
53- assert-text: (".sidebar > .location ", "Crate test_docs")
54- // In modules, we only have one "location" element.
55- assert-count: (".sidebar .location", 1 )
53+ assert-text: (".sidebar > .sidebar-crate > h2 > a ", "test_docs")
54+ // Crate root has no "location" element
55+ assert-count: (".sidebar .location", 0 )
5656assert-count: (".sidebar h2", 1)
5757assert-text: ("#all-types", "All Items")
5858assert-css: ("#all-types", {"color": "#356da4"})
@@ -74,8 +74,9 @@ assert-text: ("#structs + .item-table .item-name > a", "Foo")
7474click: "#structs + .item-table .item-name > a"
7575
7676// PAGE: struct.Foo.html
77+ assert-count: (".sidebar .sidebar-crate", 1)
7778assert-count: (".sidebar .location", 1)
78- assert-count: (".sidebar h2", 2 )
79+ assert-count: (".sidebar h2", 3 )
7980// We check that there is no crate listed outside of the top level.
8081assert-false: ".sidebar-elems > .crate"
8182
@@ -94,7 +95,8 @@ click: ".sidebar-elems ul.crate > li:first-child > a"
9495// PAGE: lib2/index.html
9596go-to: "file://" + |DOC_PATH| + "/lib2/index.html"
9697assert-property: (".sidebar", {"clientWidth": "200"})
97- assert-text: (".sidebar > .location", "Crate lib2")
98+ assert-text: (".sidebar > .sidebar-crate > h2 > a", "lib2")
99+ assert-count: (".sidebar .location", 0)
98100// We check that we have the crates list and that the "current" on is now "lib2".
99101assert-text: (".sidebar-elems ul.crate > li > a.current", "lib2")
100102// We now go to the "foobar" function page.
@@ -108,21 +110,25 @@ click: "#functions + .item-table .item-name > a"
108110
109111// PAGE: fn.foobar.html
110112// In items containing no items (like functions or constants) and in modules, we have no
111- // "location" elements. Only the parent module h2.
113+ // "location" elements. Only the parent module h2 and crate.
114+ assert-text: (".sidebar > .sidebar-crate > h2 > a", "lib2")
112115assert-count: (".sidebar .location", 0)
113- assert-count: (".sidebar h2", 1 )
116+ assert-count: (".sidebar h2", 2 )
114117assert-text: (".sidebar .sidebar-elems h2", "In lib2")
115118// We check that we don't have the crate list.
116119assert-false: ".sidebar-elems > .crate"
117120
118121go-to: "./module/index.html"
119122assert-property: (".sidebar", {"clientWidth": "200"})
123+ assert-text: (".sidebar > .sidebar-crate > h2 > a", "lib2")
120124assert-text: (".sidebar > .location", "Module module")
125+ assert-count: (".sidebar .location", 1)
121126// We check that we don't have the crate list.
122127assert-false: ".sidebar-elems > .crate"
123128
124129go-to: "./sub_module/sub_sub_module/index.html"
125130assert-property: (".sidebar", {"clientWidth": "200"})
131+ assert-text: (".sidebar > .sidebar-crate > h2 > a", "lib2")
126132assert-text: (".sidebar > .location", "Module sub_sub_module")
127133// We check that we don't have the crate list.
128134assert-false: ".sidebar-elems .crate"
@@ -152,14 +158,14 @@ assert-property: (".sidebar", {"clientWidth": "200"})
152158
153159// Checks that all.html and index.html have their sidebar link in the same place.
154160go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
155- store-property: (".sidebar .location a", {
161+ store-property: (".sidebar .sidebar-crate h2 a", {
156162 "clientWidth": index_sidebar_width,
157163 "clientHeight": index_sidebar_height,
158164 "offsetTop": index_sidebar_y,
159165 "offsetLeft": index_sidebar_x,
160166})
161167go-to: "file://" + |DOC_PATH| + "/test_docs/all.html"
162- assert-property: (".sidebar .location a", {
168+ assert-property: (".sidebar .sidebar-crate h2 a", {
163169 "clientWidth": |index_sidebar_width|,
164170 "clientHeight": |index_sidebar_height|,
165171 "offsetTop": |index_sidebar_y|,
0 commit comments