2022-10-13 14:51:04 +00:00
|
|
|
// Check position and color of the `<sup>` for unsafe elements.
|
2023-04-11 17:11:34 +00:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2022-10-08 16:36:37 +00:00
|
|
|
// If the text isn't displayed, the browser doesn't compute color style correctly...
|
|
|
|
show-text: true
|
|
|
|
|
2022-10-13 14:51:04 +00:00
|
|
|
compare-elements-property: (
|
2023-01-23 21:31:35 +00:00
|
|
|
"//a[@title='fn test_docs::safe_fn']/..",
|
|
|
|
"//a[@title='fn test_docs::unsafe_fn']/..",
|
2022-10-13 14:51:04 +00:00
|
|
|
["clientHeight"]
|
|
|
|
)
|
2022-10-08 16:36:37 +00:00
|
|
|
|
2022-10-13 14:51:04 +00:00
|
|
|
define-function: (
|
|
|
|
"sup-check",
|
|
|
|
// `theme` is the theme being tested.
|
|
|
|
// `color` is the expected color of the `<sup>` element.
|
|
|
|
(theme, color),
|
2023-01-06 14:18:51 +00:00
|
|
|
block {
|
2022-10-13 14:51:04 +00:00
|
|
|
// Set the theme.
|
2023-04-11 17:11:34 +00:00
|
|
|
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
|
2022-10-13 14:51:04 +00:00
|
|
|
// We reload the page so the local storage settings are being used.
|
2023-01-06 14:18:51 +00:00
|
|
|
reload:
|
2023-02-08 02:00:18 +00:00
|
|
|
assert-css: (".item-name sup", {"color": |color|})
|
2023-01-06 14:18:51 +00:00
|
|
|
},
|
2022-10-13 14:51:04 +00:00
|
|
|
)
|
2022-10-08 16:36:37 +00:00
|
|
|
|
2023-08-15 12:46:54 +00:00
|
|
|
call-function: ("sup-check", ("ayu", "#c5c5c5"))
|
|
|
|
call-function: ("sup-check", ("dark", "#ddd"))
|
|
|
|
call-function: ("sup-check", ("light", "black"))
|