@@ -50,9 +50,9 @@ set-local-storage: {"rustdoc-theme": "light"}
50
50
// We reload the page so the local storage settings are being used.
51
51
reload:
52
52
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 )
56
56
assert-count: (".sidebar h2", 1)
57
57
assert-text: ("#all-types", "All Items")
58
58
assert-css: ("#all-types", {"color": "#356da4"})
@@ -74,8 +74,9 @@ assert-text: ("#structs + .item-table .item-name > a", "Foo")
74
74
click: "#structs + .item-table .item-name > a"
75
75
76
76
// PAGE: struct.Foo.html
77
+ assert-count: (".sidebar .sidebar-crate", 1)
77
78
assert-count: (".sidebar .location", 1)
78
- assert-count: (".sidebar h2", 2 )
79
+ assert-count: (".sidebar h2", 3 )
79
80
// We check that there is no crate listed outside of the top level.
80
81
assert-false: ".sidebar-elems > .crate"
81
82
@@ -94,7 +95,8 @@ click: ".sidebar-elems ul.crate > li:first-child > a"
94
95
// PAGE: lib2/index.html
95
96
go-to: "file://" + |DOC_PATH| + "/lib2/index.html"
96
97
assert-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)
98
100
// We check that we have the crates list and that the "current" on is now "lib2".
99
101
assert-text: (".sidebar-elems ul.crate > li > a.current", "lib2")
100
102
// We now go to the "foobar" function page.
@@ -108,21 +110,25 @@ click: "#functions + .item-table .item-name > a"
108
110
109
111
// PAGE: fn.foobar.html
110
112
// 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")
112
115
assert-count: (".sidebar .location", 0)
113
- assert-count: (".sidebar h2", 1 )
116
+ assert-count: (".sidebar h2", 2 )
114
117
assert-text: (".sidebar .sidebar-elems h2", "In lib2")
115
118
// We check that we don't have the crate list.
116
119
assert-false: ".sidebar-elems > .crate"
117
120
118
121
go-to: "./module/index.html"
119
122
assert-property: (".sidebar", {"clientWidth": "200"})
123
+ assert-text: (".sidebar > .sidebar-crate > h2 > a", "lib2")
120
124
assert-text: (".sidebar > .location", "Module module")
125
+ assert-count: (".sidebar .location", 1)
121
126
// We check that we don't have the crate list.
122
127
assert-false: ".sidebar-elems > .crate"
123
128
124
129
go-to: "./sub_module/sub_sub_module/index.html"
125
130
assert-property: (".sidebar", {"clientWidth": "200"})
131
+ assert-text: (".sidebar > .sidebar-crate > h2 > a", "lib2")
126
132
assert-text: (".sidebar > .location", "Module sub_sub_module")
127
133
// We check that we don't have the crate list.
128
134
assert-false: ".sidebar-elems .crate"
@@ -152,14 +158,14 @@ assert-property: (".sidebar", {"clientWidth": "200"})
152
158
153
159
// Checks that all.html and index.html have their sidebar link in the same place.
154
160
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
155
- store-property: (".sidebar .location a", {
161
+ store-property: (".sidebar .sidebar-crate h2 a", {
156
162
"clientWidth": index_sidebar_width,
157
163
"clientHeight": index_sidebar_height,
158
164
"offsetTop": index_sidebar_y,
159
165
"offsetLeft": index_sidebar_x,
160
166
})
161
167
go-to: "file://" + |DOC_PATH| + "/test_docs/all.html"
162
- assert-property: (".sidebar .location a", {
168
+ assert-property: (".sidebar .sidebar-crate h2 a", {
163
169
"clientWidth": |index_sidebar_width|,
164
170
"clientHeight": |index_sidebar_height|,
165
171
"offsetTop": |index_sidebar_y|,
0 commit comments