37 lines
1.0 KiB
Rust
37 lines
1.0 KiB
Rust
use gpui::{ParentElement as _, Render, Styled as _, TestAppContext, Window, div};
|
|
use gpui_native_core::progress::Progress;
|
|
use gpui_native_theme::Theme;
|
|
|
|
struct Harness;
|
|
|
|
impl Render for Harness {
|
|
fn render(
|
|
&mut self,
|
|
_window: &mut Window,
|
|
_cx: &mut gpui::Context<Self>,
|
|
) -> impl gpui::IntoElement {
|
|
div()
|
|
.size_full()
|
|
.flex()
|
|
.flex_col()
|
|
.gap_2()
|
|
.child(Progress::new("test-progress", 0.6).accessibility_label("Upload"))
|
|
.child(
|
|
Progress::new("test-progress-indeterminate", 0.0)
|
|
.indeterminate(true)
|
|
.accessibility_label("Working"),
|
|
)
|
|
}
|
|
}
|
|
|
|
#[gpui::test]
|
|
fn determinate_and_indeterminate_bars_draw_headlessly(cx: &mut TestAppContext) {
|
|
cx.update(Theme::init);
|
|
let (view, visual) = cx.add_window_view(|_, _| Harness);
|
|
let _ = view;
|
|
visual.run_until_parked();
|
|
visual.update(|window, cx| {
|
|
window.draw(cx).clear(cx);
|
|
});
|
|
}
|