Export project PDFs through route-D when selected

This commit is contained in:
gloamxun committed 2026-10-21 01:15:09 +08:00
1 parent 21cc743236
commit c3277531d3
4 files changed
+25 -2

No files matched your search

+17
View File
@@ -260,6 +260,23 @@ fn serves_project_api_preview_and_pdf() {
let pdf = server.request("POST", "/api/projects/hello/pdf", &[], "application/pdf");
assert_eq!(pdf.status, 200, "{}", String::from_utf8_lossy(&pdf.body));
assert!(pdf.body.starts_with(b"%PDF-"), "missing PDF header");
let route_d_pdf = server.request(
"POST",
"/api/projects/hello/pdf?engine=route-d",
&[],
"application/pdf",
);
assert_eq!(
route_d_pdf.status,
200,
"{}",
String::from_utf8_lossy(&route_d_pdf.body)
);
assert!(
route_d_pdf.body.starts_with(b"%PDF-"),
"missing route-D PDF header"
);
}
#[test]