Skip to content

Commit

Permalink
Delete detectedItemType if it matches items (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek authored Apr 12, 2023
1 parent a1ad5e1 commit 464dcb1
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions testTranslators/translatorTester.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,13 +741,18 @@ Zotero_TranslatorTester.prototype._createTest = function(translate, detectResult
var items = translate.newItems;
}

testReadyCallback(this,
{
type: this.type,
url: translate.document.location.href,
detectedItemType: detectResult,
items: items,
});
let testObject = {
type: this.type,
url: translate.document.location.href,
detectedItemType: detectResult,
items,
};
// Delete detectedItemType if it matches items
if (items === 'multiple' && detectResult === 'multiple'
|| items.length == 1 && detectResult === items[0].itemType) {
delete testObject.detectedItemType;
}
testReadyCallback(this, testObject);
};


Expand Down

0 comments on commit 464dcb1

Please sign in to comment.