Skip to content

Commit 0fae87a

Browse files
Add GUI test to check colors of alias in search results
1 parent e4067a3 commit 0fae87a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
goto: file://|DOC_PATH|/test_docs/index.html
2+
// We set the theme so we're sure that the corect values will be used, whatever the computer
3+
// this test is running on.
4+
local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"}
5+
// If the text isn't displayed, the browser doesn't compute color style correctly...
6+
show-text: true
7+
// We reload the page so the local storage settings are being used.
8+
reload:
9+
write: (".search-input", "thisisanalias")
10+
// Waiting for the search results to appear...
11+
wait-for: "#titles"
12+
// Checking that the colors for the alias element are the ones expected.
13+
assert: (".result-name > .alias", {"color": "rgb(255, 255, 255)"})
14+
assert: (".result-name > .alias > .grey", {"color": "rgb(204, 204, 204)"})

src/test/rustdoc-gui/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ impl Foo {
3636
}
3737

3838
/// Just a normal enum.
39+
#[doc(alias = "ThisIsAnAlias")]
3940
pub enum WhoLetTheDogOut {
4041
/// Woof!
4142
Woof,

0 commit comments

Comments
 (0)