2022-10-13 09:51:04 -05:00
|
|
|
// Check position and color of the `<sup>` for unsafe elements.
|
2024-04-05 14:38:55 -05:00
|
|
|
include: "utils.goml"
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2022-10-08 11:36:37 -05:00
|
|
|
// If the text isn't displayed, the browser doesn't compute color style correctly...
|
|
|
|
show-text: true
|
|
|
|
|
2022-10-13 09:51:04 -05:00
|
|
|
compare-elements-property: (
|
2023-01-23 15:31:35 -06:00
|
|
|
"//a[@title='fn test_docs::safe_fn']/..",
|
|
|
|
"//a[@title='fn test_docs::unsafe_fn']/..",
|
2022-10-13 09:51:04 -05:00
|
|
|
["clientHeight"]
|
|
|
|
)
|
2022-10-08 11:36:37 -05:00
|
|
|
|
2022-10-13 09:51:04 -05:00
|
|
|
define-function: (
|
|
|
|
"sup-check",
|
|
|
|
// `theme` is the theme being tested.
|
|
|
|
// `color` is the expected color of the `<sup>` element.
|
2024-04-01 14:11:22 -05:00
|
|
|
[theme, color],
|
2023-01-06 08:18:51 -06:00
|
|
|
block {
|
2024-04-05 14:38:55 -05:00
|
|
|
call-function: ("switch-theme", {"theme": |theme|})
|
2023-02-07 20:00:18 -06:00
|
|
|
assert-css: (".item-name sup", {"color": |color|})
|
2023-01-06 08:18:51 -06:00
|
|
|
},
|
2022-10-13 09:51:04 -05:00
|
|
|
)
|
2022-10-08 11:36:37 -05:00
|
|
|
|
2024-04-01 14:11:22 -05:00
|
|
|
call-function: ("sup-check", {
|
|
|
|
"theme": "ayu",
|
|
|
|
"color": "#c5c5c5",
|
|
|
|
})
|
|
|
|
call-function: ("sup-check", {
|
|
|
|
"theme": "dark",
|
|
|
|
"color": "#ddd",
|
|
|
|
})
|
|
|
|
call-function: ("sup-check", {
|
|
|
|
"theme": "light",
|
|
|
|
"color": "black",
|
|
|
|
})
|