Files
arena-tracker/crates/app/src/page/tests/key_fixtures.rs
T
nessarandClaude Opus 5.5 a4f2069f87 Unfold a player's details in the Match Recap (#125)
Damage dealt and taken by type, mitigation, heals and shields on allies,
gold and crowd control, as the source gives them, built once per recap and
only drawn for the player unfolded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 00:28:08 +01:00

15 lines
567 B
Rust

use gpui_kit::{KeyDownEvent, KeyUpEvent, Keystroke, VisualTestContext};
/// Presses and releases `key` on the element focused, as a button reads it (a keystroke alone
/// does not activate it).
pub(super) fn press_key(cx: &mut VisualTestContext, key: &str) {
let keystroke =
cx.update(|_, cx| Keystroke::parse_with_os(key, cx.platform_info().os).unwrap());
cx.simulate_event(KeyDownEvent {
keystroke: keystroke.clone(),
is_held: false,
prefer_character_input: false,
});
cx.simulate_event(KeyUpEvent { keystroke });
}