Tests: build the flattener test's Save PDF job with its drawing

`SavePdfJob` gained a private `document` field in #9549, and the
Transparency Flattener dialog test added in #9692 builds the job as a
struct literal without it, so `vectorcraft-ui-egui`'s tests no longer
compile on main (flatten.rs:480, "cannot construct `SavePdfJob` with
struct literal syntax due to private fields"). Each pull request passed
its own CI before the other merged.

The field is now `pub(crate)` like the job's other fields, and the test
takes the drawing from the active document, as the Save PDF dialog does
when it opens.
This commit is contained in:
dotCooCoo committed 2026-11-26 23:17:29 -08:00
1 parent 97da102592
commit 3f0353326b
2 files changed
+3 -1

No files matched your search

+2
View File
@@ -477,7 +477,9 @@ mod tests {
});
fixture.room(egui::vec2(880.0, 720.0));
let ctx = fixture.ctx().clone();
let document = app.borrow().session.active().unwrap().uid;
let mut job = SavePdfJob {
document,
path: None,
save_mode: None,
flattener: Some(FlattenOptions { line_art_ppi: 611.0, ..FlattenOptions::default() }),
+1 -1
View File
@@ -38,7 +38,7 @@ const WRONG_DOCUMENT: &str = "Return to the original drawing to save the PDF or
/// What the Save PDF dialog was opened for; the preset editor has none.
pub(crate) struct SavePdfJob {
/// The drawing this job reads and writes.
document: u64,
pub(crate) document: u64,
/// The file the PDF goes to; none: the write asks.
pub(crate) path: Option<String>,
/// The save command (`file.saveAs`, `file.saveCopy`) this PDF finishes; none: a plain PDF copy.