Skip to content

Commit 464dcb1

Browse files
authored
Delete detectedItemType if it matches items (zotero#23)
1 parent a1ad5e1 commit 464dcb1

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

testTranslators/translatorTester.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -741,13 +741,18 @@ Zotero_TranslatorTester.prototype._createTest = function(translate, detectResult
741741
var items = translate.newItems;
742742
}
743743

744-
testReadyCallback(this,
745-
{
746-
type: this.type,
747-
url: translate.document.location.href,
748-
detectedItemType: detectResult,
749-
items: items,
750-
});
744+
let testObject = {
745+
type: this.type,
746+
url: translate.document.location.href,
747+
detectedItemType: detectResult,
748+
items,
749+
};
750+
// Delete detectedItemType if it matches items
751+
if (items === 'multiple' && detectResult === 'multiple'
752+
|| items.length == 1 && detectResult === items[0].itemType) {
753+
delete testObject.detectedItemType;
754+
}
755+
testReadyCallback(this, testObject);
751756
};
752757

753758

0 commit comments

Comments
 (0)