mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Gradient picker tests: a missing gear row fails the test
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
6617c73d6f
commit
48a0dbfc61
1 file changed
+5
-5
@@ -139,15 +139,15 @@ fn the_preview_still_opens_the_gradient_editor() {
|
||||
assert!(!shown(&h, "Black, White"), "the presets did not open");
|
||||
}
|
||||
|
||||
/// The gear menu's row labelled `label`, once the gear is open.
|
||||
/// Opens the gear and clicks its row labelled `label` when it is enabled (Escape otherwise); whether it was enabled. A
|
||||
/// missing row fails the test.
|
||||
fn gear_row(h: &mut H, label: &str) -> bool {
|
||||
h.get_by_label("Gradient Options").click();
|
||||
h.run_steps(3);
|
||||
let row = h.query_all_by_label(label).find(|node| node.accesskit_node().role() == Role::MenuItem || node.accesskit_node().role() == Role::MenuItemRadio);
|
||||
let enabled = row.as_ref().is_some_and(|node| !node.accesskit_node().is_disabled());
|
||||
if let Some(row) = row
|
||||
&& enabled
|
||||
{
|
||||
let row = row.unwrap_or_else(|| panic!("the gear menu has no row labelled {label:?}"));
|
||||
let enabled = !row.accesskit_node().is_disabled();
|
||||
if enabled {
|
||||
row.click();
|
||||
} else {
|
||||
h.key_press(egui::Key::Escape);
|
||||
|
||||
Reference in new issue
Block a user