Include a reduced, non-linked PDF file for the attachments API unit test
This commit is contained in:
parent
56ae7a6690
commit
09df1ee0ce
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -250,6 +250,7 @@
|
||||
!bug1175962.pdf
|
||||
!bug1020226.pdf
|
||||
!issue9534_reduced.pdf
|
||||
!attachment.pdf
|
||||
!basicapi.pdf
|
||||
!issue2884_reduced.pdf
|
||||
!mixedfonts.pdf
|
||||
|
BIN
test/pdfs/attachment.pdf
Normal file
BIN
test/pdfs/attachment.pdf
Normal file
Binary file not shown.
@ -692,18 +692,15 @@ describe('api', function() {
|
||||
}).catch(done.fail);
|
||||
});
|
||||
it('gets attachments', function(done) {
|
||||
if (isNodeJS()) { // The PDF file used is a linked test-case.
|
||||
pending('TODO: Use a non-linked test-case.');
|
||||
}
|
||||
var loadingTask = getDocument(buildGetDocumentParams('bug766138.pdf'));
|
||||
var loadingTask = getDocument(buildGetDocumentParams('attachment.pdf'));
|
||||
var promise = loadingTask.promise.then(function (pdfDoc) {
|
||||
return pdfDoc.getAttachments();
|
||||
});
|
||||
promise.then(function (data) {
|
||||
var attachment = data['Press Quality.joboptions'];
|
||||
expect(attachment.filename).toEqual('Press Quality.joboptions');
|
||||
expect(attachment.content instanceof Uint8Array).toBeTruthy();
|
||||
expect(attachment.content.length).toEqual(30098);
|
||||
var attachment = data['foo.txt'];
|
||||
expect(attachment.filename).toEqual('foo.txt');
|
||||
expect(attachment.content).toEqual(
|
||||
new Uint8Array([98, 97, 114, 32, 98, 97, 122, 32, 10]));
|
||||
|
||||
loadingTask.destroy().then(done);
|
||||
}).catch(done.fail);
|
||||
|
Loading…
Reference in New Issue
Block a user