Move check-container-color's code into check-search-color function

This commit is contained in:
Guillaume Gomez 2024-04-06 15:52:00 +02:00
parent 2b1c799636
commit 53c5a69dfd

View File

@ -81,11 +81,25 @@ define-function: (
"hover_color": |fn_color|, "hover_color": |fn_color|,
}) })
call-function: ("check-container-color", { // Checking the `<a>` container.
"path_color": |path_color|, move-cursor-to: ".search-input"
"hover_path_color": |hover_path_color|, focus: ".search-input" // To ensure the `<a>` container isn't focused or hovered.
"hover_background": |hover_background|, assert-css: (
}) "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
{"color": |path_color|, "background-color": "transparent"},
ALL,
)
// Checking color and background on hover.
move-cursor-to: "//*[@class='desc'][text()='Just a normal struct.']"
assert-css: (
"//*[@class='result-name']//*[text()='test_docs::']",
{"color": |hover_path_color|},
)
assert-css: (
"//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
{"color": |hover_path_color|, "background-color": |hover_background|},
)
} }
) )
@ -126,32 +140,6 @@ define-function: (
}, },
) )
define-function: (
"check-container-color",
[path_color, hover_path_color, hover_background],
block {
// Checking the `<a>` container.
move-cursor-to: ".search-input"
focus: ".search-input" // To ensure the `<a>` container isn't focused or hovered.
assert-css: (
"//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
{"color": |path_color|, "background-color": "transparent"},
ALL,
)
// Checking color and background on hover.
move-cursor-to: "//*[@class='desc'][text()='Just a normal struct.']"
assert-css: (
"//*[@class='result-name']//*[text()='test_docs::']",
{"color": |hover_path_color|},
)
assert-css: (
"//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
{"color": |hover_path_color|, "background-color": |hover_background|},
)
}
)
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo" go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo"
// This is needed so that the text color is computed. // This is needed so that the text color is computed.