2022-09-24 14:31:34 +00:00
|
|
|
// This test checks links colors in sidebar before and after hover.
|
2024-04-05 19:38:55 +00:00
|
|
|
include: "utils.goml"
|
2023-04-11 17:11:34 +00:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
|
2022-09-24 14:31:34 +00:00
|
|
|
|
|
|
|
// This is needed so that the text color is computed.
|
|
|
|
show-text: true
|
|
|
|
|
2022-11-01 14:48:13 +00:00
|
|
|
define-function: (
|
|
|
|
"check-colors",
|
2024-04-01 19:11:22 +00:00
|
|
|
[
|
2022-11-01 14:48:13 +00:00
|
|
|
theme, struct, struct_hover, struct_hover_background, enum, enum_hover,
|
|
|
|
enum_hover_background, union, union_hover, union_hover_background, trait, trait_hover,
|
|
|
|
trait_hover_background, fn, fn_hover, fn_hover_background, type, type_hover,
|
|
|
|
type_hover_background, keyword, keyword_hover, keyword_hover_background,
|
2024-04-01 19:11:22 +00:00
|
|
|
],
|
2023-01-06 14:18:51 +00:00
|
|
|
block {
|
2024-04-05 19:38:55 +00:00
|
|
|
call-function: ("switch-theme", {"theme": |theme|})
|
2022-11-01 14:48:13 +00:00
|
|
|
// Struct
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (
|
2023-09-08 01:45:24 +00:00
|
|
|
".sidebar .block.struct li:not(.current) a",
|
2022-11-01 14:48:13 +00:00
|
|
|
{"color": |struct|, "background-color": "rgba(0, 0, 0, 0)"},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
2023-09-08 01:45:24 +00:00
|
|
|
move-cursor-to: ".sidebar .block.struct li:not(.current) a"
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.struct a:hover",
|
|
|
|
{"color": |struct_hover|, "background-color": |struct_hover_background|},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
2022-11-01 14:48:13 +00:00
|
|
|
// Enum
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.enum a",
|
|
|
|
{"color": |enum|, "background-color": "rgba(0, 0, 0, 0)"},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
|
|
|
move-cursor-to: ".sidebar .block.enum a"
|
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.enum a:hover",
|
|
|
|
{"color": |enum_hover|, "background-color": |enum_hover_background|},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
2022-11-01 14:48:13 +00:00
|
|
|
// Union
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.union a",
|
|
|
|
{"color": |union|, "background-color": "rgba(0, 0, 0, 0)"},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
|
|
|
move-cursor-to: ".sidebar .block.union a"
|
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.union a:hover",
|
|
|
|
{"color": |union_hover|, "background-color": |union_hover_background|},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
2022-11-01 14:48:13 +00:00
|
|
|
// Trait
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.trait a",
|
|
|
|
{"color": |trait|, "background-color": "rgba(0, 0, 0, 0)"},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
|
|
|
move-cursor-to: ".sidebar .block.trait a"
|
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.trait a:hover",
|
|
|
|
{"color": |trait_hover|, "background-color": |trait_hover_background|},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
2022-11-01 14:48:13 +00:00
|
|
|
// Function
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.fn a",
|
|
|
|
{"color": |fn|, "background-color": "rgba(0, 0, 0, 0)"},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
|
|
|
move-cursor-to: ".sidebar .block.fn a"
|
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.fn a:hover",
|
|
|
|
{"color": |fn_hover|, "background-color": |fn_hover_background|},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
2022-11-01 14:48:13 +00:00
|
|
|
// Type definition
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.type a",
|
|
|
|
{"color": |type|, "background-color": "rgba(0, 0, 0, 0)"},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
|
|
|
move-cursor-to: ".sidebar .block.type a"
|
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.type a:hover",
|
|
|
|
{"color": |type_hover|, "background-color": |type_hover_background|},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
2022-11-01 14:48:13 +00:00
|
|
|
// Keyword
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.keyword a",
|
|
|
|
{"color": |keyword|, "background-color": "rgba(0, 0, 0, 0)"},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
|
|
|
move-cursor-to: ".sidebar .block.keyword a"
|
|
|
|
assert-css: (
|
2022-11-01 14:48:13 +00:00
|
|
|
".sidebar .block.keyword a:hover",
|
|
|
|
{"color": |keyword_hover|, "background-color": |keyword_hover_background|},
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
|
|
|
}
|
2022-09-24 14:31:34 +00:00
|
|
|
)
|
|
|
|
|
2022-11-01 14:48:13 +00:00
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "ayu",
|
2023-08-12 10:05:13 +00:00
|
|
|
"struct": "#53b1db",
|
|
|
|
"struct_hover": "#ffb44c",
|
|
|
|
"struct_hover_background": "transparent",
|
|
|
|
"enum": "#53b1db",
|
|
|
|
"enum_hover": "#ffb44c",
|
|
|
|
"enum_hover_background": "transparent",
|
|
|
|
"union": "#53b1db",
|
|
|
|
"union_hover": "#ffb44c",
|
|
|
|
"union_hover_background": "transparent",
|
|
|
|
"trait": "#53b1db",
|
|
|
|
"trait_hover": "#ffb44c",
|
|
|
|
"trait_hover_background": "transparent",
|
|
|
|
"fn": "#53b1db",
|
|
|
|
"fn_hover": "#ffb44c",
|
|
|
|
"fn_hover_background": "transparent",
|
|
|
|
"type": "#53b1db",
|
|
|
|
"type_hover": "#ffb44c",
|
|
|
|
"type_hover_background": "transparent",
|
|
|
|
"keyword": "#53b1db",
|
|
|
|
"keyword_hover": "#ffb44c",
|
|
|
|
"keyword_hover_background": "transparent",
|
2022-11-01 14:48:13 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "dark",
|
2023-08-12 10:05:13 +00:00
|
|
|
"struct": "#fdbf35",
|
|
|
|
"struct_hover": "#fdbf35",
|
|
|
|
"struct_hover_background": "#444",
|
|
|
|
"enum": "#fdbf35",
|
|
|
|
"enum_hover": "#fdbf35",
|
|
|
|
"enum_hover_background": "#444",
|
|
|
|
"union": "#fdbf35",
|
|
|
|
"union_hover": "#fdbf35",
|
|
|
|
"union_hover_background": "#444",
|
|
|
|
"trait": "#fdbf35",
|
|
|
|
"trait_hover": "#fdbf35",
|
|
|
|
"trait_hover_background": "#444",
|
|
|
|
"fn": "#fdbf35",
|
|
|
|
"fn_hover": "#fdbf35",
|
|
|
|
"fn_hover_background": "#444",
|
|
|
|
"type": "#fdbf35",
|
|
|
|
"type_hover": "#fdbf35",
|
|
|
|
"type_hover_background": "#444",
|
|
|
|
"keyword": "#fdbf35",
|
|
|
|
"keyword_hover": "#fdbf35",
|
|
|
|
"keyword_hover_background": "#444",
|
2022-11-01 14:48:13 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "light",
|
2023-08-12 10:05:13 +00:00
|
|
|
"struct": "#356da4",
|
|
|
|
"struct_hover": "#356da4",
|
|
|
|
"struct_hover_background": "#fff",
|
|
|
|
"enum": "#356da4",
|
|
|
|
"enum_hover": "#356da4",
|
|
|
|
"enum_hover_background": "#fff",
|
|
|
|
"union": "#356da4",
|
|
|
|
"union_hover": "#356da4",
|
|
|
|
"union_hover_background": "#fff",
|
|
|
|
"trait": "#356da4",
|
|
|
|
"trait_hover": "#356da4",
|
|
|
|
"trait_hover_background": "#fff",
|
|
|
|
"fn": "#356da4",
|
|
|
|
"fn_hover": "#356da4",
|
|
|
|
"fn_hover_background": "#fff",
|
|
|
|
"type": "#356da4",
|
|
|
|
"type_hover": "#356da4",
|
|
|
|
"type_hover_background": "#fff",
|
|
|
|
"keyword": "#356da4",
|
|
|
|
"keyword_hover": "#356da4",
|
|
|
|
"keyword_hover_background": "#fff",
|
2022-11-01 14:48:13 +00:00
|
|
|
}
|
2022-09-24 14:31:34 +00:00
|
|
|
)
|