mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-31 14:17:12 -06:00
* CI: dev builds keep line tables only * CI: one integration-test binary per crate * CI: xtask runs tests with nextest, doctests apart, --keep-going on clippy and wasm cargo xtask test runs the workspace tests (--lib --bins --tests) with cargo-nextest when it is installed, else cargo test, then the doctests. cargo xtask ci uses the same two steps. * CI: docs name cargo xtask test * CI: agent guides name the moved fuzz test * CI: tests added on main join their crate's test binary
28 lines
1.0 KiB
Rust
28 lines
1.0 KiB
Rust
//! Form dialogs fit their content: OK and Cancel sit right under the last field, not halfway down
|
|
//! a window stretched to the screen's height.
|
|
|
|
use egui_kittest::kittest::Queryable as _;
|
|
use gridcraft_engine::Session;
|
|
use gridcraft_ui_egui::SheetApp;
|
|
use serde_json::json;
|
|
|
|
#[test]
|
|
fn ok_and_cancel_sit_under_the_last_field() {
|
|
let mut s = Session::new();
|
|
s.new_workbook();
|
|
let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 1000.0)).build_ui_state(
|
|
|ui, app: &mut SheetApp| {
|
|
let ctx = ui.ctx().clone();
|
|
app.logic(&ctx);
|
|
app.ui(ui);
|
|
},
|
|
SheetApp::new(s, Default::default()),
|
|
);
|
|
h.state_mut().open_dialog("cfQuick", json!({"type": "cellIs", "operator": "greaterThan", "title": "Greater Than…"}));
|
|
h.run_steps(4);
|
|
let last = h.get_by_label("Red Border").rect();
|
|
let ok = h.get_by_label_contains("OK").rect();
|
|
let gap = ok.top() - last.bottom();
|
|
assert!((0.0..40.0).contains(&gap), "OK is {gap} points under the last option");
|
|
}
|