Skip to main content

TestSupportExt

Trait TestSupportExt 

Source
pub trait TestSupportExt:
    Element<PrepaintState = Option<Hitbox>>
    + InteractiveElement
    + Sized {
    // Provided method
    fn test_support(self) -> ObservedElement<Self> { ... }
}
Expand description

Registers an existing element for UI queries. Its native accessibility properties are read automatically; there are no test-only property setters.

Test-only values cannot override the native control:

use gpui::{div, prelude::*};
use gpui_base::TestSupportExt;
div().id("input").test_support().test_props(|props| props.value("invented"));

Provided Methods§

Source

fn test_support(self) -> ObservedElement<Self>

With test-support, observes the element without adding a layout node. Otherwise returns the original element with its exact native type. Call before track_focus so the actual focus binding can be observed. Querying focus on a focus-capable element with a missed binding panics.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§