Fix the "should get form info when AcroForm is present" unit-test

The last unit-test didn't work correctly, since an error was thrown in `PDFDocument._hasOnlyDocumentSignatures` because the mocked `XRef`-instance wasn't actually being set correctly.

Also, updates the `XRefMock` to use `async` methods where appropriate.
This commit is contained in:
Jonas Jenwald 2020-10-15 13:20:27 +02:00
parent a373137304
commit 5f8957e8df
2 changed files with 9 additions and 8 deletions

View file

@ -93,8 +93,8 @@ class XRefMock {
return this._map[ref.toString()];
}
fetchAsync(ref) {
return Promise.resolve(this.fetch(ref));
async fetchAsync(ref) {
return this.fetch(ref);
}
fetchIfRef(obj) {
@ -104,8 +104,8 @@ class XRefMock {
return this.fetch(obj);
}
fetchIfRefAsync(obj) {
return Promise.resolve(this.fetchIfRef(obj));
async fetchIfRefAsync(obj) {
return this.fetchIfRef(obj);
}
}