@@ -81,11 +81,25 @@ define-function: (
81
81
"hover_color": |fn_color|,
82
82
})
83
83
84
- call-function: ("check-container-color", {
85
- "path_color": |path_color|,
86
- "hover_path_color": |hover_path_color|,
87
- "hover_background": |hover_background|,
88
- })
84
+ // Checking the `<a>` container.
85
+ move-cursor-to: ".search-input"
86
+ focus: ".search-input" // To ensure the `<a>` container isn't focused or hovered.
87
+ assert-css: (
88
+ "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
89
+ {"color": |path_color|, "background-color": "transparent"},
90
+ ALL,
91
+ )
92
+
93
+ // Checking color and background on hover.
94
+ move-cursor-to: "//*[@class='desc'][text()='Just a normal struct.']"
95
+ assert-css: (
96
+ "//*[@class='result-name']//*[text()='test_docs::']",
97
+ {"color": |hover_path_color|},
98
+ )
99
+ assert-css: (
100
+ "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
101
+ {"color": |hover_path_color|, "background-color": |hover_background|},
102
+ )
89
103
}
90
104
)
91
105
@@ -126,32 +140,6 @@ define-function: (
126
140
},
127
141
)
128
142
129
- define-function: (
130
- "check-container-color",
131
- [path_color, hover_path_color, hover_background],
132
- block {
133
- // Checking the `<a>` container.
134
- move-cursor-to: ".search-input"
135
- focus: ".search-input" // To ensure the `<a>` container isn't focused or hovered.
136
- assert-css: (
137
- "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
138
- {"color": |path_color|, "background-color": "transparent"},
139
- ALL,
140
- )
141
-
142
- // Checking color and background on hover.
143
- move-cursor-to: "//*[@class='desc'][text()='Just a normal struct.']"
144
- assert-css: (
145
- "//*[@class='result-name']//*[text()='test_docs::']",
146
- {"color": |hover_path_color|},
147
- )
148
- assert-css: (
149
- "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
150
- {"color": |hover_path_color|, "background-color": |hover_background|},
151
- )
152
- }
153
- )
154
-
155
143
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo"
156
144
157
145
// This is needed so that the text color is computed.
0 commit comments