Skip to main content

TestSupportExt

Trait TestSupportExt 

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

Fluent UI test observation, inert unless test-support is enabled. 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) -> 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§

Source§

impl<E> TestSupportExt for E
where E: Element<PrepaintState = Option<Hitbox>> + InteractiveElement,