Merge pull request #4812 from Snuffleupagus/more-api-unittests
Add more unit tests for the API
This commit is contained in:
commit
b7d8296902
@ -449,7 +449,7 @@ var Catalog = (function CatalogClosure() {
|
|||||||
},
|
},
|
||||||
get attachments() {
|
get attachments() {
|
||||||
var xref = this.xref;
|
var xref = this.xref;
|
||||||
var attachments, nameTreeRef;
|
var attachments = null, nameTreeRef;
|
||||||
var obj = this.catDict.get('Names');
|
var obj = this.catDict.get('Names');
|
||||||
if (obj) {
|
if (obj) {
|
||||||
nameTreeRef = obj.getRaw('EmbeddedFiles');
|
nameTreeRef = obj.getRaw('EmbeddedFiles');
|
||||||
|
@ -69,6 +69,18 @@ describe('api', function() {
|
|||||||
0, 841.89, null] });
|
0, 841.89, null] });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('gets attachments', function() {
|
||||||
|
var promise = doc.getAttachments();
|
||||||
|
waitsForPromise(promise, function (data) {
|
||||||
|
expect(data).toEqual(null);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('gets javascript', function() {
|
||||||
|
var promise = doc.getJavaScript();
|
||||||
|
waitsForPromise(promise, function (data) {
|
||||||
|
expect(data).toEqual([]);
|
||||||
|
});
|
||||||
|
});
|
||||||
it('gets outline', function() {
|
it('gets outline', function() {
|
||||||
var promise = doc.getOutline();
|
var promise = doc.getOutline();
|
||||||
waitsForPromise(promise, function(outline) {
|
waitsForPromise(promise, function(outline) {
|
||||||
@ -93,6 +105,12 @@ describe('api', function() {
|
|||||||
expect(true).toEqual(true);
|
expect(true).toEqual(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('gets filesize in bytes', function() {
|
||||||
|
var promise = doc.getDownloadInfo();
|
||||||
|
waitsForPromise(promise, function (data) {
|
||||||
|
expect(data.length).toEqual(105779);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
describe('Page', function() {
|
describe('Page', function() {
|
||||||
var resolvePromise;
|
var resolvePromise;
|
||||||
|
Loading…
Reference in New Issue
Block a user