From a371b24f2a1c0484288fd9700d429216f3917f02 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Thu, 5 Nov 2026 01:25:41 +0100 Subject: [PATCH] test(sign): tighten the NeedAppearances tests (#5939) Co-Authored-By: Claude Sonnet 5.5 --- crates/sign/tests/it/pdf.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/sign/tests/it/pdf.rs b/crates/sign/tests/it/pdf.rs index ce4b30de9e..137960e83b 100644 --- a/crates/sign/tests/it/pdf.rs +++ b/crates/sign/tests/it/pdf.rs @@ -130,8 +130,8 @@ fn form_of(bytes: &[u8]) -> Dict { } /// A form with `/NeedAppearances true` makes Acrobat ignore the signature (#5939): the first -/// signature drops the flag, whether the AcroForm is inline or indirect, and leaves the rest of -/// the form alone. +/// signature drops the flag, whether the AcroForm is inline or indirect, and keeps /Fields and +/// sets /SigFlags. #[test] fn signing_drops_need_appearances() { let id = pkcs12::open(&data("ec-p256.p12"), "test").unwrap(); @@ -170,6 +170,8 @@ fn a_later_signature_does_not_change_need_appearances() { let flagged = write_incremental(&doc, &SaveOptions { object_streams: false, ..SaveOptions::default() }).unwrap(); let second = pdfcraft_sign::sign(&open(&flagged), &id, &opts()).unwrap(); assert_eq!(form_of(&second).get(b"NeedAppearances"), Some(&Object::Bool(true))); + let doc = open(&second); + assert!(signatures(&doc, &second, &TrustStore::default()).iter().any(|s| s.field == "Approval" && s.signed)); } #[test]