Fix accessDate when translators set CURRENT_TIMESTAMP
(But it also seems like we always do that automatically for web translators, so I'm not sure why so many translators set that.)
This commit is contained in:
parent
d92f5669f3
commit
6673c64ac6
2 changed files with 18 additions and 0 deletions
|
@ -400,6 +400,20 @@ describe("Zotero.Translate", function() {
|
|||
assert.isAbove(delta, -500);
|
||||
assert.isBelow(delta, 5000);
|
||||
});
|
||||
|
||||
it('web translators should set accessDate to current date for CURRENT_TIMESTAMP', function* () {
|
||||
let myItem = {
|
||||
itemType: "webpage",
|
||||
title: "Test Item",
|
||||
url: "https://www.zotero.org/",
|
||||
accessDate: 'CURRENT_TIMESTAMP'
|
||||
};
|
||||
let newItems = yield saveItemsThroughTranslator("web", [myItem]);
|
||||
let currentDate = new Date();
|
||||
let delta = currentDate - Zotero.Date.sqlToDate(newItems[0].getField("accessDate"), true);
|
||||
assert.isAbove(delta, -500);
|
||||
assert.isBelow(delta, 5000);
|
||||
});
|
||||
|
||||
it('web translators should save attachments', function* () {
|
||||
let myItems = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue