Files
gridcraft/crates/ui-egui/tests/it/support.rs
T
skylar taylor-barrick 41769f1d16 Migrate GridCraft to egui 0.37 (#2543)
* E37: migrate GridCraft to egui 0.37

Pin the reviewed fork and shared dependencies, adapt input and rendering to the
new frame lifecycle, and preserve bounded capture handling and font notices.
Add representative accessibility checks and meaningful control labels.

Validation: full repository CI passed all ten stages, with 2,249 tests passed,
zero failed and one existing timing test ignored. Native workflows and paired
performance qualification remain documented separately.

* egui037: record final published pins and local qualification

* M0.37: fix RTL clipping and preserve screenshot budgets

* test: share migrated GridCraft UI harness setup

* egui037: document migrated UI and regression contracts

* egui-037: align popup test fonts and avoid redundant tooltip probes
2026-10-25 14:55:00 -04:00

42 lines
1.8 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! Constructors for the suite's usual harness shapes.
//!
//! The strict font and lifecycle setup stays in `crate::common`; these wrap it at the sizes and
//! step timings the `it` tests share. Keeping them here (rather than in `common`) leaves the
//! `keytips` test binary's copy of `common` free of helpers only this binary uses.
use crate::common::{Harness, app, builder, harness_with, prepare};
use gridcraft_engine::Session;
use gridcraft_ui_egui::{Services, SheetApp};
/// A blank workbook session, as most integration tests start.
pub fn blank_session() -> Session {
let mut session = Session::new();
session.new_workbook();
session
}
/// The suite's usual 1200×800 harness around `session`, warmed for `steps` frames.
pub fn harness(session: Session, steps: usize) -> Harness {
harness_with(builder().with_size(egui::vec2(1200.0, 800.0)), app(session), steps)
}
/// A blank workbook in the suite's usual 1200×800 harness.
pub fn blank_harness(steps: usize) -> Harness {
harness(blank_session(), steps)
}
/// A 1200×800 harness advancing in 1/60 s frames, for drags and hover sequences.
pub fn stepped_harness(session: Session) -> Harness {
harness_with(builder().with_step_dt(1.0 / 60.0).with_size(egui::vec2(1200.0, 800.0)), app(session), 4)
}
/// A harness around an app built with the caller's `Services` (e.g. a test inbox).
pub fn services_harness(services: Services, steps: usize) -> Harness {
harness_with(builder().with_size(egui::vec2(1200.0, 800.0)), prepare(SheetApp::new(blank_session(), services)), steps)
}
/// A harness around an already-prepared `app`, at the suite's usual 1200×800 size.
pub fn app_harness(app: SheetApp, steps: usize) -> Harness {
harness_with(builder().with_size(egui::vec2(1200.0, 800.0)), app, steps)
}