Consolidate Integration.Fields into Integration.Session

This commit is contained in:
Adomas Venčkauskas 2020-07-30 15:42:54 +03:00 committed by Dan Stillman
parent 3701b84116
commit 2b3669afd8
2 changed files with 156 additions and 164 deletions

View file

@ -692,12 +692,12 @@ describe("Zotero.Integration", function () {
doc.fields[1].code = doc.fields[0].code;
doc.fields[1].text = doc.fields[0].text;
var originalUpdateDocument = Zotero.Integration.Fields.prototype.updateDocument;
var stubUpdateDocument = sinon.stub(Zotero.Integration.Fields.prototype, 'updateDocument');
var originalUpdateDocument = Zotero.Integration.Session.prototype.updateDocument;
var stubUpdateDocument = sinon.stub(Zotero.Integration.Session.prototype, 'updateDocument');
try {
var indicesLength;
stubUpdateDocument.callsFake(function() {
indicesLength = Object.keys(Zotero.Integration.currentSession.newIndices).length;
indicesLength = Object.keys(this.newIndices).length;
return originalUpdateDocument.apply(this, arguments);
});
@ -726,12 +726,12 @@ describe("Zotero.Integration", function () {
`"citationID":"${newCitationID}"`);
doc.fields[1].text = doc.fields[0].text;
var originalUpdateDocument = Zotero.Integration.Fields.prototype.updateDocument;
var stubUpdateDocument = sinon.stub(Zotero.Integration.Fields.prototype, 'updateDocument');
var originalUpdateDocument = Zotero.Integration.Session.prototype.updateDocument;
var stubUpdateDocument = sinon.stub(Zotero.Integration.Session.prototype, 'updateDocument');
try {
var indices;
stubUpdateDocument.callsFake(function() {
indices = Object.keys(Zotero.Integration.currentSession.newIndices);
indices = Object.keys(this.newIndices);
return originalUpdateDocument.apply(this, arguments);
});