Skip to content

Commit

Permalink
Use simulate_click to close the popup
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Jan 3, 2025
1 parent 0f51edb commit ea8278d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/egui_kittest/tests/regression_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,16 @@ fn test_combobox() {
results.push(harness.try_snapshot("combobox_opened"));

let item_2 = harness.get_by_role_and_label(Role::Button, "Item 2");
item_2.click();
// Node::click doesn't close the popup, so we use simulate_click
item_2.simulate_click();

harness.run();

assert_eq!(harness.state(), &1);

// Popup should be closed now
assert!(harness.query_by_label("Item 2").is_none());

for result in results {
if let Err(err) = result {
panic!("{}", err);
Expand Down

0 comments on commit ea8278d

Please sign in to comment.